1. Sprite is both a DisplayObjectContainer and a DisplayObject.
2. A DisplayObjectContainer (like Application) has the function
addChild(child:DisplayObject):DisplayObject.

Thus I should be able to call addChild and pass it a Sprite.  However
I can't and I get the error "TypeError: Error #1034: Type Coercion
failed: cannot convert flash.display::[EMAIL PROTECTED] to
mx.core.IUIComponent."

So it seems that the documentation and/or the implementation is wrong?
 You should be able to pass a sprite into addChild?  Maybe I made a
typo and just have not caught it?

Here is the app used to produce the error:

<?xml version="1.0" encoding="utf-8"?><mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute"
creationComplete="init()">

      <mx:Script>

            <![CDATA[

            internal function init(): void

            {

                  this.addChild(new Sprite());              

            }

            ]]>

      </mx:Script>

</mx:Application>

I have seen several examples use this same call, I can fix it by using
a class that is derived from Sprite and IUIComponent.

Mike Power

Reply via email to