Skip to main content
Chilly-B_2014
Participant
May 14, 2014
Answered

Help with navigateToURL

  • May 14, 2014
  • 1 reply
  • 293 views

Here is the coding that I am told to use.  Where do I put my url?  I'm so confused by this.

// load flashVars

var flashVarParam:Object = LoaderInfo(this.root.loaderInfo).parameters;

var clickTAG:String = flashVarParam.clickTAG;

// load clickTAG

function loadURL(event:MouseEvent):void {

var request:URLRequest = new URLRequest(clickTAG);

try {

navigateToURL(request,  '_blank');

} catch (e:Error) {

trace("Error occurred!");

}

}

This topic has been closed for replies.
Correct answer Ned Murphy

The url wil go into the html embedding code, not in the Actionscript code.  There will be a parameter you define named clickTag in the embedding code that you assign the url to.  The Flash file will read that parameter in (on the line: var clickTAG:String = flashVarParam.clickTAG;) and makes use of it in the loadURL function that follows.

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
May 14, 2014

The url wil go into the html embedding code, not in the Actionscript code.  There will be a parameter you define named clickTag in the embedding code that you assign the url to.  The Flash file will read that parameter in (on the line: var clickTAG:String = flashVarParam.clickTAG;) and makes use of it in the loadURL function that follows.

Chilly-B_2014
Participant
May 14, 2014

So, I don't put the URL in this?  OK, I think I understand.  Then whoever I am sending this ad to needs to know what the URL is, correct?

Ned Murphy
Legend
May 14, 2014

If they will be doing the embedding of the swf file you send, then yes, they need to know the url so that they can plant it in the html page code.