Actually Tim, he already mentioned in a previous post that more than just to add a circle, he wanted to add a circle.. and rotate it to vertical. i have already suggested adding the text child directly to the canvas (main or child.. shouldnt really matter). However, i think what makes the text not render is the rotate action he is applying. I dunno, correct me if im wrong.. but you cant rotate text and have it render correctly like other visual stuff (basic shapes, etc) without embedding the font am i right?
--- Tim <[EMAIL PROTECTED]> wrote: > You should be able to do something like this: > > var myText:Text = new Text(); > myText.text = "Hello World"; > myText.x = 220; > myText.y = 140; > mainCanvas.addChild(myText); > > If you're just wanting to draw a shape, you should > use Sprite rather > than Canvas. Canvas is a container and is intended > to layout other > UIComponents - more than is needed just to draw a > circle. > > Tim > > --- In [email protected], "Tracy Spratt" > <[EMAIL PROTECTED]> wrote: > > > > You definitely can do that. > > > > > > > > addChild() is the method to use. > > > > > > > > I can't guess at what you are doing wrong without > seeing what you are > > doing. > > > > > > > > Tracy > > > > > > > > ________________________________ > > > > From: [email protected] > [mailto:[EMAIL PROTECTED] On > > Behalf Of Guy Morton > > Sent: Sunday, February 25, 2007 8:03 AM > > To: [email protected] > > Subject: [flexcoders] Dynamically creating a text > object > > > > > > > > Hello. I'm stumped. > > > > > > > > I'm creating some circles in AS and putting them > on a Canvas that's > > declared in my MXML file like so > > > > > > > > var childCanvas:Canvas = new Canvas(); > > > > childCanvas.graphics.lineStyle(1, 0x333333, 1); > > > > childCanvas.graphics.beginFill(0xCCCCCC,0.6); > > > > childCanvas.graphics.drawCircle(200,150,7); > > > > > childCanvas.graphics.endFill(); > > > > childCanvas.id = "myCircle"; > > > > childCanvas.toolTip = "I'm a circle"; > > > > > > > > mainCanvas.addChild(childCanvas); > > > > > > > > This all works fine. However, I want to add some > text next to the circle > > (with AS) and I can't see how to do it. I've tried > many ways and nothing > > worked. It seems I can't add an instance of a text > object as a child to > > the canvas in the same way that I can a shape. How > should I be doing > > this? > > > > > > > > Guy > > > > > ____________________________________________________________________________________ Expecting? Get great news right away with email Auto-Check. Try the Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html

