Typecasting a loaded swf as its document class

Hi,
I’m having a bit of trouble loading a swf and casting its type properly.
I’m loading a swf that has a document class associated with it called AvatarCreator. When I load the swf and try to cast the loader or loader.content as AvatarCreator, I get null.
I’m sure this is a simple fix. What am I doing wrong?