Call custom function in loaded clip

Hi,

I’m wondering if anyone knows a way to get around this:

*1061: Call to a possibly undefined method setLevel through a reference with static type flash.display:DisplayObject. error in AS3
*
This is a situation in which I load an external movieclip (using Loader) and then want to call a function I’ve defined in the clip’s DocumentClass, called setLevel(). I want to be able to specify a custom clip through flashvars whose only requirement is that it support this function, so the binding is unknown at compile time.

Is there a way to do this, or am I going about it the wrong way?

Thanks,
Jiropole