I am working with Flash CS6 / AS3 exported with Swiffy for HTML 5. I would like to include a clickTag on a simple button but cannot find the proper syntax.
The basic code below, generated by Flash works fine:
this.myButton.addEventListener("click", fl_ClickToGoToWebPage_2);
function fl_ClickToGoToWebPage_2() {
window.open("http://www.mysite.com", "_blank");
}
Then I added the javascript code given by Google Swiffy to set the variable in the webpage (no bug so far):
stage.setFlashVars("clickTAG=http://www.mysite.com");
stage.start();
In Flash (AS3), I tried the usual code:
var paramList:Object = loaderInfo.parameters;
var urlRequest:URLRequest = new URLRequest(paramList["clickTAG"]);
function fl_ClickToGoToWebPage_2() {
window.open(clickTAG, "_blank");
}
But that does not work :( and the variable does not come through. This even bugs the animation.
Question is, how should I write the Flash code lines to get the variable passed to my window.open function? What I am missing?
Thanks a lot for you help
If you are sure that clickTAG is correctly set, try the method at this link using navigateToURL:
Is there a way to get values form a swiffy animation
Send your link string from the swiffy to a javascript function & do your window.open stuff there.