• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Boolean Data Type

The next data type we'll discuss is Boolean. Boolean data types are logical answers in the form of true or false. Also notice that these words cannot be used as variable names or identifiers in ActionScript because they are strictly Boolean data types. Let's take a look at a use of Boolean:

var alarm:Boolean = true;
if (alarm == true) {
      trace ("Wake me up!");
}else{
      trace ("Let me sleep in.");
}
// output: Wake me up!


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint