Done!!

Thanks Alex, I did it... but had to do it by monkey patching some
classes.. don't like to do this... but...

although I only modified the load method in the ModuleInfo class to
add the loadBytes call, had to change the FactoryInfo,
ModuleInfoProxy, ModuleLoader, ModuleManager and ModuleManagerImpl
because they either have a ModuleInfo variable or weren't visible to
my class...

I don't know if can be done better...

one little defect is that the module is not visible in the design
mode... a red X appears...

Any thought on this???

Thanks!!!


--- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> There doesn't look like there's a way to plug that into the
ModuleManager and it doesn't support loadBytes.
>  
> If you look at the FlexModuleFactory and ModuleManager code, it
appears that you can listen for the ready event and then call create()
on the factory.
> 
> ________________________________
> 
> From: [email protected] [mailto:[EMAIL PROTECTED]
On Behalf Of Gus
> Sent: Wednesday, November 28, 2007 2:27 PM
> To: [email protected]
> Subject: [flexcoders] Re: Module Loader
> 
> 
> 
> To extract the swf module from the zip I'm using the following code:
> 
> var zipFile:ZipFile = new ZipFile(loadedData);
> var data:ByteArray;
> for(var i:int = 0; i < zipFile.entries.length; i++) 
> {
>     var entry:ZipEntry = zipFile.entries[i];
>     data = zipFile.getInput(entry);
> }
>                 
> loader = new Loader( );
> loader.contentLoaderInfo.addEventListener( Event.COMPLETE,
onLoadComplete );
> var context : LoaderContext = new LoaderContext( );
> context.applicationDomain = ApplicationDomain.currentDomain;
> loader.loadBytes( data, context );
> 
> On the onLoadComplete the loader.content has:
> 
> _TestModule_mx_core_FlexModuleFactory (@17975f1)
> 
> which seems to be similar to the variable info.factory in
ModuleInfoProxy
> 
> you can see a screenshot of the debugger window in:
> 
> http://www.flickr.com/photos/[EMAIL PROTECTED]/2072440268/
> 
> Thanks for the help
> Gus...
> 
> 
> 
> 
> 
> 
> --- In [email protected], "Alex Harui" <aharui@> wrote:
> >
> > can we see how you are getting the instance of the module factory?
> > 
> > ________________________________
> > 
> > From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Gus
> > Sent: Wednesday, November 28, 2007 8:59 AM
> > To: [email protected]
> > Subject: [flexcoders] Module Loader
> > 
> > 
> > 
> > Hey all...
> > 
> > is there a way to load a module not from an url but an object
instance?
> > 
> > I have a zip file with a module, I unzipped it with the nochump zip
> > libraries and obtain the instance of the factory for the module ( or
> > at least is what it seems )... but then I can“t find a way to pass it
> > to the ModuleLoader... so, I'm stuck... don't know where to look... 
> > 
> > Any Ideas???
> > Thanks in advance
> >
>


Reply via email to