473,581 Members | 2,307 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

swfobject

anfetienne
424 Contributor
is it possible to add php array to vars in the swfobject code?
Jul 18 '09 #1
49 5949
Markus
6,050 Recognized Expert Expert
Have a look at encoding your array with json_encode and then, using action script decode it.
Jul 18 '09 #2
anfetienne
424 Contributor
ok thanks marcus, ill go through that once ive set my computer back up properlly
Jul 18 '09 #3
Markus
6,050 Recognized Expert Expert
@anfetienne
OK - let me know how you get on. Bear in mind that the link I gave you is for AS2, I think.

Mark.
Jul 19 '09 #4
anfetienne
424 Contributor
as the example shows for json_encode does it have to be on echo or can i assign it to a var then pass it to flash using swfobject?
Jul 20 '09 #5
Markus
6,050 Recognized Expert Expert
No - just encode and pass it as a flash var.
Jul 20 '09 #6
anfetienne
424 Contributor
so ok does this look right to you as this is what i have......bear in mind all data is coming from a db

Expand|Select|Wrap|Line Numbers
  1. $user="theau10_tawUser";
  2. $pass="auction10";
  3. $data="theau10_resources";
  4.  
  5. $connection=mysql_connect("localhost" ,"$user", "$pass") or die("Unable to connect!");
  6.  
  7. @mysql_select_db($data) or die( "Unable to select database");
  8.  
  9. // Select column 1 from table name where column name = $your_var.
  10. $sql = "SELECT * FROM savedTemps WHERE tempID = '{$random_digit}'";
  11. // If mysql_query returns false, we'll die with the error.
  12. $res = mysql_query( $sql ) or die( mysql_error );
  13.  
  14. // If a there is a match
  15. if ( mysql_num_rows( $res ) > 0 )
  16. {
  17. $row = mysql_fetch_array( $res );
  18.  
  19. }
  20.  
  21. $myVar = json_encode($row);
  22.  
Jul 20 '09 #7
anfetienne
424 Contributor
and then after that i can pass $row into flash with swf object i decode it by doing

#include "json.as"

trace( myVar );

varData = JSON.decode(myV ar)

???
Jul 20 '09 #8
Markus
6,050 Recognized Expert Expert
Sounds about right - yes. Try it out and see.
Jul 20 '09 #9
dmgz
6 New Member
JSON.as: Line 37: Classes may only be defined in external ActionScript 2.0 class scripts.
class JSON {


what is this? how can i fix it?
i use flash 8
Jul 21 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2700
by: dragze | last post by:
Hi, On one of the pages of my site i use two javascripts, one makes transparency of png's work in IE, and the other embeds a flash player. Now use one of the scripts it works fine, use both and the transparency script stops working. So for example, use just the png transparency script and it displays the png's correctly in IE, as soon as i add...
9
4294
by: Dariusz Tomoń | last post by:
Hello, I'd like to include JS from C# code (ASP.NET 2.0). I'm trying not directly from i.e. default.aspx.cs code but from a class belonging to DLL, which is referred in my project. The code is as follow: Page.ClientScript.RegisterClientScriptInclude(Page.GetType(),"swfobject.js","swfobject.js");
1
2436
by: luispunchy | last post by:
I have a .swf file that is going in the web page for the logo. It is supposed to be 610px wide and 81px in height when rendered in the HTML. The actual .swf file, when viewed standalone, appears much larger than that - but I presume I should be able to just set its rendered / desired dimensions when I embed it in the HTML, as usual. The odd...
3
1610
by: K. | last post by:
Hello! I have a problem with javascript script called: SWFObject. I have a web page which displays on IE 7.0. i Firefox in a good way. All flash objects are displayed on a web page. The problem is on IE 6.0. I have i.e. 9 flash swf objects, but only 6 of them are displayed. I don`t know why. I think it is not my fault as a code programmer.
3
3142
by: yogarajan | last post by:
hi friend this is my code <script type="text/javascript"> // <!]> </script> it is working fine for (open file) file:///D:/WebSite4/swfobject/swfobject1-5/fullpage.html
0
1695
by: jay11 | last post by:
Hello peeps I am trying to run a banner with SWFObject from within PHP/Mambo. I have two others SWF in the same page, so I know it works. Also checked the Developer tool in Chrome and saw that the .js file was loaded. Clicked the link of the SWF I want to see displayed and it runs in another window. Also if I call it via localhost...
2
1768
mikek12004
by: mikek12004 | last post by:
Trying to build a flash rotator which takes some swf from a db and rotates them. In the head I have <script type="text/javascript"> clock_ads(1); function clock_ads(i) { <?php $q1=mysql_query("select * from banners"); $c1=mysql_num_rows($q1);
0
1925
by: jeddiki | last post by:
I am reading up on this swfobject which uses javascript to embed the swf files. They say that I need to have adobe flash player 9.0 Well I was going to use Flowplayer. Does this mean that if I use swfobject then I can not use Flowplayer? Or am I getting mixed up ?
0
7868
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7792
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8175
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5674
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3805
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3827
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1403
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1138
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.