Flash ActionScript 2.0 problem with the object's _visible parameter
Posted
by GMan
on Stack Overflow
See other posts from Stack Overflow
or by GMan
Published on 2010-03-29T04:36:52Z
Indexed on
2010/03/29
7:43 UTC
Read the original article
Hit count: 499
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.
© Stack Overflow or respective owner