ModuleLoader is a convenience container.  It loads in the module via
ModuleManager and when READY, it starts to create the children.  If you
listen to READY you may see it before moduleloader had a chance to see
it and create the child.
 
-Alex

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Michael Ritchie
Sent: Tuesday, April 03, 2007 1:04 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Module Interface Problems



I ruled out the timing issue, but your post has some great information
how to handle this. I think I have isolated the specific module
loading issue to one factor. I have a module that loads another
module using a <mx:ModuleLoader> and I am trying to access the second
ModuleLoader child through the interface. I can't seem get a
reference to the child of the second ModuleLoader, it always reports
null. I have a successfully loaded a module and talked using the
interface, but if move this within the context of another module, I
get the null reference. 

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "- FI / Jonas Eliasson +"
<[EMAIL PROTECTED]> wrote:
>
> That sounds like a still existing Flash issue if you try to load a
swf that
> has a shared library attached to it. Then you will get a loaded
callback
> before it's actually loaded. So in Flash you can check on the loaded
event
> if current frame == 0. In that case you can't access any properties
and no
> code will be executed yet. But you can still write to the object. In
our
> scenario we have attached a callback event method. So when the swf
is really
> loaded it will check if the callback exist and then execute it.
Which will
> tell the loader that it's ready to be initiated. Something similar
should be
> easy to implement on the module but not with a check for a frame
number :-)
> . Should be a better solution for this. I don't want to go back to
old Flash
> hacks hehe. 
> 
> 
> 
> //as2 example 
> 
> private function onLibraryLoaded(libraryClip:MovieClip,
cb:CallBack):Void {
> 
> var me:SharedLibraryLoader = getInstance(); 
> 
> if(libraryClip._currentframe == 0){
> 
> libraryClip.onComplete = new CallBack(me,
me.onLibraryInitiated,
> null, cb);
> 
> }else
> 
> onLibraryInitiated(libraryClip, cb);
> 
> }
> 
> _____ 
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of Michael Ritchie
> Sent: den 3 april 2007 11:24
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Re: Module Interface Problems
> 
> 
> 
> From my experience there is a definite timing issue when loading
> modules. The ModuleLoader ready event is fired before the Module is
> fully loaded and you have the ability to talk to it through a common
> interface (hence the error reporting access to a null value). 
> 
> I would term this one as a "bug" that is not yet documented by Adobe.
> This could be because some modules take longer than expected to load,
> I have no idea, just the observed problem with talking with modules
> within the "ready". I also attempted to use an interface to talk with
> a module when the the progress event had reached 100%, but still no
> luck. 
> 
> A possible workaround would be to fire some event from inside the
> loaded module that tells the outside world that it is indeed loaded. 
> The other option is to set a timer interval and keep checking if the
> module is loaded (meaning not reporting NULL in the ready event
> handler). Unless someone else as a viable solution? Adobe? Anyone?
> 
> - mr
> 
> --- In [EMAIL PROTECTED] <mailto:flexcoders%40yahoogroups.com>
ups.com,
> "kristian_wright2002"
> <karnal69@> wrote:
> >
> > *BUMP*
> > 
> > Anyone have any ideas? I still haven't found a solution...
> > 
> > K.
> >
>



 

Reply via email to