我已经使用Loader和URLRequest从互联网下载.png并将其添加到我的显示列表中。既然它已经是位图了,它是否已经内置位图数据了?或者我必须自己创建位图数据?ActionScript位图数据内置于位图?
此外,为什么当它在displayImage函数中输出true时,同一个trace语句在mouseMoveHandler中返回false?
var imageLoader:Loader = new Loader();
imageLoader.load(new URLRequest("http://somewebsite.com/image.png"));
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, displayImage);
function displayImage(evt:Event):void
{
addChild(evt.target.content);
addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
trace(evt.target.content is Bitmap); //outputs 'true'
}
function mouseMoveHandler(evt:MouseEvent):void
{
trace(evt.target.content is Bitmap); //outputs 'false'
}
ouf。这是一个非常愚蠢的问题。我怪热。 ;) – TheDarkIn1978 2010-05-25 23:52:31