/* Open a new FLash file (ActionScript 3.0). Select TimeLine --> Top Layer --> Frame 1 Select Window --> Actions (F9) Copy and paste this snippet Observe the output */ /* We know that some common data types include String, and Number but the class designer can create all kinds of new data types. For example, a data type could be feline. We could create a subtype of housecat (feline.housecat) but we normally could just call it a type of housecat. In Adobe land, it's important to be able to figure out what type something is because we might need to dresearch the type in the language reference. */ // Fun with data types // typeof var petName:String = "Spot" trace ("petName has a data type of " + typeof(petName) + "." ); // another example. Not necessarly the answer we were expecting. var today:Date = new Date(); trace ("today is data type of: " + typeof(today) +"." ); // Another way to check if (today is Date) { trace("today is a Date object."); } else { trace("today is not a Date object."); } if (today is Sound) { trace("today is a Sound object."); } else { trace("today is not a Sound object."); } //Last: trace ("today belongs to the " + getQualifiedClassName(today ) + " class."); // from Flash CS4 Pro Bible by Robert Reinhardt and Snow Dowd