Patrick,

But what if "myComponent" type has to be Bitmap? How can I add it then
to my container?

Thanks,
Mark

--- In [email protected], {reduxdj} <[EMAIL PROTECTED]> wrote:
>
> Mark:
> 
> 
> Instantiate a new UIComponent then try:
> 
> import mx.controls.UIComponent;
> 
> ...
> 
> 
>     var myComponent:UIComponent = new UIComponent();
>  
>     (blah blah blah - Your code here then don't forget to add that 
> component to the display list)     
> 
> 
>         addChild(myComponent);
> 
> This should fix your problem, hope this helps,
> 
> Patrick
> 
> 
> 
> Mark Piller wrote:
> >
> > I am experiencing a difficulting adding a Bitmap to a container using
> > the addChild() method. The error i get is:
> >
> > TypeError: Error #1034: Type Coercion failed: cannot convert
> > flash.display::[EMAIL PROTECTED] to mx.core.IUIComponent.
> >
> > The error actually makes sense since flash.display.Bitmap does not
> > implement IUIComponent, which aparently is required, since the doc for
> > mx.core.Container.addChild says:
> >
> > "Note: While the child argument to the method is specified as of type
> > DisplayObject, the argument must implement the IUIComponent interface
> > to be added as a child of a container. All Flex components implement
> > this interface."
> >
> > However, the documentation for the Bitmap class states the following:
> >
> > "The Bitmap() constructor allows you to create a Bitmap object that
> > contains a reference to a BitmapData object. After you create a Bitmap
> > object, use the addChild() or addChildAt() method of the parent
> > DisplayObjectContainer instance to place the bitmap on the display
list."
> >
> > Anyone has any idea what's going on with this? Is the documentation
> > incorrect? Has anyone been able to add Bitmap to the display list?
> >
> > Thanks,
> > Mark
> >
> >
>


Reply via email to