ActionScript: conversion to Boolean

Categories: Flex; Tagged with: ; @ February 27th, 2012 19:46

The following table summarizes the results of casting to the Boolean data type from other data types:

Data type or value Result of conversion to Boolean
String false if the value is null or the empty string ( “” ); true otherwise.
null false
Number, int or uint false if the value is NaN or 0; true otherwise.
Object false if the instance is null ; true otherwise.


Note: when you convert a string to boolean, remeber to trim the string first.

and this is a capture from <<Essential ActionScript 3.0>>:



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.