Hi I’m trying to create a script that will check different supplied filename paths, insert them into a movieclip, and retrieve the total bytes of the clip so I can determine whether or not the filename is valid. I’m having trouble with the bolded code below.
Basically its checking to see if the loaded clip’s bytes are more than 0. If its 0 then I know the path was wrong.
I’ve tried using .onData and .onLoad as event handlers, and getBytesTotal and getBytesLoaded as my conditions for my following if statement. When I trace the result I get 0 even if the movie was successfully found and loaded… anyone know whats wrong!!! :ogre:
if (presType == "web") {
videoName1 = videoName + "_300k.swf";
videoName2 = videoName + "_128k.swf";
videoName3 = videoName + "_56k.swf";
for (i=1; i < 4; i++) {
_root.createEmptyMovieClip(("videoTest"+i+"_mc"), (105+i));
loadPath = eval("videoTest"+i+"_mc");
loadVid = eval("videoName" + i);
loadPath.loadMovie(loadVid);
trace("Created " + loadPath);
** loadPath.onData = function () {
total = loadPath.getBytesTotal();
trace(total);
}**
** if (total > 0) {
** holder_mc.pathCheck_mc.pathCheck_txt.text += "Found " + (loadVid) + "
";
loadPath.removeMovieClip();
} else {
holder_mc.pathCheck_mc.pathCheck_txt.text += (loadVid) + " NOT FOUND!
";
}
}
}