急~~~~!!!在flash里设置loading条问题

来源:百度知道 编辑:UC知道 时间:2024/06/08 08:09:01
请问怎么在flash里设置loading条?是否需要加AS代码??

这种要视情况而定的 如果你是真的想设置一个读取文件的loading 那么是需要加一段AS代码的
AS2以前代码是比较麻烦的。
大概是这样
byteloaded = _root.getBytesLoaded();
bytetotal = _root.getBytesTotal();
loaded = int(byteloaded /bytetotal * 100);
t = getTimer ();
percent = loaded + "% ( " + int(byteloaded/1000) + " K / " + int(bytetotal/1000) + " K )";
percent = percent + "下载速度:" + int(byteloaded/t) + " K/s";
load_bar.gotoAndStop( loaded );
timeloaded = int(t/1000);
timeremain = int(timeloaded * (bytetotal- byteloaded) / byteloaded);
timeremain = int(timeremain / 60) + "分''''" + int(timeremain % 60) + "秒"";
timeloaded = int(timeloaded / 60) + "\''''" + int(timeloaded % 60) + "\"";
downloadtime = "已用时间:" + timeloaded + "剩余时间:" + timeremain;

AS3只需要加一小段就可以了
var request: URLRequest = new URLRequest( "f