I think what you want to do is create a new UIComponent (in this case, a graphics object), and then call addChild to add it to the display list (so it will show up). Hopefully, this example will get you started:
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundImage="@Embed('../resources/bird.gif')"> <mx:Script><![CDATA[ import flash.display.Graphics; import mx.core.UIComponent; import mx.graphics.RectangularDropShadow; public function drawSomething():void { var circle:UIComponent = new UIComponent(); var xPos:Number = 100; var yPos:Number = 100; var radius:Number = 50; circle.graphics.beginFill(0xFF8800); circle.graphics.drawCircle(xPos, yPos, radius); addChild(circle); } ]]></mx:Script> <mx:Button label="Click Me" id="b1" click="drawSomething()"/> </mx:Application> hth, matt horn flex docs > -----Original Message----- > From: flexcoders@yahoogroups.com > [mailto:[EMAIL PROTECTED] On Behalf Of mudwump_vx > Sent: Wednesday, July 05, 2006 10:49 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Mixing and image and shapes > > I am a newbie at Flex, Flash and ActionScript, so please bear > with me. I am trying to mix a background image (loaded via > <mx: Image>) with placing a scalable circle on top of the > image using ActionScript, but I can not figure out how to do > this after two days of going through the documentation. I can > get the image on the canvas just fine, but I am wrapped up > trying to figure out how to incorporate the drawcircle(). I > know it must be simple, but I can't figure out the right combination. > Can anyone help me? Thanks ahead of time. > > > > > ------------------------ Yahoo! Groups Sponsor --------------------~--> Check out the new improvements in Yahoo! Groups email. http://us.click.yahoo.com/6pRQfA/fOaOAA/yQLSAA/nhFolB/TM --------------------------------------------------------------------~-> -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/