I am successfully able to load an external text file into my Flash movie using AS3. The loaded text file has links which are going to external pdfs. This is working fine, too. Problem is, now I need to call a function inside the Flash file from the links instead of opening the external pdfs. These are DoubleClick ads, in case anyone is familiar.
Here is the AS around a button in the current Flash movie. I have to somehow call a similar function from the text file.
theBut.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage_2);
function fl_ClickToGoToWebPage_2(event:MouseEvent):void
{
var click_url:String = root.loaderInfo.parameters.clickTag;
if(click_url) {
navigateToURL(new URLRequest(click_url), '_blank');
}
}
In this case, you can use the
this[string]
syntax againstroot.loaderInfo.parameters
. Then, if your loaded text file says there should be aclickTag2
variable, available via stringvariableName
, you use that in your function like this: