Return to Snippet

Revision: 22365
at June 18, 2010 18:47 by weavermedia


Updated Code
// buttonState is String, pressed is Boolean

// String is "on" if pressed is true, otherwise it's "off"
var buttonState:String = (pressed) ? "on" : "off"

// pressed is true if buttonState string matches "on" otherwise it's false
var pressed:Boolean = (buttonState=="on") ? true : false

Revision: 22364
at January 11, 2010 05:55 by weavermedia


Initial Code
// buttonState is String, pressed is Boolean

// String is "on" if pressed is true, otherwise it's "off"
var buttonState:String = (pressed) ? "on" : "off"

// pressed is true is buttonState string matches "on" otherwise it's false
var pressed:Boolean = (buttonState=="on") ? true : false

Initial URL


Initial Description


Initial Title
Conditional shorthand Flash AS3

Initial Tags
flash

Initial Language
ActionScript 3