-
Checking parent's class
How can I check what a parent MovieClip's class is?
I have a Terrain class that I only want to use a function when the parent movieclip is a specific class, so that the terrain object can be used by multiple classes, but only launch that specific function when the parent's class is "WorldBase". How can i detect this through the Terrain class?
-
PHP Code:
function checkClass(theObject:Object) {
if (theObject is WorldBase) {
do...
}
else {
do...
}
or perhaps one of these will work without function:
PHP Code:
if (theTerrain.parent is WorldBase)
PHP Code:
if (theTerrain(parent) is WorldBase)