I need to load dynamic code to the application at run time (i
don't know the swf url).
What is the best way to do that?
i think that mx:Modules is a problem because it can't be done
for action script files (.as) and it's swf per module (meaning per
I know that RSL maybe the solution. Can someone confirm?
I will be happy to view an example that shows how to use the
i think that i need the swf and not swc. Is this correct?
This is easier if you are loading AS only created swfs. Just
have your class extend sprite so you can export as a swf. You also
need to be mindful of the Application Domain. Also, the loading
class has to have the appToLoad class in it's build path (right
click on a project, select properties, select Flex Build Path, add
Folder, select project folder).
Here's the pseudo code:
in the app to load:
public class AppToLoad extends Sprite
// your implementation here
then, in the loader app:
private function loadIt():void
ldr = new Loader();
var ldrContext:LoaderContext = new LoaderContext(false,
ldr.load(new URLRequest("AppToLoad.swf"), ldrContext);
private function handleLoaded(e:Event):void
var myLoadedSwf:AppToLoad = LoaderInfo(e.target).content as
I usually use interfaces to hide the implementation:
AppToLoad extends Sprite implements ISomeInterface
The app doing the loading:
var myLoadedSwf:ISomeInterface =
LoaderInfo(e.target).content as ISomeInterface;
I still haven't figured out how to type cast a loaded mxml
compiled swf ;o(