2 Replies Latest reply on Oct 29, 2012 9:37 AM by neoX286

    Code gating based on packaging method

    neoX286 Level 1

      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?

        • 1. Re: Code gating based on packaging method
          mccoyjo

          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;

          • 2. Re: Code gating based on packaging method
            neoX286 Level 1

            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?