Only use WCK when compiling for mobile

I have a game which uses WCK and stage3D. I'd like it to run on both the web and mobile.
For mobile I'd like to use WCK to get the speed increase.
For the web I'd like to use Box2dAS so I don't have to pay the "speed tax"

Is there an easy way of changing which version gets used at compile time without needing to make large changes to all the code.
If we were using C I would use preprocessor directives. I'm not sure how to do this in Actionscript.

Any pointers would be great.
Hi Harissa,

You could use conditional compilation and pass in parameters to the mxmlc compiler:

http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_21.html

Cheers,

Jamie
Hi Jamie,
Thanks for your reply. I know about conditional compilation. I'm using Flash professional so I'm not sure how I would use this to compile with a non-alchemy based version of WCK.

However, I also posted on the Starling forum and someone came up with a solution.

There's a new feature in the Flash 11.4 player which means that if you run a swf with both alchemy and Stage3D on the web it checks to see if you have a "premium features" license.
If you do have the license it runs Stage3D using hardware acceleration. If you don't have the license Stage3D defaults to software rendering which is fine for my game because speed isn't a problem for the web version.
So essentially I don't have to do anything apart from make sure the web player is using Flash 11.4 or above. Earlier versions of the player produce an error if you try and use both alchemy and Stage3D without the license.

Cheers

Joe
i'm sorry but as far as i know Box2dAS still uses Alchemy system.
am i wrong?

Original thread: https://box2d.org/forum/viewtopic.php?t=8754