0

Conditional Shortcut in ActionScript

Conditional Shortcut in ActionScript via @largestartist Posted by Jose Cuadra on August 3, 2009 Tags: Filed Under: References

While thumbing through an old ActionScript book(Training from the Source) I found a shorthand approach to the conditional statement.

var mood:String = (money > 1000000) ? "Happy" : "Sad";

…instead of…

if(money > 1000000){
mood = "Happy";
}else{
mood = "Sad";
}

Want More? Try These.

Related Articles
ActionScript 2 to 3 Object Properties
Transversing the Display List Correctly
Flash Slideshow in Actionscript 3
Random Functions
The Textfield’s Alpha Property in AS 3.0
Random Articles
Web Fonts Suck!
Target Blank for XHTML
Classy Glassy Orbs
Random Functions
The Definitive List of Vector Art
Posemaniacs Anatomy
Flash Display Fixes
CFCACHE, IE, CSS and XHTML
The Textfield’s Alpha Property in AS 3.0
IE Conditional Comments

Leave a Reply