Usually when a bool is true, it has an equivalent binary value of 1.
However in flash I can't do the following:
It gives an error "1067: Implicit coercion of a value of type Boolean to an unrelated type Number"
Can I do explicit type conversion in Flash?
The point was to optimise by avoiding the use of an IF function. I know I could just use an int instead of a bool, but I want to know if this is possible...
However in flash I can't do the following:
Code:
var isPowerful:Boolean = false;
Force = (7 * isPowerful + 1) * Thrust;
Force = (7 * isPowerful + 1) * Thrust;
It gives an error "1067: Implicit coercion of a value of type Boolean to an unrelated type Number"
Can I do explicit type conversion in Flash?
The point was to optimise by avoiding the use of an IF function. I know I could just use an int instead of a bool, but I want to know if this is possible...