tween problem
hi
I have created a button with the help of the pointer class, to tween a movieClip instance into different positions.
However when the moviec has been initialized onClick4 it
wont carry out the tween in onCloseClick.
Can you tell me why?
thanks very much
mt
import fl.transitions.easing.*;
import fl.transitions.*;
var myTween : Tween;
tab4_mc.buttonMode = true;
tab4_mc.close_mc.buttonMode = true;
tab4_mc.addEventListener( MouseEvent.ROLL_OVER, Roll4 );
tab4_mc.addEventListener( MouseEvent.ROLL_OUT, Out4 );
tab4_mc.addEventListener( MouseEvent.CLICK, onClick4 );
var tab4RollPoint : Point = new Point ( 372.1 , -218.6 );
var tab4OutPoint : Point = new Point ( 372.1 , -232.1 );
var tab4DownPoint : Point = new Point ( 372.1 , 222.1 );
function Roll4 ( e: MouseEvent ){
myTween = new Tween ( e.target, 'y' , Back.easeOut, e.target.y, tab4RollPoint.y, 1 , true )
}
function Out4 ( e: MouseEvent ){
myTween = new Tween ( e.target, 'y', Back.easeOut, e.target.y, tab4OutPoint.y, 1 , true );
}
function onClick4 ( e: Event ) : void {
myTween = new Tween ( e.target, 'y', Back.easeOut, e.target.y, tab4DownPoint.y, 1 , true );
tab4_mc.removeEventListener( MouseEvent.ROLL_OUT, Out4 );
tab4_mc.removeEventListener( MouseEvent.ROLL_OVER, Roll4 );
tab4_mc.close_mc.addEventListener( MouseEvent.CLICK, onCloseClick );
tab4_mc.buttonMode = false;
}
function onCloseClick ( e: Event ) : void {
myTween = new Tween ( e.target, 'y', Back.easeOut, e.target.y, tab4OutPoint.y, 1 , true ); ////////this tween does not work !!!
}