Use graphics from Sprite to draw circle : Sprite « Development « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Development » SpriteScreenshots 
Use graphics from Sprite to draw circle
Use graphics from Sprite to draw circle
         

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
    import flash.display.Sprite;
    import mx.core.UIComponent;
    
    private function addChildToPanel():void {
        var circle:Sprite = new Sprite();
        circle.graphics.beginFill(0xFFFF00);
        circle.graphics.drawCircle(02020);
        var c:UIComponent = new UIComponent();
        c.addChild(circle);
        panel1.addChild(c);
    }
  </mx:Script>
    <mx:Panel id="panel1" height="100" width="100" />
    <mx:Button id="myButton" label="Click Me" click="addChildToPanel();" />
</mx:Application>

   
    
    
    
    
    
    
    
    
  
Related examples in the same category
1.Creates a new Sprite objectCreates a new Sprite object
ww_w___.___j_a___va__2s__._c__o_m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.