Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 将.BMP文件加载到stage AS3_Actionscript 3 - Fatal编程技术网

Actionscript 3 将.BMP文件加载到stage AS3

Actionscript 3 将.BMP文件加载到stage AS3,actionscript-3,Actionscript 3,我需要将BMP文件导入到后台,我尝试使用URLLoader和filestream,但不行,有办法吗 这就是我尝试的,使用jpg它可以工作: var loader:Loader = new Loader(); loader.load(new URLRequest("foto.bmp")); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler); function onCompleteHandler

我需要将BMP文件导入到后台,我尝试使用URLLoader和filestream,但不行,有办法吗

这就是我尝试的,使用jpg它可以工作:

var loader:Loader = new Loader();
loader.load(new URLRequest("foto.bmp"));
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);

function onCompleteHandler(event:Event):void 
{
  event.target.removeEventListener(Event.COMPLETE, onCompleteHandler);
  addChild(event.target.content);
}

处理程序是否未被调用(即已调度事件)或DisplayObject是否为空?Flash Player不支持开箱即用位图(仅支持jpg、gif、png、swf)-您可以加载二进制数据并对其进行处理-做了大量工作,但已经有了库:我在上面的评论中将其标记为链接的副本。两个链接中关于这个问题的解决方案就是您所需要的。