Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Eksterni jpg iz xml-a

[es] :: Flash :: Eksterni jpg iz xml-a

[ Pregleda: 1396 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

deepwhite

Član broj: 92996
Poruke: 559
212.200.70.*



+3 Profil

icon Eksterni jpg iz xml-a03.08.2009. u 23:44 - pre 178 meseci
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);
    }
}
 
Odgovor na temu

deepwhite

Član broj: 92996
Poruke: 559
212.200.70.*



+3 Profil

icon Re: Eksterni jpg iz xml-a04.08.2009. u 08:58 - pre 178 meseci
Resio sam:

parsiranje nije dobro odradjeno, trebalo je ovako
Code:

var imageURLRequest:URLRequest=new URLRequest(myxml.img.pic);
 
Odgovor na temu

[es] :: Flash :: Eksterni jpg iz xml-a

[ Pregleda: 1396 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.