The following code demonstrates the HTML in the document that is responsible for
embedding a Flash document in an HTML page. You need to look at this HTML to
understand how URL variables work in the following step (where you add additional code
for URL variables).
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=8,0,0,0" width="550" height="400"
id="urlvariables" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="urlvariables.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="urlvariables.swf" quality="high" bgcolor="#ffffff"
width="550" height="400" name="urlvariables" align="middle"
allowScriptAccess="sameDomain" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
6.
To pass variables from the generated HTML document to your Flash document, you can
pass variables after the path and filename (urlvariables.swf). Add the bold text to the
HTML file that was generated on your desktop.
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=8,0,0,0" width="550" height="400"
id="urlvariables" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="urlvariables.swf?myURL=http://
weblogs.macromedia.com" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="urlvariables.swf?myURL=http://weblogs.macromedia.com"
quality="high" bgcolor="#ffffff" width="550" height="400"
name="urlvariables" align="middle" allowScriptAccess="sameDomain"
type="application/x-shockwave-flash" pluginspage="http://
www.macromedia.com/go/getflashplayer" />
</object>
7.
If you want to pass multiple variables to Flash, you need to separate the name/values pairs
with an ampersand (&). Find the following code from step 6:
?myURL=http://weblogs.macromedia.com
Replace it with the following text:
?myURL=http://weblogs.macromedia.com&myTitle=Macromedia+News+Aggregator
102
Data and Data Types
Need help?
Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?