the blog
Back to -Blog

Amethyst 2 - Conditional Compilation for ActionScript

Now more like C#
by Dermot Hogan
Friday 12 April 2013.

One of the nice things about C# is that is has good conditional compilation support. ActionScript does support conditional compilation but the syntax isn’t great. In Amethyst 2 we have implemented a C# like syntax for conditional compilation.

Conditional compilation gives you the ability to exclude or include chunks of code at compile time. So in C#, you could say

if (x) {
// do something
} else {
// do something else

This is executed at run time and the code inside the if statement will be run or not depending on whether x is true.

But you can also do this

#if X
// do something
// do something else

Here, the ‘do something’ code will only be compiled if the X symbol is defined. Otherwise the ‘do something else’ code will be compiled in. In other words, it’s done at compile time not run time.

ActionScript does allow conditional compilation, but the syntax is peculiar to say the least. For example,

CONFIG::debugging {
// debugging code here.

and you define the constant in the compiler’s arguments like this


In Amethyst 2, we’ve implemented a scheme similar to C#, but using just #if, #else and #endif and with no arithmetic – just ’is the symbol defined’ or not.

The text not included is greyed out in the Editor:

You set the symbols to be ‘defined’ in the compilation options

Note that the options are configuration dependent, so that you can have code included or excluded for, say, Release or Debug configurations.

Clearly, the #if, etc., syntax isn’t ActionScript and so if you export it to another IDE or use just the basic Adobe compilers you will have problems. However, even allowing for that we still think that it’s much nicer to have the #if syntax rather than something like //#if - and that’s what we’ve used.

This is a preview of the forthcoming version of Amethyst 2 – our ActionScript/Flash IDE for Visual Studio 2012 and 2010. If you buy Amethyst 1.0 for Visual Studio 2010 now you will be entitled to a free update to Amethyst 2 when it is released. See the Amethyst 2012 announcement for more information.

Bookmark and Share   Keywords:  Amethyst 2
© SapphireSteel Software 2014
buy zantac online forzest bupron sr buy naltroxene 50mg nizonide nitazoxanide buy generic melanocyl aurogra for sale topirol doxicip doxycycline buy generic viagra 100mg buy sirolimus 1mg mestilon for sale buy generic nodict buy imatinib online buy sildigra xl plus online kamagra oral jelly for sale sildenafil citrate buy generic malegra fxt fludrocortisone buy zocor 20mg order garlic himalaya buy natamet online buy generic pletoz buy tadora 20mg ciplactin for sale buy viraday online buy modafinil online buy viagra buy valif 20mg malegra buy generic amitryn buy vardenafil online buy lithosun sr buy bortenat online buy geftinat online buy tadaga online buy generic malegra dxt arcalion sulbutiamine fluka 150mg buy finasteride online buy modalert online buy ketasma buy rogaine shampoo online armodafinil veenat imatinib premarin for sale buy amlodipine order vega buy tizan 2mg buy tretinoin buy viread online buy rasalect buy hostacycline buspin buy sildigra testosterone undecanoate 40mg buy arpizol online buy baclofen 25mg vardenafil buy malegra professional buy erlotinib buy revlimid 5mg auvitra buy pelosta buy norvasc 10mg qutipin sr buy esomeprazole fertyl super clomiphene dapoxetine 60mg buy flagyl 200mg order piracetam buy vasotec 5mg buy generic sirolimus buy fluticasone bimatoprost opthalmic drops 0.03% buy irovel 150mg qutipin tadalafil jelly buy generic calaptin buy xtane buy generic megalis super kamagra for sale buy prosteride online vardenafil 20mg bimatoprost for sale order tadalafil levipil order oleanz buy cutivate cream 0.05% buy calutide 50mg buy lasix 40mg mirtaz for sale buy generic biduret tadalafil super active cialis super active terbicip rifaximin buy sulpitac online cipro buy atomoxetine hydrochloride online buy piracetam online buy testosterone gel 5 gram/sachet buy soranib 200mg tadalista buy omnacortil online order memantine buy caverta online buy diflucan online buy adoxa buy acamprol buy admenta xenical 120mg buy generic modvigil buy anabrez filagra super active for sale buy cernos depot online buy bactrim d.s viagra generic ampicillin 500mg budeprion 150mg buy clomiphene 50mg armod tadalafil 20mg buy tadalafil super p force 100mg + 60mg buy generic suhagra buy sildenafil citrate online avagra avana for sale vilitra for sale order andriol zithromax 250mg buy lovegra online caberlin order rizact buy flagyl 400mg fluorouracil 5% buy generic diclofenac order isotretinion tadarise pro buy baclof tadacip letrozole 2.5mg viagra buy sildenafil citrate jelly 100mg buy duprost quinine sulphate tadalafil buy sildenafil citrate 100mg order generic imatinib buy generic x-vir buy generic tenofovir + emtricitabine buy stendra online buy generic urimax atorvastatin buy sildisoft online buy aldactone online finpecia 1mg buy armodafinil buy waklert buy generic omeprazole buy sustanon 250mg dilantin for sale