ローダーとURLRequestを使用して、インターネットから.pngをダウンロードし、ディスプレイリストに追加しました。すでにビットマップなので、ビットマップデータが組み込まれていますか?または、ビットマップデータを自分で作成する必要がありますか?
また、displayImage関数でtrueを出力するときに、同じトレースステートメントが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'
}