tags:

views:

158

answers:

1

How can I write curved text in my Flex application. I have a circle component in my application , divided into 4 sectors. My circle component is such that I have an outer circle and an inner circle, with a small gap between the two circles. Now I want to place the curved text in this gap for the four sectors, curving along with the circle.. How do I achieve this?

This is my circle component:

 package components
 {
  import mx.core.UIComponent;
  public class MyCircle extends UIComponent
  {
       public var x1:int; 
          public var y1:int; 
          public var radius:int; 
         public var myText:String = "curve text test";

     override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void 
     { 
         graphics.beginFill(0xDDDDDD);
       graphics.lineStyle(1, 0x000000);
       graphics.drawCircle(x1, y1, radius); 

       graphics.beginFill(0xDDDDDD);
       graphics.lineStyle(1, 0x000000);
       graphics.drawCircle(x1, y1, radius-40); 

       graphics.beginFill(0xFFFFFF);
       graphics.lineStyle(1, 0x000000);
       graphics.drawCircle(x1, y1, radius-100);
     }
    }
   }

In the main mxml file I create the circle with this code:

  <mx:VBox id="cle" label="Currents Quote" width="100%"> 

 <comp:MyCircle  x1="175" y1="150" radius="140" 
                    mouseDown="handleMouseDown(event);"/>          

 <comp:MyLine x1="175" y1="104"/> 
  </mx:VBox>

THe text "curve text test" should be written along th ecurve of the circle. Some one guide me..

+1  A: 

There are lots of great examples of how to do this on the web. Google is your friend.

Simon