query string variable from "loaderInfo.parameters" always "undefined"
I've searched the internet and these forums and found plenty of information on accessing query strings using loaderInfo.parameters but they're all written for ActionScript in the Timeline and none of them work for me.
This is my HTML:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="800" height="500" id="eamchartmaster04" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="eamchartmaster04.swf?swfid=3" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="eamchartmaster04.swf?swfid=3" quality="high" bgcolor="#ffffff" width="800" height="500" name="eamchartmaster04" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
...which is a modification of the HTML that Flash generates, which I'm eventually not going to be using but this is for quick testing purposes. I have read that Flash's "AC_RunActiveContent.js" has to be modified to use the flashVars parameter, but does it have any affect on query strings appended to a URL?
The variable I want is swfid (=3).
eamchartmaster04.fla has a Document class, EAMChartMaster.as. Within that I have the following ActionScript:
// class constructor
public function EAMChartMaster() {
// set this as the parent object
myParent = this;
myParent.loaderInfo.addEventListener(Event.COMPLETE, loaderComplete);
}private function loaderComplete(myEvent:Event):void {
myLoaderInfo=myParent.loaderInfo.parameters;
testTxt.text = String(myParent.loaderInfo.parameters.swfid);
}
testTxt is ALWAYS "undefined".
I've also tried creating an Object (eg. myQueryStrings), loading loaderInfo.parameters into that object and then accessing it as a property of the object (eg. myQueryStrings.swfid) to no avail.
Note the "myParent" object is created for scoping to other classes, but I used it here in desperation because "this" and "this.root" did nothing, but they should all be the same thing.
Thanks for any help!