Hi FlashCoders!,
Ive been trying to evangelize my solution to the flash community but I dont
think it came through, really... I hope someone on this list will pick it up!
I was looking for a solution to get Flex RPC support within Flash CS3 (and NOT
the other way around). What I found out was that by putting a flex compiled swc
in your local path or your classes path Flash will actually compile against
that swc!! Yes, compiling, which means NO linking! And NO linking means Flash
CS3 compiles Intrinsic against the swc's! Thats two solutions in one! The only
thing that has to be done is the linking part, which has to be done manually
and is as easy as 123!
There are two solutions I use for the linking part the first thing you would
think of yourself is the following piece of code (the only thing special here
is the LoaderContext):
var libloader = new Loader();
var context:LoaderContext = new LoaderContext();
context.applicationDomain = ApplicationDomain.currentDomain;
libloader.contentLoaderInfo.addEventListener(Event.INIT, initLibrary);
libloader.load(new URLRequest("library.swf"), context);
addChild(libloader);
But then I was thinking of a way to get this loader piece easily into each and
every swf within an application (we split our projects up in multiple
swfs...). The solution I came up with is to create a "shared library". A
shared library sets the LoaderContext automagically! Just create an empty
movieclip which has flash.display.MovieClip as a class and an URL pointing to
your library and put this empty movieclip on your stage, et voila!! Youve got
yourself a working flash flex application.
Read all about it on my labs post:
http://labs.qi-ideas.com/2007/12/25/using-flex-compiled-code-within-flash
Yours, Sander
________________________________________________________________
Sent via the WebMail system at wichers.nu
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders