Groups | Blog | Home
all groups > flash actionscript > september 2005 >

flash actionscript : LoadMovie vs. MovieClipLoader


Mr Helpy mcHelpson
9/23/2005 10:05:35 PM
Ok, I'm cleaning up some code, and I would like to replace the following code.
---------------------------------------------------------------------------
_root.createEmptyMovieClip("holder", 345)
_root.holder._y = 0
_root.holder._x = 0
_root.holder.loadMovie(_root.loaderVar + _root.nummerVar + ".swf");

_root.preL.gotoAndPlay(2);
--------------------------------------------------------------------------
it works fine, but I need it to kick back a boolean value to tell me wheather
the file its looking for exists. I pulled the sample code down, and of course
it checks out as valid code as is, but I need it to be a variable-defined
target instead of "target_mc" Plugging in..

_root.loaderVar + _root.nummerVar + ".swf"
and/or
[_root.loaderVar + _root.nummerVar + ".swf"]

don't actually work. Syntax error, my problem, can you help? Below is the
example I was pulling from. I just need to know how to put in a
variable-defined path, errr at least for now.

-----------------------
var my_mcl:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myListener.onLoadStart = function(target_mc:MovieClip) {
trace("*********First my_mcl instance*********");
trace("Your load has begun on movie clip = "+target_mc);
var loadProgress:Object = my_mcl.getProgress(target_mc);
trace(loadProgress.bytesLoaded+" = bytes loaded at start");
trace(loadProgress.bytesTotal+" = bytes total at start");
};
-------------------------------
kglad
9/24/2005 12:00:00 AM
_root.holder is the target movieclip assuming you use:

my_mcl.addListener(myListener);
AddThis Social Bookmark Button