The easiest way in the world to pass information INTO a Flash - Page 4
Variations are good
No you know what we are "feeding" the URL.swf flash movie with. You could easily replace my 2 simple lines with some smart code that picks up values from hidden form fields or text boxes, etc. No let examine the sample flash file.
Look at the demo!
Go to http://www.TiranDagan.com/Personal/URL/demo.htm to see this trick in action. After you see the demo, read on to learn the last bit necessary to "capture" the information from within Flash.
Capture the parameters in Flash
This part is really simple. Once the SWF file is launched with the parameters as the name of the file, they become available through the _URL property. What I did in my FLA is to decode (unescape) the _URL property, and display it. Look at the included FLA source code attached to this project, and you are set.
s = unescape (_URL); ueURL = s.substr(s.indexOf ("?")+1,s.length);
Fig. 4 The code in Frame 1 of the FLA
Comment: "ueURL" is a dynamic text box on frame one which displays the parameter from within the URL.
If you have any other questions about this code drop me a line at tiran@TiranDagan.com and visit my website www.6footmedia.com. If you are interested in further development of this concept, feel free to contact us.
|» Level Intermediate|
Rating: 8 Votes: 43
|At the age of 14, Tiran got his first "gig" as a programmer for a film production company. Since then, he has managed large development teams on PC, VAX and Unix. His roots are in the Z80, 8086 and Apple Green Book of operating system mnemonics, but Tiran incorporates his extensive background in art, music and general knowledge into object-oriented programming. His work combines video, audio, animations and server side programming.|
|Download the files used in this tutorial.|
|Download (2 kb)|
|More help? Search our boards for quick answers!|