Thanks JesterXL, I replaced: loader.load(request); mainVBox.addChild(loader);
-with- loader.load(request); var uic:UIComponent = new UIComponent(); mainVBox.addChild(uic); uic.addChild(loader); I do not get any runtime errors and best of all, the image renders correctly. Just curious, is this is how I should handle this or is this a bug with Flex2/AS3? Thanks again. Best Regards- --- In [email protected], "JesterXL" <[EMAIL PROTECTED]> wrote: > > I can't remember how Manish said to get around this. > > Here's some things to try util I get corrected: > - try attaching to Canvas instead > - create a blank UIComponent, addChild, and then add the bitmap to the blank > UIComponent > - case the bitmap to IUIComponent: > > var b:IUIComponent = IUIComponent(data); > > ----- Original Message ----- > From: "solgraphics" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Wednesday, December 21, 2005 12:18 PM > Subject: [flexcoders] Re: Flex 2 --> flash.display.Loader -- addChild bug? > > > Yeah, below is the error. > > > TypeError: Error #1034: Type Coersion failed: cannot convert > flash.display::[EMAIL PROTECTED] to mx.core.IUIComponent > at > mx.containers::Tile/http://www.macromedia.com/2005/flex/mx/internal::findCellSize() > at mx.containers::Tile/measure() > at mx.core::UIComponent/UIComponent$480$private::measureSizes() > at mx.core::UIComponent/validateSize() > at mx.core::Container/validateSize() > at mx.managers::LayoutManager/validateSize() > at > mx.managers::LayoutManager/LayoutManager$1689$private::doPhasedInstantiation() > at mx.core::UIComponent/UIComponent$480$private::callLaterDispatcher2() > at mx.core::UIComponent/UIComponent$480$private::callLaterDispatcher() > > > --- In [email protected], "JesterXL" <[EMAIL PROTECTED]> wrote: > > > > What is the error you are getting? Is it yelling it's not a > UIComponent? > > > > ----- Original Message ----- > > From: "solgraphics" <[EMAIL PROTECTED]> > > To: <[email protected]> > > Sent: Wednesday, December 21, 2005 10:28 AM > > Subject: [flexcoders] Flex 2 --> flash.display.Loader -- addChild bug? > > > > > > I am trying to use the flash.display.Loader class because I want to > > use images that are stored in a db as a hex string. I can bring in the > > hex string and create the ByteArray fine using > > flash.display.Loader.loadBytes(), but when I addChild the Loader to > > the application I get an error. Is this because I am doing it wrong, > > or is there a bug with flash.display.Loader? One thing to note is that > > I can do this with an AS3 project no problem based on the > > flash.display.Loader examples and loading via .loadBytes(). > > > > I have included some code that grabs an image off the web and doesn't > > use a ByteArray, but the error is the same here too. > > > > > > > > <?xml version="1.0" encoding="utf-8"?> > > <mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" > > xmlns="*" > > creationComplete="init();"> > > > > <mx:Script> > > <![CDATA[ > > import flash.display.Loader; > > import flash.events.*; > > import flash.net.URLRequest; > > > > > > private function init():Void > > { > > var loader:Loader = new Loader(); > > configListeners(loader); > > > > var request:URLRequest = new > > URLRequest("http://weblogs.macromedia.com/mxna/images/logo.gif"); > > > > loader.load(request); > > > > mainVBox.addChild(loader); > > } > > > > private function configListeners(dispatcher:IEventDispatcher):Void > > { > > dispatcher.addEventListener(EventType.COMPLETE, onComplete); > > } > > > > > > private function onComplete(event:Event):Void { > > trace("onComplete: " + event); > > } > > > > > > > > ]]> > > </mx:Script> > > > > > > <mx:Panel id="mainPanel" title="Loader Test"> > > <mx:VBox id="mainVBox" width="100%" height="100%"> > > > > </mx:VBox> > > </mx:Panel> > > > > > > </mx:Application> > > > > > > > > > > > > > > > > > > -- > > 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 > > > > > > > > > > -- > 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 > ------------------------ Yahoo! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/nhFolB/TM --------------------------------------------------------------------~-> -- 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 <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

