I am trying to figure out how to pass a variable from flash to an html page. For example: Lets say I have an html page with an embedded flash .swf file and a read only text box, and when the user clicks on button 1 in the flash file, the text box reads 'One', and when the user clicks on button 2, the text box reads 'Two'. Keep in mind that the text box isn't in the flash .swf file, but on the html page itself.
I've looked around quite a bit and can't seem to find the solution. All I've found is a bunch of articles on how to pass variable to a swf file, not retrieve them from it.
How do I pass a variable from an embedded .swf flash file to html?
You will have to do this via javascript. You can have your flash actionscript call javascript functions on the HTML page. Then through that you can easily set the text of a textbox using javascript DOM functionality.
The following message board talks a bit about it and provides some code that shows you some actionscript / javascript action. This should give you an idea of how you can merge the two to produce your desired result.
Good luck
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment