try this if you havent yet:
var childCanvas: Canvas = new Canvas();
var t:Text= new Text();
t.text="this is a circle";
t.x=220;
t.y=140;
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";
childCanvas.addChild(t);
mainCanvas.addChild(childCanvas);
--- Guy Morton <[EMAIL PROTECTED]> wrote:
> 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
>
>
____________________________________________________________________________________
Cheap talk?
Check out Yahoo! Messenger's low PC-to-Phone call rates.
http://voice.yahoo.com