Announcement Announcement Module
Collapse
No announcement yet.
Package AIR application Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Package AIR application

    I am trying to package my AIR application but the applicationContext.xml and applicationContext.properties are obviously not found at runtime. For a test I copied them manually next to the main SWF in the exploded AIR application folder (OS-X):

    <MyApp.app>/Contents/Resources/MyApp.swf
    <MyApp.app>/Contents/Resources/applicationContext.xml
    <MyApp.app>/Contents/Resources/applicationContext.properties

    This is the structure that works as a web application. Any hints?

    Thanks,
    Peter

  • #2
    not sure

    I think Spring AS uses an URLLoader to retrieve the configuration file. I'm not sure if this is also suitable for a file that lives on the local filesystem, I'm pretty sure its not. I'm not sure if Spring AS has that possibility yet, you'd have to consult the ASDocs a little I guess.
    I'll have a look and see if i can find something...

    Comment


    • #3
      add an embedded config

      Yep, checked the sources, Spring AS uses an URLLoader, so the local filesystem can't be reached by that.

      There's also a method called addEmbeddedConfig() that let's you add a configuration that is embedded into your application. For now that seems to be the best option for you.

      cheers,

      Roland

      P.S.
      Here's a forum entry on the old Prana forum that explains how:
      http://prana.herrodius.com/viewtopic.php?f=3&t=50
      Last edited by 666shooter; Dec 21st, 2008, 07:49 AM. Reason: added URL

      Comment


      • #4
        Thanks for the hints. I tried using addEmbeddedConfig() as suggested but with the PureMVC extensions it does not work:
        Code:
        <mx:WindowedApplication applicationComplete="init()">
        
        [Embed(source="applicationContextAIR.xml", mimeType="application/octet-stream")]
        private var embeddedConfig:Class;
        private var applicationContext:XMLApplicationContext = new FlexXMLApplicationContext();
        
        private function init():void {
        	applicationContext.addEmbeddedConfig(embeddedConfig);
        	applicationContext.addEventListener(Event.COMPLETE, startupApp);
        	applicationContext.load();
        }
        
        private function startupApp(e:Event):void {
        	applicationContext.removeEventListener(Event.COMPLETE, startupApp);
        
        	// Initialize PureMVC
        	applicationFacade = ApplicationFacade.getInstance(applicationContext);
        	applicationFacade.initializeIocContainer();
        
            ....
        
        </mx:WindowedApplication>
        The applicationFacade is null - even though it allows passing either a String pointing to a URL or directly an XML object. Trying to find out what's going on in AppliationFacade.

        Peter

        Comment


        • #5
          hmmm, sorry...

          Hey Peter,

          I'm sorry but PureMVC is not one of my areas of expertise, I've worked solely with Cairngorm up til now. So I hope somebody else on the forum can shed some light on this, I'm afraid I won't be of much use...

          good luck,

          Roland

          Comment

          Working...
          X