Question
tween and getting instance names problems
Hi, iv got these buttons animated using the inbuilt tween
function and am coding them like this:
function navOver(e:MouseEvent):void {
var page = MovieClip(e.currentTarget).buttonThumb;
var myTween16:Tween = new Tween(page, "y", Regular.easeOut, 0, -25, 0.35, true);
}
function navOut(e:MouseEvent):void {
var page = MovieClip(e.currentTarget).buttonThumb;
var myTween17:Tween = new Tween(page, "y", Regular.easeOut, -25, 0, 0.35, true);
}
function navClick(e:MouseEvent):void {
var page = MovieClip(e.currentTarget).buttonThumb;
page.y = 0;
}
button.addEventListener(MouseEvent.ROLL_OVER, navOver);
button.addEventListener(MouseEvent.ROLL_OUT, navOut);
button.addEventListener(MouseEvent.MOUSE_DOWN, navClick);
but if i click on the button before the animation has finished it ignores the page.y = 0; code and does nothing. how can i fix this?
also im trying to get the instance name of a mc called "home" using this code:
MovieClip(e.currentTarget) wich gives me the result [object button_1]
and
MovieClip(e.currentTarget).instanceName returns undefined
neather of which are the instance name.
i cant hardcode the function because its used on lots of different mcs throughtout the flash file
thanks
function navOver(e:MouseEvent):void {
var page = MovieClip(e.currentTarget).buttonThumb;
var myTween16:Tween = new Tween(page, "y", Regular.easeOut, 0, -25, 0.35, true);
}
function navOut(e:MouseEvent):void {
var page = MovieClip(e.currentTarget).buttonThumb;
var myTween17:Tween = new Tween(page, "y", Regular.easeOut, -25, 0, 0.35, true);
}
function navClick(e:MouseEvent):void {
var page = MovieClip(e.currentTarget).buttonThumb;
page.y = 0;
}
button.addEventListener(MouseEvent.ROLL_OVER, navOver);
button.addEventListener(MouseEvent.ROLL_OUT, navOut);
button.addEventListener(MouseEvent.MOUSE_DOWN, navClick);
but if i click on the button before the animation has finished it ignores the page.y = 0; code and does nothing. how can i fix this?
also im trying to get the instance name of a mc called "home" using this code:
MovieClip(e.currentTarget) wich gives me the result [object button_1]
and
MovieClip(e.currentTarget).instanceName returns undefined
neather of which are the instance name.
i cant hardcode the function because its used on lots of different mcs throughtout the flash file
thanks