> <mx:Script>
> <![CDATA[
>
> public class GraphicsExample extends Sprite {
Can't have a class in the Script block. Must move outside to its own .as file.
> <mx:Button label="Search" labelPlacement="bottom"
> click="GraphicsExample.doDrawCircle()"/>
If I understand correctly, you want to add this object to the display
list and then have it draw itself. Right?
Here's the code in the click handler:
var obj:DisplayObject = new GraphicsExample();
var wrapper:UIComponent = new UIComponent();
addChild(wrapper);
wrapper.addChild(obj);
obj.doDrawCircle();
Note: your 'doDrawCircle' is an instance method, so it can only be
called on an *instance* of the class.
Hope that helps.
Manish
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
| Web site design development | Computer software development | Software design and development |
| Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

