# Cast loaded swf content to interface

**URL:** <https://forum.kirupa.com/t/cast-loaded-swf-content-to-interface/288563>\
**Category:** Uncategorized\
**Created:** [May 18, 2009, 11:23am UTC](https://forum.kirupa.com/t/cast-loaded-swf-content-to-interface/288563 "2009-05-18T11:23:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zoulz](https://avatars.discourse-cdn.com/v4/letter/z/dfb087/32.png) [@Zoulz](https://forum.kirupa.com/u/Zoulz)\
**Post date:** [May 18, 2009, 11:23am UTC](https://forum.kirupa.com/t/cast-loaded-swf-content-to-interface/288563/1 "2009-05-18T11:23:12Z")

</div>

Hi, I’m trying to load a external swf using the Loader object, and that part seems to be working fine. But, I can’t seem to be able to cast the LoaderInfo.content to a interface that it’s document class implements. This should be possible, shouldn’t it?

```auto

public function load()
{
    _urlRequest = new URLRequest("http://localhost/test.swf");

    _loader = new Loader();
    _loader.contentLoaderInfo.addEventListener(Event.INIT, onRequestComplete);
    _loader.load(_urlRequest, new LoaderContext(false, ApplicationDomain.currentDomain));
}

function onRequestComplete(event:Event):void
{
    var loaded:IMyInterface = IMyInterface(_loader.contentLoaderInfo.content);

    loaded.myMethod();

    addChild(_loader.contentLoaderInfo.content);
}

```
