2

I want to build a project in Flash Builder 4.5 both for Android and for iOS. Both builds use the same code besides a minor class: Android uses 1 class, and iOS uses a different one.

Instead of changing it manually each time I compile, I want to find a way to let FB know which class to include in each of the builds. I can't include both and do the check in runtime because these classes have EMBED meta tags, which will increase the file size tremendously if I include both.

Is there a way to do so?

ShayDavidson
  • 717
  • 1
  • 7
  • 20

1 Answers1

1

You can use compiler variables to do it in your class :

ex : Custom import

OS_CONFIG::ANDROID{
        import com.android.foo;
}

OS_CONFIG::IOS{
        import com.ios.foo;
}

You can also add code betwen {}

And add compiler args:

Compile for android

-define+=OS_CONFIG::IOS,false -define+=OS_CONFIG::ANDROID,true

or compile for ios

-define+=OS_CONFIG::IOS,true -define+=OS_CONFIG::ANDROID,false
Simon Eyraud
  • 2,445
  • 1
  • 20
  • 22