Created
May 10, 2011 16:41
-
-
Save SeanJA/964852 to your computer and use it in GitHub Desktop.
oas clicktag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //-- Action Script 2 version: | |
| //this is the click tag action | |
| //that should be attached to your button | |
| on (release){ | |
| getURL (_root.clickTAG, "_blank"); | |
| } | |
| //-- Action Script 3 version: | |
| /* Requires | |
| * - Button symbol on Stage with instance name "myButton" | |
| */ | |
| myButton.addEventListener (MouseEvent.CLICK, buttonSymbol_click); | |
| function buttonSymbol_click (evt:MouseEvent):void { | |
| var clickTAG:String = loaderInfo.parameters.clickTAG; | |
| // Check for malicious code injections, only use URLs if they begin with http: or https: | |
| if ((clickTAG.substr(0, 5) == "http:") || (clickTAG.substr(0, 6) == "https:")){ | |
| var req:URLRequest = new URLRequest(clickTAG); | |
| navigateToURL(req, "_blank"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment