Whenever I play the swf, the movie clip’s “x” position is set to zero for like 1 second then it goes to the right place…when I set it to be centered to the stage width and height on entering frame…Why is this?
var newNumber:Timer = new Timer(1500);
newNumber.start();
newNumber.addEventListener(TimerEvent.TIMER, nextNumber);
function nextNumber(e:TimerEvent):void{
var newNum:Number = Math.random()*4 - 2;
k = newNum;
}
stage.addEventListener(Event.RESIZE && Event.ENTER_FRAME, position)
function position(e:Event):void{
TweenMax.to(welcomeBtn, 1.5, {x:stage.stageWidth/2 + (k+.1), ease: Elastic.easeOut})
trace(welcomeBtn.x, k);
}