PDA

View Full Version : Need help with preloader and MovieClipLoader function



keeponflashin'
April 20th, 2008, 09:51 AM
Hello everyone,

I created a preloader using one of the tutorials on-line and it did work somewhat, but it tends to not play the animation in it fully. I have the word "loading" being loaded with red color filling it up and text below it indicating how much has loaded. What I get, however, is "loading" starting to fill up and "1 is loading" below it, then suddenly it disappears to reveal my base movie, but my other movie (indicated with loadClip at the bottom of my script) doesn't show up just yet. It finally shows up a few seconds later and even then it's not fully loaded because it involves clicking on buttons to make things move on it. When you click them at first, it freezes, then a few seconds later that animation finally kicks in. I used the tutorial listed here: http://web.uvic.ca/akeller/pw406/ht_preloader.htm

I also used the one listed under: roll your own tween animations.

My code looks like this:

var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myMCL.addListener(myListener);
myListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
var loaded:Number = Math.round((bytesLoaded/bytesTotal)*100);
progressBar_mc.gotoAndStop(loaded);
progressBar_mc.percent_loaded_txt.text = loaded + "% is loaded";

};
myListener.onLoadInit = function(target_mc:MovieClip) {
progressBar_mc._visible = false;
};
myListener.onLoadStart = function(target_mc:MovieClip) {
progressBar_mc._visible = true;
};
myMCL.loadClip("tattoo_galleries_thumbs1.swf", "container_mc");

Can anyone help me with my problem? I'd really appreciate it.

Thanks!

Rob