PDA

View Full Version : loadclip


pixelpusher84
05-07-2005, 03:50 PM
Hi,

I am trying to preload sections of my site, apears to be working great except the percentage (pText) refuses to display and none of my traces are working, any ideas?


empty = _root.main_mc.createEmptyMovieClip("container", "100")
empty._x = -250;
empty._y = -280;
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
_root.main_mc.container._alpha = 0;
pText._visible = true;
};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
pText.text = "% "+Math.round((lBytes/tBytes)*100);
};
preload.onLoadComplete = function(targetMC) {
// maskmove
_root.main_mc.container._alpha = 100;
pText._visible = false;
trace(targetMC+" finished");
};
var myLoad = _root.main_mc.container.loadMovie("news.swf");



if i change the 1st and last lines to:

var empty = this.createEmptyMovieClip("container", "100");

and

my_mc.loadClip("news.swf", "container");

its works fine, but i want to add the container to _root.main_mc


any ideas?

cheers,
G

Xeef
05-07-2005, 03:59 PM
hi and welcome to As.Org

1.
Usage of createEmptyMovieClip
createEmptyMovieClip(instanceName:String, depth:Number) : MovieClip
2.
my_mc.loadClip("news.swf", empty); or my_mc.loadClip("news.swf", _root.main_mc.container);

pixelpusher84
05-07-2005, 04:16 PM
Hi,

many thanks, that worked great YES!

cheers,
G