• ActionScript, Tutorials

    Posted on November 21st, 2009

    Written by Behrouz Pooladrag

    Tags

    , , , , ,
    Sample BitmapData and Images

    In AS3, you must give objects in the library class association in order to instantiate them with AS. If you don’t have a class for your bitmap (ie you don’t need to extends BitmapData with more methods) then you can type in a class name and Flash will automatically create one for you which will extend BitmapData. Than you just call that classes constructor, assign the instance to a variable and tile it:

    import flash.display.BitmapData;
    var tile:BitmapData = new MyImage();
    this.graphics.beginBitmapFill(tile);
    this.graphics.lineTo(this.stage.stageWidth, 0);
    this.graphics.lineTo(this.stage.stageWidth, this.stage.stageHeight);
    this.graphics.lineTo(0, this.stage.stageHeight);
    this.graphics.lineTo(0, 0);
    this.graphics.endFill();
    This entry was posted on Saturday, November 21st, 2009 at 12:26 am and is filed under ActionScript, Tutorials. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
  • 0 Comments

    Take a look at some of the responses we've had to this article.

  • Post a Comment

    Let us know what you thought.

  • Name:

    Email (required):

    Website:

    Message: