ActionScript – Short Cuts
Coding a Button to go to Another Location Along the Timeline
buabout.addEventListener(MouseEvent.MOUSE_DOWN, toAbout);
function toAbout(pEvent:MouseEvent):void {
gotoAndStop("about");
}
Coding a Button to go to another web page.
buabout.addEventListener(MouseEvent.MOUSE_DOWN, toAbout);
function toAbout(pEvent:MouseEvent):void {
var request:URLRequest = new
URLRequest("http://www.yahoo.com");
navigateToURL(request);
}
Setting up a Loop within a frame
var counter:Number = 0;
function loopInTheFrame(pEvent:Event):void{
counter++;
trace(counter);
}
stage.addEventListener(Event.ENTER_FRAME,loopInTheFrame);