• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Code gating based on packaging method

Explorer ,
Oct 20, 2012 Oct 20, 2012

Copy link to clipboard

Copied

Okay flex iOS developers, here's an interesting one that I'm pretty sure we don't have the ability to do just yet.  As I'm not 100% certain of that though I figured I'd still ask.

I find myself constantly turning on and off certain segments of code based upon the packaging method I'm currently going to test with (i.e. Fast or Standard builds)...as performance is absolutely noticeably worse in the 'Fast' mode I turn off things like particle effects and heavy calculations that I don't need for testing quickly using a fast build.  Is it possible for us to determine the current packaging method that was used?  That way we can wrap code segments like this in conditionals based upon the packaging method?

Views

681

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

New Here , Oct 25, 2012 Oct 25, 2012

There's conditional compilation.With it you can write something like:

CONFIG::FAST {

      this.useParticleEffects=false;

}

CONFIG::STANDARD {

     this.useParticleEffects=true;

}

You can (or could before Flash Builder 4.7 beta) write a conditional with conditional compilation:

this.useParticleEffects = (CONFIG::FAST)?false:true;

Votes

Translate

Translate
New Here ,
Oct 25, 2012 Oct 25, 2012

Copy link to clipboard

Copied

There's conditional compilation.With it you can write something like:

CONFIG::FAST {

      this.useParticleEffects=false;

}

CONFIG::STANDARD {

     this.useParticleEffects=true;

}

You can (or could before Flash Builder 4.7 beta) write a conditional with conditional compilation:

this.useParticleEffects = (CONFIG::FAST)?false:true;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 29, 2012 Oct 29, 2012

Copy link to clipboard

Copied

LATEST

Awesome, this definitely works, but let me counter note something that I've recently found that kind of makes this still a bit of a pain

There appears to be a bug in the run configurations section of flash builder.  Lets say I want two different run configurations for a single project.  One uses a fast build, and has the configuration property of 'Fast' setup.  The other uses a standard build, and has the configuration property of 'Standard' setup.  As soon as you build the second configuration and change the launch configuration from standard to fast (or vice-versa) ALL other configurations also change this property as well.  So while your configurations can change their code gating, you always have to bring up the run configurations dialog anyways when you launch the app to change between fast and standard

There isn't really a way around this either...but that's still a completely side piece of the topic that this thread originally had haha...I wonder if this has been submitted as a bug or not yet?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines