Creating an Item Renderer : Controls : Graphics Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Graphics » Controls »

 

Creating an Item Renderer


 
package
{
    import flash.display.Sprite;
    import flash.text.TextField;
    public class Main extends Sprite
    {
        private var array:Array = ["one""two""three""four""five"];
    
        public function Main()
        {
            super();
            for(var i:int 0; i < array.length; i++)
            {
                var spr:Sprite = new Sprite();
    
                spr.graphics.beginFill(0x8800881);
                spr.graphics.drawRect(0010030);
                spr.graphics.endFill();
    
                var txt:TextField = new TextField();
    
                txt.text = String(array[i]);
    
                spr.addChild(txt);
    
                addChild(spr);
    
                spr.y = i * 32;
            }
        }
    }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Graphics
» Controls