0){ g.removeElementAt(0); } } for(i = 0; i < numItems; ++i){ switch (j++){ case 0: g.addElement(new TestRect1()); break; case 1: g.addElement(new TestBitmapGraphic1()); break; case 2: g.addElement(new TestTextBox1()); break; case 3: g.addElement(new TestButton1()); j = 0; break; } } } /** * This will set a property for all items in a group. * g: The Group to work with. * prop: The property. * val: The value. **/ public function setPropsOnGroupElements(g:Group, prop:String, val:*):void{ var i:int; var curItem:*; for(i = 0; i < g.numElements; ++i){ curItem = g.getElementAt(i); curItem[prop] = val; } } /** * This will set a property for one item in a group. * g: The Group to work with. * prop: The property. * val: The value. * idx: The index of the item to change. **/ public function setPropOnOneGroupElement(g:Group, prop:String, val:*, idx:int):void{ g.getElementAt(idx)[prop] = val; } /** * This will remove items from a group. * g: The Group to work with. * numItems: The number of items to remove. * clean: Whether to remove all items from the Group, ignoring numItems. Defaults to false. **/ public function removeItemsFromGroup(g:Group, numItems:int, clean:Boolean = false):void{ var i:int; if(clean){ while(g.numElements > 0){ g.removeElementAt(0); } }else{ i = 0; while(i++ < numItems){ g.removeElementAt(0); } } } ]]> @namespace s "library://ns.adobe.com/flex/spark"; @namespace mx "library://ns.adobe.com/flex/mx"; @font-face { src: url("../../../../../Assets/Fonts/Cousine/Cousine-Regular.ttf"); fontFamily: EmbeddedArno; embedAsCFF: true; } s|Button{ fontFamily: EmbeddedArno; fontLookup: embeddedCFF; fontAntiAliasType: normal; } s|Label{ fontFamily: EmbeddedArno; fontLookup: embeddedCFF; fontAntiAliasType: normal; } global{ kerning: "off"; }