This may be common knowledge to some, but I was pretty excited when I realized I didn't need an conditional statement to figure out which direction to toggle a Boolean value. Check it out:
var isTrue:Boolean = true;
isTrue = !isTrue;
trace(isTrue); // prints "false"
isTrue = !isTrue;
trace(isTrue); // prints "true"
Simplicity is your friend.
This is good to know :)
ReplyDeletei actually heard a little noise when reading the code.
ReplyDeleteThis is awesome. Much easier than the whole "if true then make false, else blah blah blah". I don't know why this isn't common knowledge.
ReplyDeletethank you very much man ,
ReplyDelete