glospinner
04-09-2002, 02:48 PM
Alright, i'm a little embarrassed to be asking this one, since I'm pretty familiar with Flash, but i've never fully understood the usage of the 'this' statement. (I'm gonna have to keep using quotes around 'this' so that you know when I'm talking about the code, and not some scenario or something) =)
I realize that 'this' is a reference to the current timeline, for instance, to hide a movieClip from within the movie clip, you could just do this._visibility = false; or whatever. The part that I'm unsure about is if, say, you want to hide that movie clip when you click on a button in the movie clip. Would this._visibility = false in an on(press) event hide the movie clip or the button? Cuz it seems to me that the current timeline is the buttons timeline. But on the otherhand, the actionscript resides actually on the object and not in it's timeline.... sooo you can understand my confusion. Which timeline would 'this' refer to?
Thanks
I realize that 'this' is a reference to the current timeline, for instance, to hide a movieClip from within the movie clip, you could just do this._visibility = false; or whatever. The part that I'm unsure about is if, say, you want to hide that movie clip when you click on a button in the movie clip. Would this._visibility = false in an on(press) event hide the movie clip or the button? Cuz it seems to me that the current timeline is the buttons timeline. But on the otherhand, the actionscript resides actually on the object and not in it's timeline.... sooo you can understand my confusion. Which timeline would 'this' refer to?
Thanks