Two Solutions: Flex swc’s (RPC) and or Intrinsic classes within Flash CS3!

[FONT=Arial]Hi List,[/FONT]
[FONT=Arial] [/FONT]
[FONT=Arial]I’ve been trying to evangelize my solution to the flash community but I don’t think it came through, really… I’m not here to spam so this will be my last post about this subject in the hope that someone will pick it up! [/FONT]
[FONT=Arial] [/FONT]
[FONT=Arial]I was looking for a solution to get Flex RPC support within Flash CS3 (no, 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! That’s 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! [/FONT]
[FONT=Arial] [/FONT]
[FONT=Arial]There are two solutions I use for the linking part the first thing you would think is the following piece of code (the only thing ‘special’ here is the LoaderContext):[/FONT]
[FONT=Arial]var libloader = new Loader();[/FONT]
[FONT=Arial]var context:LoaderContext = new LoaderContext();[/FONT]
[FONT=Arial]context.applicationDomain = ApplicationDomain.currentDomain;[/FONT]
[FONT=Arial]libloader.contentLoaderInfo.addEventListener(Event.INIT, initLibrary);[/FONT]
[FONT=Arial]libloader.load(new URLRequest(“library.swf”), context);[/FONT]
[FONT=Arial]addChild(libloader);[/FONT]
[FONT=Arial] [/FONT]
[FONT=Arial]But then I was thinking of a way to get this loader piece into each and every part of an application (we split our projects up in multiple swf’s…). 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, now put this empty movieclip on your stage, et voila!! You’ve got yourself a working flash flex application.[/FONT]
[FONT=Arial] [/FONT]
[FONT=Arial]For working examples and more e[COLOR=black][FONT=Arial]xplanation, go here[/FONT][/COLOR]:[/FONT]
[FONT=Arial][COLOR=#800080]http://labs.qi-ideas.com/2007/12/25/using-flex-compiled-code-within-flash[/COLOR][/FONT]
[FONT=Arial] [/FONT]
[FONT=Arial]Yours, Sander[/FONT]