Retrieve querystring value in Flash Actionscript

Associate
Joined
6 Jan 2006
Posts
1,023
Location
Midlands
Hi
I am following a flash tutorial for creating a simple image gallery.

It includes the following actionscript codes from the site
http://www.kirupa.com/developer/mx2004/xml_flash_photogallery2.htm

I have got the code working, but i need help modifying the code so it loads an xml file i pass in. i.e. <embed src="imagegallery.swf?XML=myfile.xml"...

At the moment it is set to images.xml as you can see from the code.

Can someone help me?
 
try..

in the html, within the flash object:
Code:
<param name="movie" value="imagegallery.swf?xmlVar=images.xml"/>
in flash:
Code:
xmlData.load(xmlVar);

edit: perhaps i spoke to soon, it works in IE but not FF.. the latter requires FlashVars *sigh*, so you have to use both methods to support both browsers..

Code:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="param_test" width="240" height="240" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
[COLOR="Yellow"]<param name="movie" value="param_test.swf?myURL=hello.xml"/>[/COLOR]
<param name="quality" value="high" />
[COLOR="Yellow"]<param name="FlashVars" value="myURL=hello.xml" />[/COLOR]
<param name="bgcolor" value="#99ccff" />
<embed src="param_test.swf" [COLOR="Yellow"]FlashVars="myURL=hello.xml"[/COLOR] quality="high" bgcolor="#99ccff" width="240" height="240" swLiveConnect=false id="param_test" name="param_test" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>
:o
 
Last edited:
Back
Top Bottom