It wasn't a targeting issue. Even though the for..i..in loops were being stopped the frames still changed appropriately. Don't try and make excuses, it's just a mean thing for Flash to do. ;)
I'm just happy to know the fix. Tyler On 5/9/06, Michael Bedar <[EMAIL PROTECTED]> wrote:
If I remeber correctly, goToAndStop() and MoviClip.gotoAndStop() are completely separate functions, and even have different behavior on the root timeline. On May 9, 2006, at 5:47 PM, Tyler Wright wrote: > This is Great! What a horrible thing to have to know, it just > doesn't make > sense that the keyword this would fix it. I can't imagine what > other scope > gotoAndStop would effect in this way. > > Thanks Elibol. It fixes the problem for both situations, endless > looping > for..i..in and the for..i..in's that end prematurely. > > "Browser Power for Flash" > http://www.flashforwardconference.com/sessions?sid=158 > > Tyler > > On 5/9/06, elibol <[EMAIL PROTECTED]> wrote: >> >> Hey that's great man! Congratulations, I'm very happy for you =] >> So what >> is it you're going to speak about? >> >> Weird... Try this: >> >> >> for (var i in list){ >> trace(i); >> this.gotoAndStop (i); >> } >> } >> >> Seems that you need to explicity refer to this. I remember there >> being >> problems with certain MovieClip functions when they weren't >> refered to with >> the this object. I think that in the object stack there might be two >> definitions of the function and 'this' makes sure that the actual >> movieclip >> is the first one that is examined... >> >> Extending MovieClips is always full of suprises man... >> >> This is interesting, I'm wondering if it's gonna fix your problem >> though? >> >> M >> >> On 5/9/06, Tyler Wright <[EMAIL PROTECTED]> wrote: >> >> > Hello Elibol! >> > >> > I apologize, I mislead you. My EventDispatcher is no longer a >> problem >> > and the issue I face now seems to be different. I can only >> duplicate it >> > making a component class that extends MovieClip. The issue is >> that the >> > for..i..in loop stops after a gotoAndStop. >> > >> > class Test extends MovieClip >> > { >> > var list:Object; >> > >> > function Test() >> > { >> > list = >> > { >> > one:"one", >> > two:"two", >> > three:"three", >> > four:"four", >> > five:"five" >> > }; >> > >> > for (var i in list) >> > { >> > trace(i); >> > gotoAndStop(list[i]); >> > } >> > } >> > >> > } >> > >> > If you define this class and set it up as a component in the >> Library you >> > will see that only "one" is traced out. Then you can comment out >> the >> > gotoAndStop(); and it loops through all 5. It behaves the same >> whether or >> > not these frames actually exist. I think I'll post this to the >> list as well, >> > but thanks for responding so quickly. Did I tell you I got >> accepted to speak >> > at FlashForward in September? On Flash and JavaScript. >> > >> > Tyler >> > >> > >> > On 5/9/06, elibol <[EMAIL PROTECTED]> wrote: >> > > >> > > Nevermind my former message. You can also use the >> AsBroadcaster class. >> > > I find it's very solid, however, it doesn't seem to be your >> problem at all. >> > > >> > > If you are coding in frames, and frames with function calls and >> > > variable definitions are called more than once, then this can >> mislead your >> > > assumptions about how many times a piece of code is executed. >> It might just >> > > be that you are adding the same object to a broadcaster more >> than once. >> > > >> > > I'm not sure but it seems like this is a possibility. Again >> though, an >> > > ends to what you've mentioned on object enumeration, the for >> in should never >> > > go into an infinite loop. >> > > >> > > M >> > > >> > >> > >> > _______________________________________________ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
_______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com