Monday, March 23, 2009

ActionScript 3.0 for Buttons

Actions for Buttons:
btnInstanceName.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("http://www.pixelcola.net/"));
}

btnInstanceName.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandlerA);
function mouseDownHandlerA(event:MouseEvent):void {
gotoAndStop(1);
}

btnInstanceName.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandlerB);
function mouseDownHandlerB(event:MouseEvent):void {
gotoAndStop(10);
}

No comments:

Post a Comment