rss twitter

Using SWCs within AIR packaging with ANT

In addition to AIR2 and FDT4 (M3) – A detailed Walkthrough I encountered a problem when trying to use external SWCs like e.g. an assets library in your AIR package. In other words: If you're using an SWC with all your graphical stuff exported from the Flash IDE you simply rightclick it in FDT and add it to your Source path to use it in your project. This works fine in a compiled SWF but if you want to launch your project in an AIR environment it will not find the library. And I really had a look for this ("Class not found!") errors after packaging for hours but didn't find anything except an ooold AIR project by a friend of mine who used the following argument in his "Compile SWF" task:

XML:
  1. <arg value="-library-path=${assets_dir}/lib/assets.swc" />

Et voilá, from then on my exported AppBg asset worked flawlessly in the ADL and packaged .air file:

Actionscript:
  1. var back:AppBg = new AppBg();

Now we're ready to take the next step: A real AIR application with chromeless layout, asset-using and some communications..

5 Responses to “Using SWCs within AIR packaging with ANT”

  1. [...] This post was mentioned on Twitter by Matan Uberstein, Matan Uberstein and Aiden Tailor, WE ♥ FDT. WE ♥ FDT said: New #FDT4 post published: Using SWCs within #AIR packaging with #ANT, http://bit.ly/a0kXrM (@beautifycode) [...]

  2. Matthew Jalie says:

    Insane, just googled for it and you were by far the only resource dealing CLEARLY and useful with this question. Thanks a loooot!!

  3. Philip says:

    Just d/l FDT4 and want to build with AIR. Great articles, and just at the time I needed them. Thanks!

    You should probably amend to:

    to prevent overwriting the full -library-path

  4. Philip says:

    oops, wordpress stripping my pointy brackets!

    You should probably amend to:
    arg value="-library-path+=${assets_dir}/lib/assets.swc"

  5. Alex says:

    Spezial thanks, ich searched the half sunday to find a solution.

Leave a Reply

Powered by WordPress | Free T-Mobile Phones for Sale | Thanks to Palm Pre Blog, Video Game Music and Get Six Pack Abs