# Typecasting a loaded swf as its document class

**URL:** <https://forum.kirupa.com/t/typecasting-a-loaded-swf-as-its-document-class/329846>\
**Category:** Uncategorized\
**Created:** [October 24, 2012, 6:16am UTC](https://forum.kirupa.com/t/typecasting-a-loaded-swf-as-its-document-class/329846 "2012-10-24T06:16:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bossmonkey](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@bossmonkey](https://forum.kirupa.com/u/bossmonkey)\
**Post date:** [October 24, 2012, 6:16am UTC](https://forum.kirupa.com/t/typecasting-a-loaded-swf-as-its-document-class/329846/1 "2012-10-24T06:16:58Z")

</div>

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?
