Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you design your application for it, you should have no problems in sharing 99% of your codebase between your Flex and AIR builds.</p> <ul> <li><p>You will need a separate application MXML for the Flex / AIR versions as AIR uses a <code>WindowedApplication</code> and Flex uses <code>Application</code></p></li> <li><p>You will need to abstract your usage of any AIR-only APIs. That is, any class, property or method marked with the AIR-only icon (<a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/images/AirIcon12x12.gif" rel="noreferrer">http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/images/AirIcon12x12.gif</a>) in <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/index.html?filter_flex=4.1&amp;filter_flashplayer=10.1&amp;filter_air=2" rel="noreferrer">the Online Documentation</a>. You might find this process easier if you are using a Dependency Injection container like <a href="https://github.com/tschneidereit/SwiftSuspenders" rel="noreferrer">Swift Suspenders</a>.</p></li> <li><p>Alternatively, you can split your service <em>definitions</em> into two different source trees. This would result in your AIR project and Flex project sharing one source path, but also having their own source path. This way, code that accesses <code>com.application.MyService</code> would be shared across AIR and Flex but the <em>implementation</em> of <code>com.application.MyService</code> would differ depending on which 'service source path' was being used.</p></li> <li><p>You may find it useful to configure each build with a compiler flag like <code>-define+=CONFIG::AIR</code>. This allows you to use conditional compilation so that you can compile the same file for both builds, but include specific code for the AIR build.</p></li> </ul> <p>Here is an exmaple of conditional compilation:</p> <pre><code>public function getMyService() : IMyService { CONIFG::AIR { return new MyServiceThatUsesAnAIROnlyAPI(); } return new FallbackServiceForFlex(); } </code></pre> <p>Unfortunately there is no way to 'negate' a conditional flag (ie. <code>!CONFIG::AIR</code>) so you either need to be smart about your usage of it, or include two flags (<code>CONFIG::AIR</code> and <code>CONFIG::FLEX</code>)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload