I have a clip that I want to move up and down relative to a variable, clipLocation. The clip will move down but when it is supposed to stop, it just toggles up 1 and down 1 in a loop. The solution has to be obvious but I can’t put my finger on it. Here is the code.
function resizeDefinitionField() {
_root.defs._y = _root.context_txt._height+_root.context_txt._y+10;
_root.defs.definition_txt.autoSize = true;
this.onEnterFrame = function () {
clipLocation = _root.defs._y+_root.defs._height+10;
if (this._y < clipLocation) {
this._y += 1;
} else if (this._y > clipLocation) {
this._y -= 1;
} else {
this._y = clipLocation;
}
}
}