Actionscript 3 预加载程序未运行
我正在尝试使用百分比运行预加载程序,但它没有在动态文本中显示百分比,请任何人提供解决方案Actionscript 3 预加载程序未运行,actionscript-3,actionscript,flashdevelop,Actionscript 3,Actionscript,Flashdevelop,我正在尝试使用百分比运行预加载程序,但它没有在动态文本中显示百分比,请任何人提供解决方案 import flash.events.ProgressEvent; import flash.events.Event; import flash.display.LoaderInfo; loaderInfo.addEventListener(ProgressEvent.PROGRESS, loading); function loading(e:ProgressEvent):void {
import flash.events.ProgressEvent;
import flash.events.Event;
import flash.display.LoaderInfo;
loaderInfo.addEventListener(ProgressEvent.PROGRESS, loading);
function loading(e:ProgressEvent):void
{
var Percent:Number = e.bytesLoaded/e.bytesTotal*100;
myText.text = Math.round(Percent)+"%";
if(Percent == 100)
{
loaderInfo.removeEventListener(ProgressEvent.PROGRESS, loading);
}
}
尝试替换
myText.text=Math.round(百分比)+“%”代码>带有跟踪(数学四舍五入(百分比)+“%”代码>。您在输出面板中看到100%了吗?(1)回答上面的评论,因为上面显示的代码不足以让我们测试您的问题(2)声明var百分比:Number=0代码>在任何函数之外和之前。然后将var更新为Percent=e.bytesLo。。。etc
(3)确保为文本字段嵌入字体