The title may be inaccurate, but I think timing of instantiation is
what's causing my problem. If anyone can point me to a solution, I'd
be most appreciative. Here's the scenario:
1) On main stage, there is a moviclip representing the main
application UI called "main_mc"
2) "main_mc" is bound in the library to a class "FileUploader"
3) Contained within the "main_mc" are some movieclips which are
instances via linkage in the library of another class, "BaseButton".
4) "BaseButton" contains all the code required for EventDispatcher
5) When tested in a test FLA, with the "BaseButton" instance mc's
directly on the stage, and addEventListener code written on _root to
catch the dispatched events from the "BaseButton" mc's, all works
great. Events broadcast by the buttons are "listened for" as expected
and all is good.
My issue arises when the "BaseButton" clips are nested INSIDE the
"main_mc" clip and addEventListeners on the "base_mc"'s
"FileUploader" class are not catching the dispatched events.
NOTE: If I put the BaseButton clips into the "main_mc" clip via
attachMovie vs having them manually placed there at compile-time, the
dispatched events are caught effectively.
What I need to know is... why? I would assume that it's a situation
where the main class' addEventListeners are being registered before
the button mc's that they are listening for event from are
instantiated, but not sure.
And then the big question... if that is in fact what is happening,
what's the workaround/solution? I really don't want to have to attach
everything from the library for the entire UI, as it makes for
difficult layout of the application in the IDE for the designers who
are creating the UI elements down the road.
Any help anyone can provide would be awesome!
Thanks,
Josh
--------------------------------------------------------------
Josh Ettwein | Sr. Software Engineer | Eyespot.com | www.eyespot.com
_______________________________________________
[email protected]
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