ACTIONSCRIPT 3 TUTORIALS

Event Listeners and Handlers

//Event Listeners and Handlers

rec_btn.addEventListener(MouseEvent.CLICK, onClick);

function onClick(e:MouseEvent) {
trace ("Hey, someone clicked on that button");
}

rec_btn.addEventListener(MouseEvent.ROLL_OVER, onRoll);

function onRoll(e:MouseEvent) {
trace ("Hey, someone rolled over over that button");
}