PDA

View Full Version : Variable not updating


Adrenaline
07-31-2003, 11:19 PM
I havn't trouble with this code, i know sure its a simple script but i can't get it right.
onEnterFrame = function () {
if (button5._y<151) {
Move = ready;
}
if (button5._y>349) {
Move = not ready;
}
};
button5._y is set to 150. however 'move' will not update itself after the button moves.

Thanks,
Adrenaline

Warrior
08-01-2003, 12:01 AM
Try this
onEnterFrame = function ()
{ if (button5._y<151)
{Move += ready;
updateAfterEvent();
}if (button5._y>349)
{Move = not ready;}};

black
08-01-2003, 12:07 AM
1. locate your mc with something like _root.button5 etc~

2. fix your variables like _root.Move or this.Move~

3. seems that "ready" should be of boolean type so you should build it that type before you handling with it.

Adrenaline
08-01-2003, 12:34 AM
well i want to use 'move' later like:
if (move=ready) {
// do this
}

how do i go about doing that?

Adrenaline
08-01-2003, 01:43 AM
see http://www.actionscript.org/forums/showthread.php3?s=&threadid=32089