HELP!
Hello all.
Iâm having a horrible time trying to load an external swf into an mc created using âcreateEmptyMovieClipâ
Can someone look this over and help me out?
function executeMenuAction(action){
// preloader start invisible
contentClip.pre._alpha = 0;
// i create the container clip
var container:MovieClip = contentClip.createEmptyMovieClip("container", this.getNextHighestDepth());
// the MovieClipLoader class...
var mcLoader:MovieClipLoader = new MovieClipLoader();
// the listener Object...
var listener:Object = new Object();
// while loading
listener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
integer = Math.round((bytesLoaded*100)/bytesTotal);
contentClip.pre._xscale = integer;
}
// when load starts
listener.onLoadStart = function(target:MovieClip):Void {
contentClip.pre._alpha = 100;
contentClip.pre._xscale = 0;
}
// when first frame loaded clip init
listener.onLoadInit = function(target:MovieClip):Void {
contentClip.pre._alpha = 0;
target._x = -target._width/2 + contentClip._width/2;
target._y = -target._height/2 + contentClip._height/2;
}
// adding the listener to the loadClip
mcLoader.addListener(listener);
// here is where i finally use the "action" xml tag as the url to be passed
// so we have that the "action" will load inside the "container" movie clip, and that´s all ;)
mcLoader.loadClip(action, container);
}
// you could also use this function to load some content at first, for example:
// executeMenuAction("description.swf");
The AS is from a menu I bought, which works well on the root of the movie, but this menu is a few mcâs inside of the movie.
The relative path to the âcontentClipâ is :
this.general.photo.contentClip
The absolute path to âcontentClipâ is:
_root.general.photo.contentClip
I can upload the fla if that would help.
Thanks for looking!