-
as2 external swf preloader almost working correctly --please help --
Hi. Sorry this is a preloader question.
My preloader works, but letters are missing from the % loaded text that is displayed. Rather than saying whatever % "loaded", it says "oadd."
In the output box it says: [type Function].
And, in the compiler errors box, it says the following:
"The class or interface 'Preloader' could not be loaded."
Code:
// create an empty movie clip
this.createEmptyMovieClip("container", this.getNextHighestDepth());
// create the MovieClipLoader Object
var mcl:MovieClipLoader = new MovieClipLoader();
// create the listener Object
var listener:Object = new Object();
// when it starts loading
listener.onLoadStart = function(mc:MovieClip)
{
mc._visible = false; // hide the movie
}
// while it's loading, grab the percentage
listener.onLoadProgress = function(mc:MovieClip, bl:Number, bt:Number)
{
var percentage = Math.round(bl / bt * 100);
// play the animation accordingly
preloader_mc.bar_mc.gotoAndStop(percentage);
// show it in the text field
preloader_mc.percentage_txt.text = percentage + "% loaded";
};
// when it finishes loading
listener.onLoadComplete = function(mc:MovieClip)
{
// remove to animation
preloader_mc.swapDepths(preloader_mc._parent.getNextHighestDepth());
preloader_mc.removeMovieClip();
}
// when the first frame bebomes available
listener.onLoadInit = function(mc:MovieClip)
{
// we're ready to interact with it
mc._visible = true;
}
// load the external file:
mcl.loadClip("MP3PlayerF8_v14.swf", container);
// add the listener to the MovieClipLoader Object
mcl.addListener(listener);
// stop the bar animation and initialize the text
preloader_mc.bar_mc.stop();
preloader_mc.percentage_txt.text = "contacting server...";
-
fixed the problem
I unclicked "embed" characters...and everything is working now.
Thanks.
-
fixed the problem
I unclicked "embed" characters...and everything is working now.
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|