开发者

Preloader problem in flash actionscript2.0

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):V开发者_Go百科oid {
   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();


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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜