473,698 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ


424 Contributor
is it possible to add php array to vars in the swfobject code?
Jul 18 '09 #1
49 5959
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
424 Contributor
ok thanks marcus, ill go through that once ive set my computer back up properlly
Jul 18 '09 #3
6,050 Recognized Expert Expert
OK - let me know how you get on. Bear in mind that the link I gave you is for AS2, I think.

Jul 19 '09 #4
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
6,050 Recognized Expert Expert
No - just encode and pass it as a flash var.
Jul 20 '09 #6
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";
  5. $connection=mysql_connect("localhost" ,"$user", "$pass") or die("Unable to connect!");
  7. @mysql_select_db($data) or die( "Unable to select database");
  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 );
  14. // If a there is a match
  15. if ( mysql_num_rows( $res ) > 0 )
  16. {
  17. $row = mysql_fetch_array( $res );
  19. }
  21. $myVar = json_encode($row);
Jul 20 '09 #7
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
6,050 Recognized Expert Expert
Sounds about right - yes. Try it out and see.
Jul 20 '09 #9
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

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 the SWFobject (flash embedding) script the transparency script stops working!!?? :S Any help...
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");
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 thing is that the .swf, when embedded and viewed in the web page, is displayed extremely small. I...
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.
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
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 ..../x.swf it works. It just DOESN'T work when called from within PHP. Here is the code I am using. If any...
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);
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 ?
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.