ActionScript BitmapData Built-in To Bitmaps?

Posted by TheDarkIn1978 on Stack Overflow See other posts from Stack Overflow or by TheDarkIn1978
Published on 2010-05-25T22:07:31Z Indexed on 2010/05/25 22:11 UTC
Read the original article Hit count: 267

Filed under:
|
|

i've used a Loader and URLRequest to download a .png from the internet and add it to my display list. since it's already a bitmap, does it have built in bitmap data already? or do i have to create the bitmap data myself?

also, why does the same trace statement return false in the mouseMoveHandler when it outputs true in the displayImage function?

    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'
     }

© Stack Overflow or respective owner

Related posts about actionscript-3

Related posts about bitmap