Thanks for your reply
I tried that and I get the same error
TypeError: Error #1034: Type Coercion failed: cannot convert 
flash.display::[EMAIL PROTECTED] to mx.core.IUIComponent.
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; 
creationComplete="onComplete()">
 <mx:Script>
        <![CDATA[
           
            import mx.controls.Button
            public function onComplete():void
            {
                var newButton:SimpleButton = new SimpleButton();
                this.addChild(newButton);
            }
           
           
        ]]>
  </mx:Script>   
</mx:Application>
Battershall, Jeff wrote:
>
> I think you want to add mx.controls.Button which inherits from
> UIComponent vs. flash.display.SimpleButton, which does not. You're
> kinda confusing the Flex framework with the Flash Player API.
>
> Jeff
>
> -----Original Message-----
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> [mailto:flexcoders@yahoogroups.com 
> <mailto:flexcoders%40yahoogroups.com>] On
> Behalf Of [EMAIL PROTECTED] <mailto:info1%40reenie.org>
> Sent: Tuesday, October 23, 2007 12:45 PM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> Subject: [flexcoders] Simple SimpleButton 2nd try
>
> Please ignore the first post, this has a correction
>
> How do I add the button to the application?
> addChild does not seem to be available
> this->addChild(
>
> newButton); and addChild(newButton) both produce
> TypeError: Error #1034: Type Coercion failed: cannot convert
> flash.display::[EMAIL PROTECTED] to mx.core.IUIComponent.
>
> <?xml version="1.0"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml 
> <http://www.adobe.com/2006/mxml>
> <http://www.adobe.com/2006/mxml <http://www.adobe.com/2006/mxml>>" 
> creationComplete="onComplete()">
> <mx:Script> <![CDATA[
>
> import flash.display.SimpleButton
> public function onComplete():void
> {
> var newButton:SimpleButton = new SimpleButton();
> // add child here
> .
> }
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt 
> <http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt>
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com 
> <http://www.mail-archive.com/flexcoders%40yahoogroups.com>
> Yahoo! Groups Links
>
>  

Reply via email to