You can use:
var boolString:String = "true";
var boolValue:Boolean = boolString == "true";
var boolString2:String = "false";
var boolValue2:Boolean = boolString2 == "true";
Edit
The comment below suggests using
var boolValue:Boolean = (boolString == "true") ? true : false;
This just complicates the code for no reason, as the evaluation happens in part:
(boolString == "true")
Using a ternary operator is equivalent to:
var tempValue:Boolean = boolString == "true";
var boolValue:Boolean = tempValue ? true : false;
source
share