0
votes

I want to load a flex application in mobile flex application and also i want it to interact with the parent application. Right now I am trying to load the swf with swfLoader in mobile app, but it gives me security error. And also should I want the parent application to be generic in terms of child application...as in down the line if someone wants he can have another child application with same name run.

This is in the main application:

    private function connectHandler(event:Event):void {
      NativeApplication.nativeApplication.addEventListener(KeyboardEvent.KEY_DOWN, handleKeys, false, 0, true);
      mySWFLoader.source="file:///sdcard/Galaxy/Teacher/Shell.swf";
      mySWFLoader.visible = true; 
      mySWFLoader.addEventListener(Event.COMPLETE,swfLoaderHandler);
    }
2
I see your question is tagged as Android and, for that platform, it may be possible. Keep in mind that for iOS this is absolutely not doable. - Eduardo
Yes I intend to do it for android. But can you please help me decipher this. What do I do so that I dont get security issues.. P.S. are you from alicante..? - Harsh Vardhan
Unfortunately, my experience is with iOS, so I can't help. I was just saying in case you want to migrate to iOS later, to avoid you headaches. P.S.: I'm not from Alicante, 1/2 AndalucĂ­a, 1/2 Asturias. - Eduardo
You might be able to get more help if you specify which error you are getting and maybe paste a snippet of code too. - Eduardo
This is in the main application: private function connectHandler(event:Event):void { NativeApplication.nativeApplication.addEventListener( KeyboardEvent.KEY_DOWN, handleKeys, false, 0, true); mySWFLoader.source="file:///sdcard/Galaxy/Teacher/Shell.swf"; mySWFLoader.visible = true; mySWFLoader.addEventListener(Event.COMPLETE,swfLoaderHandler); } - Harsh Vardhan

2 Answers

0
votes

This should help.

The idea to create a "portal-like" service with:

  • a shell that is not prone to changes
  • several sub applications that you can load into it and compile separately

It's, well, tempting - but, from my personal experience, there is a lot of trouble with doing this, especially if you're doing Flex on a mobile with sub-applications...

0
votes

You cannot load an external swf like that.

Import Shell.swf file into your src source folder inside flex mobile project.

then read using the below script

private function connectHandler(event:Event):void {
  NativeApplication.nativeApplication.addEventListener(KeyboardEvent.KEY_DOWN, handleKeys, false, 0, true);
  mySWFLoader.source="Shell.swf";
  mySWFLoader.visible = true; 
  mySWFLoader.addEventListener(Event.COMPLETE,swfLoaderHandler);
}