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:[EMAIL PROTECTED] On
Behalf Of Michael Ritchie
Sent: den 3 april 2007 11:24
To: flexcoders@yahoogroups.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"
<[EMAIL PROTECTED]> wrote:
>
> *BUMP*
> 
> Anyone have any ideas? I still haven't found a solution...
> 
> K.
>

 

Reply via email to