/ Published in: ActionScript 3
Used for the blog post: http://www.brettwidmann.com/2010/08/flash-primitive-data-types
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//declare an int with a value of 5 and boolean var five:int = 5; var bool:Boolean; if (five > 6) { bool = true; } else { bool = false; } //when comparing booleans, always make sure to //use two '=' signs, otherwise you'll set the //value of the variable to what you are trying //to compare. This is called a logical operator. if (bool == true) { trace("This should actually be false. The value is 5, " + "greater than 6.") } else { trace("The value of the int is 5."); }
URL: http://www.brettwidmann.com