A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: from external loaded image to bitmapdata?

  1. #1
    Ronze Ronze's Avatar
    Join Date
    Oct 2002
    Copenhagen, Denmark

    [RESOLVED] from external loaded image to bitmapdata?

    Hey again

    I have looked around the forum for a while, but haven't found an answer...
    I am loading an external JPG using the Loader class.

    And I have this code, that can be used to make a tiled background:
    var backGroundSprite:Sprite = new Sprite();
    backGroundSprite.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
    I have tried converting the loaded image into a bitmapdata object, but I just can't figure it out. How do I do this?

    *************** edit*************
    I figured it out with the help of the Flash CS3 help, under the "Bitmap" class:

    var image:Bitmap = Bitmap(myloader.content);
    var bitmapData:BitmapData = image.bitmapData;
    Last edited by Ronze; 09-09-2007 at 12:47 PM.
    --- Ronze ---

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center