steverguy
asked on
Actionscript 2.0 animating with onEnterFrame
The following function is called when a button is released:
function upThumbs(){
dx = 0
lowerLeft = thumbnail_mc._y + thumbnail_mc._height
trace("Lower Left " + lowerLeft);
if (lowerLeft > 480){
this.onEnterFrame = function(){
dx += 10;
if (dx < 480){
thumbnail_mc._y -= 10;
};
}
};
}
i wanted to make sure that the movieClip would animate and move up until the lower left corner reached above the 480. If lowerLeft is less than 480, i don't want the "this.onEnterFrame" code to work.
But it still does! After clicking the button once, the lowerLeft corner is 320. The code should not run again. I'm stumped by this. I'm not sure why it's not working.
Any help would be appreciated!!!
function upThumbs(){
dx = 0
lowerLeft = thumbnail_mc._y + thumbnail_mc._height
trace("Lower Left " + lowerLeft);
if (lowerLeft > 480){
this.onEnterFrame = function(){
dx += 10;
if (dx < 480){
thumbnail_mc._y -= 10;
};
}
};
}
i wanted to make sure that the movieClip would animate and move up until the lower left corner reached above the 480. If lowerLeft is less than 480, i don't want the "this.onEnterFrame" code to work.
But it still does! After clicking the button once, the lowerLeft corner is 320. The code should not run again. I'm stumped by this. I'm not sure why it's not working.
Any help would be appreciated!!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I appreciate your help!