View Full Version : Actionscript 2.0 get URL parameter...

06-14-2009, 06:24 AM

I'm trying to get a URL parameter in my flash...
The parameter is a xml url...

testXML = new XML();

I tried every code I can find on the web and couldn't find a solution so I turned to CF...

I also tried var _theParameterFromURL:String = String(_root.loaderInfo.parameters.xmlurl); but it didn't work...

Here is my HTML:

<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="590" height="300" id="test" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="test.swf?xmlurl=data.xml" />
<param name="menu" value="false" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="Flashvars" value="&xmlurl=data.xml">
<embed src="test.swf?xmlurl=data.xml" menu="false" quality="high" bgcolor="#000000" width="590" height="300" name="test" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

Any help would be greatly appreciated!! :thumbsup: :D

06-19-2009, 07:00 PM

06-22-2009, 08:05 AM
Too noob of a question?? lol Guaranteed thanks for anyone that solves the problem :P

06-22-2009, 09:59 AM
The variables are made available in the main timeline without the _global prefix.

testXML = new XML();

This should work, another option is if you want to grab the data and then pass it to a function, just declare another variable to get the value of xmlurl and run with it.

var datasource = xmlurl;

06-28-2009, 06:28 AM
Thank you!!

I did that and then I removed <param name="Flashvars" value="&xmlurl=data.xml"> and it worked :)