...

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



sea4me
06-14-2009, 05:24 AM
Hi!

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


testXML = new XML();
testXML.load(_global.xmlurl);

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" />
</object>

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

sea4me
06-19-2009, 06:00 PM
anyone??

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

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


testXML = new XML();
testXML.load(xmlurl);

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;

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

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum