所以我有一個假預載器去...並不實際預載,但只是做'行動'。我的問題得到100%太快。由於它沒有真正加載任何東西,我如何減慢速度,所以它需要3秒「完成加載」?使假預載器移動得更慢
的代碼如下..
function onEnterFrame(){
// Calcules the max width value of the line
maxWidth = _x*2;
loaded = (_root.getBytesLoaded()/_root.getBytesTotal())*100;
// Percentage to output on the percentage textbox
per = Math.round(loaded) + "%";
// Clear this movieclip for drawing
this.clear();
// Draw the white line:
this.lineStyle(1,backLineColor,100);
this.moveTo(0,0);
this.lineTo(Math.abs(Stage.width-maxWidth),0);
// Draws the black line
this.lineStyle(1,frontLineColor,100);
this.moveTo(0,0);
this.lineTo(Math.abs((Stage.width-maxWidth)*(loaded/100)),0);
我在我的回覆中添加了假加載條的代碼,您可以測試。應該很容易嘗試。 – paul 2012-04-02 21:20:04