FP6 Conditional Weirdness
June 1st, 2007
Consider the following code:
if (undefined || true) trace(“true”);
else trace(“false”);
if (undefined || “true”) trace(“true”);
else trace(“false”);
if (“true”) trace(“true”);
else trace(“false”);
In Flash CS3 (have not tested with other versions) if you publish this for Flash Player 7 or later your output window receives these traces (as expected):
true
true
true
If you publish for FP6 you get:
true
false
true
That is some strange behaviour. This can be a gotchya if you are writing AS2 code that targets the FP6 because chances are you may be use to writing conditional statements like this.
Categories: Uncategorized
