Is there a way to declare a collection of shapes in an array?
red, green, blue and gray are shape
my current code:
package {
public class rectangle extend Sprite {
import flash.display.*;
private var _tabRectangle:Array = [_red, _green, _blue, _gray];
public function rectangle() {
_createRectangles();
}
private function _createRectangles():void {
for(var i:int=0;i<_tabRectangle.length;i++) {
_tabRectangle* = new Shape();
_tabRectangle*.graphics.beginFill(0xFF0000);
_tabRectangle*.graphics.drawRect(0, 10*i, 50, 20);
_tabRectangle*.endFill();
}
}
}