Hi all,
in actionscript 2.0, one could call a mouseEvent function without actually having that event. For instance:
btn1.onRollOut = function(){
this. gotoAndPlay(“out”);
}
btn2.onRelease = function(){
[FONT=Arial Black] btn1.onRollOut();[/FONT]
}
However, I can’t seem to do the same in AS 3.0.
btn1.addEventListener(MouseEvent.ROLL_OUT, rollOutHandler);
btn2.addEventListener(MouseEvent.CLICK, clickHandler);
function rollOutHandler(Event:MouseEvent):void{
Event.currentTarget.gotoAndPlay(“out”);
}
function clickHandler(Event:MouseEvent):void{
// [FONT=Arial Black] btn1.rollOutHandler???[/FONT]
}
In this example, of course, rollOutHandler only does one thing,
but this function could contain lots and lots of code, and I would not want to repeat all of it again inside the clickHandler function.
Any ideas???