Some odd problem with my loader…
hello everybody. I am trying to have a page for displaying some products on a website. The product display application is based on a tutorial which achieves a very nice app but the code actually sucks… I tried re-structuring the code but a lot of problems happened so I decided to edit the code anyway… What I’m trying to do is that when I click on the "More" button in the product display app, the image of the product should be loaded into some movieclip and the description should be loaded into a dynamic text field. The link to the image and the description is inside a XML file. Everything is working fine except loading the image… I keep getting the following errors:
Code:
Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::LoaderInfo@2125f3a1 to flash.display.DisplayObject.
at MethodInfo-373()Here’s the code responsible of loading the info, description and the image:
ActionScript Code:
function fData(item:MovieClip, iValue:int) { item.txt.text=data_xml.item[iValue].title; item.price.text=data_xml.item[iValue].price; var specsText = data_xml.item[iValue].specs; thumbURL = new URLRequest(data_xml.item[iValue].big); item.more.addEventListener(MouseEvent.CLICK, gotoURL);//event listener for more btn function gotoURL(e:MouseEvent):void {function MovieClip(root).content.offersPage.offersPopup.specs.text = specsText; ldr = new Loader(); ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded); ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError); ldr.load(thumbURL); } function thumbLoaded(e:Event):void { MovieClip(root).content.offersPage.offersPopup.thumbOffers.addChild(e.currentTarget); } function onIOError(e:IOErrorEvent):void { trace(e); }
any suggestions?
Original post by Striker9099