Im stuck
I got this flash that need’s to be configured in a certain way
My code looks like this
HTML
<object type="application/x-shockwave-flash" data="banner.swf" width="896" height="240">
<param name="movie" value="banner.swf" />
<param name="flashvars" value="hrefUrl=http://stackoverflow.com&popup=true" />
</object>
Actionscript
import flash.display.Sprite;
import flash.net.navigateToURL;
import flash.net.URLRequest;
import flash.net.URLVariables;
import flash.display.LoaderInfo;
//var paramList:Object = root.loaderInfo.parameters;
//var flashVars:Object = LoaderInfo(this.root.loaderInfo).parameters;
// Url to page, default to google
var hrefUrl:String = (root.loaderInfo.parameters.hrefUrl) ? root.loaderInfo.parameters.hrefUrl : "http://www.google.com";
// Popup or not, default to _self
var popup:String = (root.loaderInfo.parameters.popup == "true") ? "_blank" : "_self";
// Fire the event
btn.addEventListener(MouseEvent.CLICK, onClick);
function onClick(evt:MouseEvent):void {
var req:URLRequest = new URLRequest();
navigateToURL(new URLRequest(hrefUrl), popup);
}
For some reason this doesn’t work but if I for some reason put the flashvars in the data parameter it works
Example
<object type="application/x-shockwave-flash" data="banner.swf?hrefUrl=http://stackoverflow.com&popup=true" width="896" height="240">
What could be wrong here? I’ve starred myself blind on this one
Thanks
May be
rootis not targeting[object MainTimeline]. So go withstage.