[ deepwhite @ 03.08.2009. 23:44 ] @
Gde gresim pa dobijam: Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found. Code: import flash.events.Event; import flash.display.*; import flash.net.URLLoader; import flash.net.URLRequest; import flash.display.Loader; var loader:URLLoader = new URLLoader(); var req:URLRequest=new URLRequest("http://212.200.70.5/Sunset/testxy.xml"); loader.load(req); loader.addEventListener(Event.COMPLETE, onComplete); function onComplete(ev:Event):void { var myxml:XML=new XML(ev.target.data); myxml.ignoreWhitespace=true; var imageURLRequest:URLRequest=new URLRequest(myxml); var myImageLoader:Loader = new Loader(); myImageLoader.load(imageURLRequest); myImageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded); function imageLoaded(e:Event):void { var myBitmapData:BitmapData=new BitmapData(myImageLoader.width,myImageLoader.height); myBitmapData.draw(myImageLoader); var myBitmap:Bitmap=new Bitmap ; myBitmap.bitmapData=myBitmapData; myBitmap.width = 415; myBitmap.height = 315; myBitmap.y = -150; myBitmap.x = -150; addChild(myBitmap); } } |