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
Font Fight!
Flash Display Fixes
Web Fonts Suck!
Metallic Text in Photoshop
Classy Glassy Orbs
The Definitive List of Vector Art
From Work Path to Shape Layer
The Definitive List of Adobe Alternatives
Reiq’s Corel Painter Tutorial
Color Picker

Leave a Reply