What do I need to do to add a SimpleButton to my component without getting the type coercion error above?  The code I'm using is taken directly from the docs and it's pasted below.  The parent component is an HBox.

...

        import flash.display.*;

        private function doInit():void
        {
             var myButton:SimpleButton = new SimpleButton();
             var downSprite:Sprite = new Sprite();
             downSprite.graphics.lineStyle(2, 0x202020);
             downSprite.graphics.beginFill(0x00FF00);
             downSprite.graphics.drawRect(10, 10, 50, 50);
             
             var upSprite:Sprite = new Sprite();
             upSprite.graphics.lineStyle(2, 0x202020);
             upSprite.graphics.beginFill(0xFFFF00);
             upSprite.graphics.drawRect(10, 10, 50, 50);
             
             myButton.upState = upSprite;
             myButton.overState = upSprite;
             myButton.downState = downSprite;
             myButton.useHandCursor = true;
             myButton.hitTestState = this;
             
             this.addChild( myButton );
}

...


--
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




Reply via email to