Home > actionscript, flash > Draw A Quick Stage Border in Flash

Draw A Quick Stage Border in Flash

Here’s a quick way to automatically add a border to your flash stage without drawing an actual object and resizing it. I use this snippet alot.

1
2
3
4
var stagebox:Sprite = new Sprite();
stagebox.graphics.lineStyle(1, 0x000000, 1);
stagebox.graphics.drawRect(0, 0, stage.stageWidth-1, stage.stageHeight-1);
addChild(stagebox);
  1. March 12th, 2011 at 18:30 | #1

    var stagebox:Sprite = new Sprite();
    stagebox.graphics.lineStyle(1, 0×000000, 1);
    stagebox.graphics.drawRect(0, 0, stage.stageWidth-1, stage.stageHeight-1);
    addChild(stagebox);
    this.setChildIndex(stagebox,+1);

  1. No trackbacks yet.
*