If your object is not typed, you can do this:
if (obj.getChildren)
{
obj.getChildren();
}
This will not work if the object is typed (1069 error). Also, if it has
a property by the name of getChildren, I think you'll get a 1006.
Otherwise, it seems to work just fine.
Shaun
--- In [email protected], "blc187" <[EMAIL PROTECTED]> wrote:
>
> is there a way to tell if an object has a getChildren method before
> calling it?
>
> I'm calling something that takes any type as the first argument
> public function myFunc(obj:*):void
>
> I need to tell if obj has a getChildren() method before I call it and
> get an error saying Error #1006: getChildren is not a function.
>