我正在使用代码从该页面http://www.flashandmath.com/howtos/zoom/进行缩放和平移。它工作正常,但是当尝试加载 3201X 2451 像素的图像时,它不起作用。
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,initPic);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,updateInfo);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,imagenError);
loader.load(new URLRequest("simbologia.png"));
function updateInfo(e:ProgressEvent):void {
infoBox.text="Loading: "+String(Math.floor(e.bytesLoaded/1024))+" KB of "+String(Math.floor(e.bytesTotal/1024))+" KB.";
trace(e);
}
输出是:
[ProgressEvent type="progress" bubbles=false cancelable=false eventPhase=2 bytesLoaded=0 bytesTotal=486441]
[ProgressEvent type="progress" bubbles=false cancelable=false eventPhase=2 bytesLoaded=65536 bytesTotal=486441]
[ProgressEvent type="progress" bubbles=false cancelable=false eventPhase=2 bytesLoaded=131072 bytesTotal=486441]
[ProgressEvent type="progress" bubbles=false cancelable=false eventPhase=2 bytesLoaded=196608 bytesTotal=486441]
[ProgressEvent type="progress" bubbles=false cancelable=false eventPhase=2 bytesLoaded=262144 bytesTotal=486441]
[ProgressEvent type="progress" bubbles=false cancelable=false eventPhase=2 bytesLoaded=327680 bytesTotal=486441]
[ProgressEvent type="progress" bubbles=false cancelable=false eventPhase=2 bytesLoaded=393216 bytesTotal=486441]
[ProgressEvent type="progress" bubbles=false cancelable=false eventPhase=2 bytesLoaded=458752 bytesTotal=486441]
[ProgressEvent type="progress" bubbles=false cancelable=false eventPhase=2 bytesLoaded=486441 bytesTotal=486441]
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,initPic); never 被调用或执行,我认为程序正在冻结。任何想法?提前致谢。