> danfrap767

Have you been reading my posts? From the thread it dosn't look like you are seeing them or something.

You need to create a skin class from ProgrammaticSkin.

Subclass it.

Peace, Mike


On 8/11/06, danfrap767 < [EMAIL PROTECTED]> wrote:

I thought so too, as it even says in the addChild for a Canvas
documentation that it takes a display object.

but for some reason when I test and after attaching the canvas I then
attach the sprite I still get that same error:



"TypeError: Error #1034: Type Coercion failed: cannot convert
flash.display::[EMAIL PROTECTED] to mx.core.IUIComponent."

Why would it try to convert that?

this is the bit of code from the function , and the drawn bg and the
button show up totally fine.

contentBg = new Canvas();
contentBg.graphics.beginFill(0xFF0000);
contentBg.graphics.lineStyle(2, 0xFFFFFF);

contentBg.graphics.drawRoundRect(0, 0, 150, 400, 10, 10);
contentBg.graphics.endFill();
addChild(contentBg);

changeButton = new Button();
changeButton.label = returnData.buttons.button.label;
changeButton.move(30, 30);
changeButton.addEventListener(MouseEvent.CLICK, someFunction);
contentBg.addChild(changeButton);

mySprite = new Sprite();
mySprite.graphics.beginFill(0xFFFFFF);
mySprite.graphics.drawRoundRect(300, 0, 150, 400, 10, 10);
mySprite.graphics.endFill();
contentBg.addChild(mySprite);

any ideas?


--- In flexcoders@yahoogroups.com, "dadrobson" <[EMAIL PROTECTED]> wrote:
>
> You should be able to use Canvas.addChild(Sprite), because it takes a
> DisplayObject, and Sprite does exted DisplayObject.
>
> I don't have time to test it right now, but based on the inheritance
> outlined in the docs, it looks like it should work. I'll try to run a
> test later; meanwhile, if you have a chance to test it, please let me
> know what you learn.
>
> -Jim
>




--
What goes up, does come down. __._,_.___

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




__,_._,___

Reply via email to