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:
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.