• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

outputting bitmap path from xml file

Participant ,
Nov 21, 2008 Nov 21, 2008

Copy link to clipboard

Copied

You guys have been great for helping me solve problems!

I have another.

I have an xml file that includes image paths.

I'd like to read that image path from the xml and display the image (a jpg or gif) on the stage.

However, when I trace image_path from my xml file, the result seems to knock off the "http:" part of the node.

Also, when I load the image, the loader ends up being null (maybe this is because I didn't set up an event handler for it).

Can anyone point me in the right direction?
TOPICS
ActionScript

Views

373

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 22, 2008 Nov 22, 2008

Copy link to clipboard

Copied

LATEST
Hard to tell what might be wrong with the xml part of the problem, without seeing the xml. With loaders you would normal set an event listener to then do things with it after it's loaded. Like this:

var _loader:Loader = new Loader();
_loader.contentLoaderInfo.addEventListener (Event.COMPLETE,imageloaded)
_loader.load(new URLRequest(myXML.myNode.image_path ));


function imageloaded(e:Event){
trace(_loader.content);
}

I don't think _loader will have any content until the loading is complete.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines