PDA

View Full Version : Question about Sending parameters to a SWF from PHP


beachley
07-23-2005, 10:30 PM
My problem is this:

I have an "edit" link in one php page which will go to a php page with the flash editor application embedded in it. I want to send parameters to the page with the flash application and have those parameters read in when the application starts. Is that possible?

So I have a link:

<a href="editor.php?param1=x&param2=y">Edit</a>

and editor.php contains a flash movie that I want param1 and param2 read into.

Please let me know if this is possible and very simply how it is done!

Thanks!

stormwild
07-24-2005, 12:54 AM
This may help:

http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_14253

Check out the fourth method subtitled, "On a Query String in HTML tags".

Another way would be to use FlashVars:

http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_16417

The FlashVars property of Macromedia Flash Player provides an efficient method of importing variables into the top level of a movie when first instantiated. This feature requires Flash Player 6 (or later).

The PHP script which generates the HTML page that holds the Flash movie, in this case editor.php, needs to include the parameters passed to it in the object and embed tags.

Additional notes when passing variables to local swfs:

http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_16543