2

I have a complicated game project using multiple libraries, swc, assets, etc. The output is a two swf files (shell with the menu and the game itself). Packing in IPA (iOS) does not work immediately because of a lot of problems and settings ANT. But build as swfs work fine.

Is it possible to create a separate mobile as3 project, which will load the first swf to full screen, which will load the second swf, and then build it? How best to do this? Or are there other options?

Astraport
  • 1,239
  • 4
  • 20
  • 40

1 Answers1

1

Try this:

  1. Compile a copy of your main game swf as an swc.
  2. In a copy of your menu swf, point it to the game swc and in the place you would normally go through the motions of loading the external game swf, just directly add a new instance of the root game class:

    // Before:
    var ldr:Loader = new Loader();
    ... other stuff, progress monitoring, etc. ...
    var mcGame:MovieClip = ldr.content as MovieClip;
    
    // After - one line:
    import my.game.namespace;
    var mcGame:GameClass = new GameClass();
    
  3. Compile this updated menu project as a swc.

  4. In your mobile app, add an instance of the root class of the menu stage:

    // Constructor for root class of mobile app   
    public function AppRoot() { 
        this.addChild(new GameMenu());
    }
    

Now everything is bundled in a single compiled project.

Joshua Honig
  • 12,925
  • 8
  • 53
  • 75