>>> In order to get the initialization code, you need to build using 
mxmlc. <<<

Does it mean that if I create project with complex UI components, 
compile it as Flex Project with mxmlc, then load this module SWF as 
RSL library loaded - to the same ApplicationDomain, then create it 
dynamically and put to some application window and as result all my 
UI components/remoting/effects will work correctly?

>>> The player doesn't know SWCs, but you're welcome to write an AS3 
SWC parser. <<<

OK, under SWC I mean dynamic library compiled as SWF, there is no 
AS3 parser or player stuff at all. It's all around "compc" generated 
code. I think current AS3 functionality is enough to implement all 
these task, it's all about generated AS3 code. Probably no player 
code changes are required.

Flex modules architecture is somehow similar to C++ DLLs in Win32. 
Where modules are loaded/unloaded automatically, just 
plain ::LoadLibrary Win32 API call, and PE module loaded and 
initialized correctly. Each PE module has own entry point, by 
default it's DllMain. When module loaded DLL_PROCESS_ATACH event 
send to this callback by system. C++ compiler also provides ability 
to override entry point and provide own implementation.

If C++ DLLs uses C++ Runtime, it provides runtime DllMain 
implementation, and this implementation knows how initialize module, 
because C++ compiler also knows  stuff to initialize at compile 
time, it stores this information somewhere inside as special 
variables, function classes. And latter C++ Runtime initialize this 
DLL in runtime.

The same situtation is with C++ MFC DLLs, they provide custom 
DllMain implementation which in response to DLL_PROCESS_ATACH event 
initialize library using AfxInitExtensionModule call. This function 
uses internal module AFX_EXTENSION_MODULE structure to regsiter 
dynamic classes an other things. 


In my understanding something similar should exist in Flex - I 
create library project, and compile SWF file. Library compiler 
stores all init iformation in library ABC code (as classes, 
function, variables etc) and generates initialization callback 
function. 

Then user call Loader.load method, and after module loaded, 
initialization callback is executed, and library loaded 
automatically.

Sorry for boring with C++ analogy, but it's very similar to Flex one 
as for me. 
 SWF == PE (Portable Executable module EXE, DLL), 
 mxmlc/compc == C++ compiler+linker,
 Flash player runtime ==  Win32 API, 
 etc 

--
Thanks,
Vadim Melnik.

--- In [email protected], "Roger Gonzalez" <[EMAIL PROTECTED]> 
wrote:
>
> 
> > It's interesting idea. But current Flex release doesn't provide 
good 
> > external libraries support as for me. Some RSL initialization 
code 
> > is statically injected by mxlmlc to the application SWF file 
during 
> > compilation process ( binding initialization, remote class 
> > registration etc). It makes impossible to update library 
binaries 
> > without recompilation of application SWF. Each time shared 
library 
> > is updated, we need to recompile all applications as well. Also 
all 
> > dynamic classes declared in RSL must be explicitly referenced by 
> > main application,(as otherwise these classes will be loaded 
without 
> > initialization). 
> 
> If you're finding this to be the case, I suggest refactoring to 
use more
> interfaces.  If you set things up correctly, you should only need 
to
> rebuild the other piece if the interface changes.  This helps 
decouple
> the dependencies, and makes for faster recompiles.
> 
> > For the same reason we are unable to load "unknown" library at 
> > runtime and dynamically create class without problem (I mean 
classes 
> > with complex UI, remoting code etc). 
> 
> In order to get the initialization code, you need to build using 
mxmlc.
> I'm working on some skunkworks code to make building these sorts of
> loadable modules easier.
> 
> > Ideally it would be better if "compc" stored all initialization 
> > information in SWC binaries. So loader could access it at 
runtime 
> > and automatically initialize external library on demand. Just my 
> > 2c...
> 
> The player doesn't know SWCs, but you're welcome to write an AS3 
SWC
> parser.  :-)
> 
> -rg
>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to