Re: [Flashcoders] for (var i in ..) loop interupted by frame change

2006-05-09 Thread elibol
=] On 5/9/06, Tyler Wright <[EMAIL PROTECTED]> wrote: 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

Re: [Flashcoders] for (var i in ..) loop interupted by frame change

2006-05-09 Thread Thomas Fowler
This is probably not it, but when you instantiate an instance of your Test class, does the instance persist throughout the entire timeline? On 5/9/06, Tyler Wright <[EMAIL PROTECTED]> wrote: I apologize, I mislead you. My EventDispatcher is no longer a problem and the issue I face now seems to

Re: [Flashcoders] for (var i in ..) loop interupted by frame change

2006-05-09 Thread Tyler Wright
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 lis

Re: [Flashcoders] for (var i in ..) loop interupted by frame change

2006-05-09 Thread Thomas Fowler
I would love to help on this but I need a little more context. From what I can gather it looks as if you're trying to dispatch an event a series of events and have the corresponding listener/handler do something? Is that correct? As Kevin stated, it would be better to have a class backing these d

Re: [Flashcoders] for (var i in ..) loop interupted by frame change

2006-05-09 Thread Tyler Wright
thanks for the quick response. If you view the source for MM's EventDispatcher you'll see that it traverses the event listeners array with a for..i..in. This is so that one of the listening methods can "removeEventListener" and not screw up the array mid-process. A for..i..in simply hits every u

Re: [Flashcoders] for (var i in ..) loop interupted by frame change

2006-05-09 Thread Kevin Newman
Logically it seems as though a list of listeners should be in an array, instead of a collection of object properties, but to each his own :-) You seem to have a small typo in here: for (var i in listeners) { dispatch(listeners[i].event); { The second curly bracket is backwards. I don't know if

[Flashcoders] for (var i in ..) loop interupted by frame change

2006-05-09 Thread Tyler Wright
I have sevaral for (var i in .. ) loops running looping through objects that get thrown (interupted OR actually go forever) when I change the frame of a movieClip where one exists. Just as an example: for (var i in listeners) { dispatch(listeners[i].event); { // the listener function setState(