Error 1009 after gotoAndStop - stage instance never gets added
Posted
by
ELambda
on Stack Overflow
See other posts from Stack Overflow
or by ELambda
Published on 2011-02-27T23:19:37Z
Indexed on
2011/02/27
23:24 UTC
Read the original article
Hit count: 188
flash
|actionscript
I've been through the forums for hours (days?) searching on 1009 errors, but I remain stumped on this. It seems very mysterious and I would LOVE some help if you have any ideas.
I have a single .swf that is 7 frames long - each frame represents a different "page" and you can switch pages through a menu widget in the top right corner. The menu widget calls gotoAndPlay( "frame" ).
Everything works fine except when I switch from one particular frame to another. Then, during initialization of the new frame (setting some visible properties on various items, in actionscript), I get the dreaded 1009 error on a specific stage instance, a dynamic text instance i_word.
Here's what I've tried so far:
- made sure the actionscript for the new frame starts with a stop() statement before starting initialization - no dice
- tried changing i_word into a movie_clip instead of dynamic text, made sure it was exported for actionscript - no difference. (I also have 2 other dynamic text instances on the same page that don't seem to cause a problem)
- added an ENTER_FRAME listener when the new frame is loaded, in case the problem was a timing issue. Put in a big if statement checking if i_word and other instances are not null before proceeding to initialization. It never enters the if, because i_word NEVER gets added. I added trace statements for all instances that are null, and it is the only one. If I remove all references to i_word in my actionscript, everything else is not null, and things go forward. The text for i_word even shows up on the screen in that case.
- tried renaming i_word - no dice
- tried deleting the layer i_word was on and adding a new layer - no dice
It feels like there is a serious Gremlin in my flash file somewhere. Or maybe I'm missing something obvious. Let me know if you have any ideas...I'd be so grateful.
Thank you! Elambda
© Stack Overflow or respective owner