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 flexcoders@yahoogroups.com, "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: <flexcoders@yahoogroups.com> > 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 > ------------------------ Yahoo! Groups Sponsor --------------------~--> 1.2 million kids a year are victims of human trafficking. Stop slavery. http://us.click.yahoo.com/.QUssC/izNLAA/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/