I am working with a movie clipt hat I want to disable some buttons once it moves to a certain position, that position created by some variables.
I placed the below code into a controller moving clip with the code on frame one, and then on frame 2 is gotoAndPlay(1);
onEnterFrame = function() {
if(textMCBottomPos <= maskMCBottomPos){
this._parent.upbutton.enabled = false;
this._parent.upbutton.alphaTo(50, 1);
}
else{
this._parent.upbutton.enabled = true;
this._parent.upbutton.alphaTo(100, 1);
}
if(textMCTopPos <= maskMCTopPos){
this._parent.downbutton.enabled = true;
this._parent.downbutton.alphaTo(100, 1);
}
else{
this._parent.downbutton.enabled = false;
this._parent.downbutton.alphaTo(50, 1);
}
}
Here are the variables its pulling from, which are on the first frame of the root movie.
The problem is the if statement only runs once, and does not update… I thought since I have it in a controller movie clip that keeps running the it would update… but it does not.
any help would be greatly appreciated.
var textMCBottomPos:Number = mover._y + mover._height;
var maskMCBottomPos:Number = stopper._y + stopper._height;
var maskMCTopPos:Number = stopper._y;
var textMCTopPos:Number = mover._y;
Thank you,
Dale