Actionscript Draw Box
1 2 function draw_box(w,h,c){ 3 var new_box = this.createEmptyMovieClip("new_box", this.getNextDepth()); 4 new_box.beginFill(c); 5 new_box.lineStyle(0,0x000000,0); 6 new_box.moveTo(0, 0); 7 new_box.lineTo(w, 0); 8 new_box.lineTo(w, h); 9 new_box.lineTo(0, h); 10 new_box.lineTo(0, 0); 11 new_box.endFill(); 12 return new_box; 13 } 14
Sample function call draws a 200w x 25h pixel, black box:
1 2 draw_box(200,25,0x000000);