If you have 2 keyframes with a "thing" on each keyframe then as soon as you move the playhead to "another keyframe" the "thing" will be recreated. Therefore your event listener is no longer applied to it.
Either let the "thing" span across 2 frames, or in each frame re-add the same script at the top to re-assign the event listener.
I kind of understand the recreated thing. But I don't need an event listener on the second frame to illustrate my confusion.
The "thing" on frame one changes alpha but then remains on the scene in frame 2, unchanged in its position. Why wouldn't the "thing" on frame 2 (which I think of as being the same thing) appear in its new position? And wouldn't it be faded out?
Having no info or screenshots to go on, I presume you have 2 keyframes to take care of changing the alpha and/or position of your "thing".
What I mentioned was if you make 2 keyframes, any code applied to the "thing" (even if the instance name is the same) is removed. Therefore when you go to frame 2, if you expected the code from frame1 to still exist on your "thing", that's why it does not.
I really appreciate you considering this, and I'm starting to see where you're coming from.
I'm still confused, though. Below are two screenshots of the swf on Frame 2, the only difference is whether the line of code about the alpha value is commented out or not.
Being on the 2nd frame (and thus the 2nd copy of the thing) I could understand if the alpha value is ignored. Instead it looks like the alpha value is kept and the 2nd copy of the thing is ignored! (The position of the thing on frame 1 is in the upper left, and the position on frame 2 is in the lower right).
Without changing the alpha value, the thing "moves" to the lower right (as expected):
1 person found this helpful
Using timeline keyframes (like non-classic)?
Change your order. Make your script this and change your frame before your alpha:
thing.alpha = 0.5;
You may have the objects alpha stuck in your frame#2 so after it changes frame the alpha returns anyhow.
Thank you! It never occurred to me that you could change the properties of an object on another frame, especially after you goto it. I was thinking at "gotoAndStop", control was passed to that other frame. But of course code would continue executing!
Many thanks to you, sinious, for sticking with me to explain this.