/ Published in: ActionScript 3
usually you made a function like "mybutonfunction" an call there e second function with parameters.. with this snippet, you can call it directly.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
my_btn.addEventListener(MouseEvent.MOUSE_DOWN, function(e:MouseEvent) { new OpenWebsite("http://www.flashjunior.ch","_blank"); } ) /* test class */ package { import flash.display.MovieClip import flash.events.MouseEvent import flash.display.SimpleButton import flash.net.navigateToURL import flash.net.URLRequest; public class OpenWebsite extends MovieClip { public function OpenWebsite(url:String,target:String):void { navigateToURL(new URLRequest(url),target); } } }