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.

Tyler

On 5/9/06, Thomas Fowler <[EMAIL PROTECTED]> wrote:

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
different
movie clips that dispatch events that trigger another clip to do something
when said events occurs.

On 5/9/06, Kevin Newman <[EMAIL PROTECTED]> wrote:
>
> 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 that is causing
> your problem though, could you give information?
>
> Also, there is an mx object that can do event
> dispatching/management/delegation:
>
> mx.events.EventDispatcher
>
>
>
http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash_MX_2004&file=00002443.html
>
>
> Kevin N.
>
>
> Tyler Wright wrote:
> > 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()
> > {
> >  this.gotoAndStop("over");
> > }
> >
> > or so, produced and endless loop (when the "listeners" object was
> > defined on
> > the movieClip using the for .. i .. in)
> >
> > Anyone have any ideas on fixes? I changed my listener to loop through
> > it as
> > an Array (which isn't as fast and doesn't allow you to remove
listening
> > objects halfway through the process). I've run into a circumstance
> > where I
> > can't use an Array.
> >
> > Tyler
>
>
> _______________________________________________
> 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

Reply via email to