Animating a Movie clip with code
Dear All thank you for your time and patience.
I am trying to animate a sky moving up as it playing fwd, I am using a simple time line tween to animate the Mc of the sky but have tried various ways to move the clip up or down, to simulate an aircraft climbing or descending.
I tried using the set interval to call the the function and a for loop
both say in console "y is not defined "when I run the animation.
The only way can get it to work is a tick function but when i try to clear the event lisetner with "clear interval(interval name)"for the Ticker nothing happens.
this.mystop_btn.addEventListener("click", fl_ClickToGoToAndPlayFromFrame.bind(this));
function fl_ClickToGoToAndPlayFromFrame(){
this.mysky_mc.gotoAndPlay(1)
skyup()
}
function skyup(){
for(var i= 0; i< 100; i ++){
this.mysky_mc.y-=1
console.log(y)
}
}
this.addEventListener("tick", fl_AnimateHorizontally.bind(this));
function fl_AnimateHorizontally()
{
this.mysky_mc.y-=1
console.log(this.mysky_mc.x)
console.log("test3")
}I am doing something wrong, but not sure what it is looked at many articles but cant seem to find the info anywhere.
Best Regards
Peter
