I'm trying to run a small piece of code here.........however its giving me an error # 1034. I'm also pasting the instrustions.......plz...check and suggest.
the MXML part
<mx:LinkButton x="36" y="447" label="Circle" width="226" id="circle" click="drawCircle()"/>
the AS part
public function drawCircle():void
text1.visible = true;
text1.text = "HEllo"//myXML.child(IndexNumber).attribute("source");//.child.length;
var size:Number = 100;
var roundObject:Shape = new Shape();
// red circular shape
roundObject.graphics.moveTo(size / 2, 0);
roundObject.graphics.curveTo(size, 0, size, size / 2);
roundObject.graphics.curveTo(size, size, size / 2, size);
roundObject.graphics.curveTo(0, size, 0, size / 2);
roundObject.graphics.curveTo(0, 0, size / 2, 0);
Thanks and Regards........
Instead of adding a shape to the container, add the shape to a uicomponent. Then add that uicomponent to the container. Because when you are attempting to add a child to a mx.core.Container
the child must implement the interface mx.core.IUIComponent and the Shape class does not implements mx.core.IUIComponent. Here is the sample code.
var myShape:UIcomponent = new UIComponent();
Hope this helps
Or if you really want to add a Shape, then add it to the rawChildren of the application and not dirrectly to it ( that's why you are getting the error ). But as RUSH-ME said, it would be much better if you work with the Flex API and forget about how you used to do things in Flash.