1. Place a TextField on frame 1 and set the instance name to textbox 2. Enter the following code into frame 1
Daily Archives: May 28, 2010
Load External Sound AS3
var audio:Sound = new Sound(); var req:URLRequest = new URLRequest(“Buzz.mp3”); audio.load(req); audio.play(); var channel:SoundChannel= new SoundChannel(); var audio:Sound = new Sound();var req:URLRequest = new URLRequest(“sound.mp3”); audio.load(req);audio.play(); var channel:SoundChannel= new SoundChannel();
AS3 getURL();
rootlink.addEventListener(MouseEvent.MOUSE_DOWN, rootLinkFun); function rootLinkFun(evt:MouseEvent):void{ var targetURL:URLRequest = new URLRequest(“http://www.prosoxi.gr”); navigateToURL(targetURL,”_blank”); }
Actionscript 3 parent reference.
This is a very short line of Actionscript 3, but its one that I’ve had copied to Stickie on my Desktop forever, so in the interest of cleaning up some, I’ll post it here on the blog in the Code Tips category. I think I’ve memorized at least this much AS3 now too =)