# Weird moviecliploader problem

**URL:** <https://forum.kirupa.com/t/weird-moviecliploader-problem/295599>\
**Category:** flash\
**Created:** [September 1, 2009, 7:09pm UTC](https://forum.kirupa.com/t/weird-moviecliploader-problem/295599 "2009-09-01T19:09:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vega](https://avatars.discourse-cdn.com/v4/letter/v/b19c9b/32.png) [@vega](https://forum.kirupa.com/u/vega)\
**Post date:** [September 1, 2009, 7:09pm UTC](https://forum.kirupa.com/t/weird-moviecliploader-problem/295599/1 "2009-09-01T19:09:47Z")

</div>

Hi all,

I have come across this issue before also so just wanted to make sure that I am not missing something really simple.

I am trying to load an external file using the movieClipLoader method which create this weird problem:

[AS]  
var movieLoader:MovieClipLoader = new MovieClipLoader();

this.createEmptyMovieClip(“movieContainer”, this.getNextHighestDepth());  
movieLoader.loadClip(“somePath”, movieContainer);

movieLoader.onLoadInit = function(target:MovieClip) {  
trace(“Background clip loaded!”);  
}  
movieLoader.onLoadError = function(target:MovieClip, errorCode:String) {  
trace(“ERROR :: “+errorCode);  
trace(target+” failed to load its content!”);  
}  
[/AS]  
This code throws the error:

```auto

There is no property with the name 'onLoadInit'.
There is no property with the name 'onLoadError'.

```

When I remove the typecasting at the declaration of the movieClipLoader variable, it works like a charm. As in, this works perfectly:

[AS]  
var movieLoader = new MovieClipLoader();

this.createEmptyMovieClip(“movieContainer”, this.getNextHighestDepth());  
movieLoader.loadClip(“somePath”, movieContainer);

movieLoader.onLoadInit = function(target:MovieClip) {  
trace(“Background clip loaded!”);  
}  
movieLoader.onLoadError = function(target:MovieClip, errorCode:String) {  
trace(“ERROR :: “+errorCode);  
trace(target+” failed to load its content!”);  
}  
[/AS]

Any explanation as to why this happens?

Thanks.
