views:

135

answers:

1

I am having two problems in the loader, the bar "bar" does not increase and mc_home get the position y = 0 no matter where I place the pages_mc nor their place the pages_mc._y = 100;

import gs.TweenLite;
import gs.easing.*

var mcLoader = new MovieClipLoader();
var mclListener:Object = new Object();
mclListener.onLoadError = function(target_mc:MovieClip, errorCode:String, status:Number) {
    trace("Error");
};

mclListener.onLoadInit = function () {
    pages_mc.forceSmoothing = true;
    trace("start");

}

mclListener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
   var percent = Math.round(bytesLoaded/bytesTotal*100);
   bar_mc.bar.width = Math.round(Stage.width + 5) / 100 * percent;
   //trace(wi);
}

mclListener.onLoadComplete = function(target_mc:MovieClip, status:Number):Void {
    trace("done");
    gotoAndPlay(2);
};

mcLoader.addListener(mclListener);
mcLoader.loadClip("http://localhost:8888/DDI/site/mc_home.swf", pages_mc);

loadMC = function(mc){
    mcLoader.loadClip(mc, pages_mc);
}

stop();
A: 

Sometimes AS2 has a nasty tendency to forget where it is, so when you try to address a variable, it has somehow disappeared. This is especially true with anonymous functions called through events.

Have you tried _root.bar_mc.bar.width?

Christopher W. Allen-Poole
yes I tried it. Tks
Mango