hey i want to have a background grid so i came up with this:
this.createEmptyMovieClip("bg", 9999);
bg._visible = true;
var startHeight:Number = 4;
var startWidth:Number = 4;
function drawBG() {
//bg.beginFill(0xffffff, 0);
bg.lineStyle(1, 0x0F0F0F, 100);
bg.moveTo(0, startHeight);
bg.lineTo(Stage.width, startHeight);
startHeight = startHeight+4;
bg.endFill();
if (startHeight>=Stage.height) {
clearInterval(drawBGInterval);
drawBGInterval = setInterval(drawBGvertical, 1);
}
}
function drawBGvertical() {
//bg.beginFill(0xffffff, 0);
bg.lineStyle(1, 0x0F0F0F, 100);
bg.moveTo(startWidth, 0);
bg.lineTo(startWidth, Stage.height);
startWidth = startWidth+4;
bg.endFill();
if (startWidth>=Stage.width) {
clearInterval(drawBGInterval);
bg._visible = true;
}
}
drawBGInterval = setInterval(drawBG, 1);
it does what i want but isnt efficient… any thoughts? i dont mind losing the draw thing it can just appear.Another thing, it has to appear behind everything and must be redrawn everytime someone resizes the stage…
i would really appreciate some help