简体   繁体   中英

load flex application in flex mobile application

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);
    }

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);
}

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 ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM