I have 2 unrelated classes that extend UIComponent ultimately..;)
and each class implements a boolean property called "isClosed"

Passing these classes into the function as untyped. 

If I don't cast, it works. Trying to understand why it doesn't work
this way.

A compile time error occurs in the if statement. But isn't this where
polymorphism kicks in even though I am casting it to a higher class in
the chain.



public function checkDoor(c:*):void{
  if((c is UIComponent).isClosed == true){
    trace("opened");
  }
}

Reply via email to