I am using the event so the MXML component knows when it has been
added to the stage, and also removed so it can set up and tear down
some event listeners appropriately. Perhaps this isn't the best way to
do it. If another way is better, I'm open to hear it. :)

Yes the currentTarget is the same as the target. However, it seems
that it is because it is somehow getting added 4 times and removed 3
times. I don't konw why...my code that calls addChild is only being
called once.



--- In [email protected], "Michael Schmalle"
<[EMAIL PROTECTED]> wrote:
>
> Have you checked the event.target AND event.currentTarget?
> 
> They are all the same? Why are you using that event.
> 
> ChildExistenceChangedEvent.CHILD_ADD and
> ChildExistenceChangedEvent.CHILD_REMOVE are the best events in
containers to
> listen to child and and remove events.
> 
> You would listen to those events from the ViewStack, you will have a
> event.relatedObject property that will give you the actual child
instance
> that was added.
> 
> Mike
> 
> On Fri, Sep 19, 2008 at 2:32 PM, ozziegt <[EMAIL PROTECTED]> wrote:
> 
> >   Hi, this is my first post to this group...hopefully someone can help
> > me! :)
> >
> > I have an empty ViewStack to which I am programatically adding an MXML
> > component which contains children. When I add the component, the MXML
> > component is firing multiple onAddedToStage events. The target of the
> > event is identical every time, so I am positive it is the same
> > component firing the events. I have also verified that I am only
> > adding the component once. Does anyone have an idea of what could be
> > going on?
> >
> > Thanks
> >
> >  
> >
> 
> 
> 
> -- 
> Teoti Graphix, LLC
> http://www.teotigraphix.com
> 
> Teoti Graphix Blog
> http://www.blog.teotigraphix.com
> 
> You can find more by solving the problem then by 'asking the question'.
>


Reply via email to