/ Published in: ActionScript 3
Super basic, but I use this all the time to make buttons execute external links.
Expand |
Embed | Plain Text
hitBox.addEventListener (MouseEvent.MOUSE_DOWN, linkDown); hitBox.xLink = "http://www.google.com" private function linkDown (evt:MouseEvent):void { var url:String = evt.target.xLink; var req:URLRequest = new URLRequest (url); try { navigateToURL (req, "_blank"); } catch (evt:Error) { trace("Error occurred!"); } }
You need to login to post a comment.
