Jump to content

[SOLVED] Help with a preloaded for loadMovie


Recommended Posts

 

Hi,

 

I am trying to set up a preloader that will be used while I am loading movies in to a blank movie clip. I think my actionscript makes sense, and it works when I test it through Flash, but doesn't work when I view it online. Can anyone see where I am going wrong?

 

When a button on my movie is clicked, it tells the 'container' movie to play. Here are the actions I have within 'container':

Frame 1:
stop();

Frame 5:
loadMovie('print_test.swf', this.print_page_03_container);

Frame 7:
var bytes = this.print_page_03_container.getBytesTotal();
var bytes_loaded = this.print_page_03_container.getBytesLoaded();
if (bytes_loaded == bytes) {
	//_root.gotoAndPlay(2);
	gotoAndStop(9);
} else {
	gotoAndPlay(6);
}

 

On Frame 9 I have the word 'loaded' so I can see when the timelines arrives there. The problem is, when I view it online, I gets to frame 9 even though print_test.swf hasn't fully loaded. Perhaps it is checking if the container (this.print_page_03_container) has loaded, rather than the actual movie inside it too (print_test.swf)?

 

 

Link to comment
Share on other sites

look into using movieClipLoader..its has listeners tied to it like, onLoadStart, onLoadComplete and onLoadProgress. Basically set it up like this:

 

var mcl:MovieClipLoader = new MovieClipLoader();
var mclL:Object = new Object();
mcl.addListener(mclL);

mcl.loadClip("print_test.swf",target) //target is where you want it to load. Next you can do:

mclL.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
amount = Math.floor(((bytesLoaded/bytesTotal)*100));
percent_text.text = amount; //assuming you have a text field called percent_text it will display the % loaded
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.