2009-10-09 79 views
0

我在加載程序中遇到了兩個問題,bar「bar」不增加,mc_home獲取位置y = 0,無論我在哪裏放置pages_mc或它們的位置pages_mc._y = 100;Flash動作預加載器問題actionscript2.0

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(); 

回答

0

有時AS2有一個討厭的趨勢忘記它在哪裏,所以當你試圖解決一個變量,它莫名其妙地消失了。通過事件調用的匿名函數尤其如此。

你試過_root.bar_mc.bar.width

+0

是的,我試過了。 TKS – Mango 2009-10-09 19:10:14