package components.Tools
{
import mx.core.UIComponent;
import flash.display.Sprite;
public class BannerRect extends UIComponent{
public var tl:BannerBox; public var bl:BannerBox; public var tr:BannerBox; public var br:BannerBox; public var mr:BannerBox; public var ml:BannerBox; public var mt:BannerBox; public var mb:BannerBox;
public function BannerRect(){
new Sprite();
tl = new BannerBox(); tl.name = 'tl';
bl = new BannerBox(); bl.name = 'bl';
tr = new BannerBox(); tr.name = 'tr';
br = new BannerBox(); br.name = 'br';
ml = new BannerBox(); ml.name = 'ml';
mr = new BannerBox(); mr.name = 'mr';
mt = new BannerBox(); mt.name = 'mt';
mb = new BannerBox(); mb.name = 'mb';
this.addChild(tl);
this.addChild(bl);
this.addChild(tr);
this.addChild(br);
this.addChild(ml);
this.addChild(mr);
this.addChild(mt);
this.addChild(mb);
redraw(1, 1);
}
public function redraw(w:Number, h:Number):void{
this.graphics.clear();
this.graphics.lineStyle(1, 0x33ffff, 1.0); this.graphics.beginFill(0xaaffff, 0.1); this.graphics.drawRect(-4, -4, w+8, h+8);
this.graphics.endFill();
tl.x = -6;
tl.y = -6;
bl.x = -6;
bl.y = 3+h;
tr.x = 1 + w;
tr.y = -6;
br.x = 1 + w;
br.y = 3 + h;
ml.x = -6;
ml.y = h/2;
mr.x = 1 + w;
mr.y = h/2
mt.x = w/2 - 3;
mt.y = -6;
mb.x = w/2 - 3;
mb.y = 3 + h;
}
}
}