views:

248

answers:

1

Hey guys, I've been trying to build something simple in Flash 8, and I stumbled across something weird I cannot explain:

I have an object, and at some point of the program, I want it to be visible (it is invisible at first), so I write:

_root.myObj._visible = true;
_root.gameOver.swapDepths(_root.getNextHighestDepth()); //so it will be on the top

and this works fine, the object becomes visible and etc.

What I planned to happen next is that the user presses a button on that same object, and the object will go invisible:

on(release)
{
 trace(_root.myObj._visible);
 _root.myObj._visible = false;
 trace(_root.myObj._visible);
 _root.gotoAndPlay("three");
}

The trace returns at first true and later on false, so the command works, but oddly the object stays visible, that's what I don't understand.

Thanks everybody in advance.

+1  A: 

You could also put _root.myObj._visible = false; on the frame with your label of "three"

jpea