topical media & game development

talk show tell print

professional-flex-code-13-CircleLabel.ax

professional-flex-code-13-CircleLabel.ax [swf] flex


  package 
  {
    import mx.controls.Label;
  
    public class @ax-professional-flex-code-13-CircleLabel extends Label {
        
      public var circleColor:uint = 0x000000;
        
      public function @ax-professional-flex-code-13-CircleLabel(){
        super();
      }    
      override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
        super.updateDisplayList(unscaledWidth, unscaledHeight);
        // Draw a circle around the label text
        graphics.lineStyle(1, this.circleColor, 1.0); 
        graphics.drawEllipse(-5,-5,this.width+10,this.height+10);       
      }
    }
  }
  


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.