Macromedia Flash Professional 8 UNLEASHED [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Macromedia Flash Professional 8 UNLEASHED [Electronic resources] - نسخه متنی

David Vogeleer, Eddie Wilson, Lou Barber

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید






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!

Because alarm is set to TRue, the if statement evaluates to TRue and traces the appropriate message. If the alarm had been set to false, the else statement would have taken effect.

Also note, Boolean values can be written numerically as well. The number zero represents false, and all nonzero numbers, including negative numbers, are true like the following examples.


trace(Boolean(0)); //false
trace(Boolean(1)); //true
trace(Boolean(-1)); //true


/ 318