nested function
(1)
i want to add a listener that it will direct to a nested function if it triggered,
but later i found that i cant name the target event directly as "dragStart", so what should i type?
(2)
also, are there some ways that able to do the same tweening effect as the code below but without nesting them?
i made the tweenings play as one by one.
thz for any help ![]()
function changeImg() {
mask1.removeEventListener(Event.ENTER_FRAME, mask1Drag);
stage.addEventListener(MouseEvent.CLICK, dragStart);
var maskTween1:Tween = new Tween(mask1,"width",Strong.easeInOut,1,750,1,true); maskTween1.addEventListener(TweenEvent.MOTION_FINISH, playMaskTween2);
function playMaskTween2(e) { var maskTween2:Tween = new Tween(mask1,"width",Strong.easeInOut,750,1,1,true); maskTween2.addEventListener(TweenEvent.MOTION_FINISH, playMaskTween3);
function playMaskTween3(e) { var maskTween3:Tween = new Tween(mask1,"width",Strong.easeInOut,1,750 - mouseX,1,true); maskTween3.addEventListener(TweenEvent.MOTION_FINISH, dragStart);
function dragStart(e) { maskTween1.stop();
maskTween2.stop();
maskTween3.stop();
mask1.addEventListener(Event.ENTER_FRAME, mask1Drag);
}
}
}
}