Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load dynamic image from xml

Status
Not open for further replies.

guitardave78

Programmer
Sep 5, 2001
1,294
GB
hi guys. I got a bit of action script tat reads an xml and sets up a load of variabls
one of these variables holds a url to an image
Using the load movie function i want to use this url to load an image
i keep getting this error

"file:///C|/inetpub/
so it looks like it can't read the variable properly, yet in a dynamic text box teh variable says the correct url
here s my code, can yoy help?
the empty movi clicp is instance name img

var contentXML = new XML();
contentXML.ignoreWhite = true;
contentXML.onLoad = processContent;
contentXML.load("content.xml");
xmlfeed = "Loading";
function processContent(success) {
rootHandler = this.childNodes;
nodeHandler = rootHandler[0].childNodes;
if (nodeHandler[0].nodeName == "member") {
for (var i = 0; i<nodeHandler.length; i++) {
childHandler = nodeHandler.childNodes;
name = childHandler[0];
rank = childHandler[1];
loc = childHandler[2];
real = childHandler[3];
age = childHandler[4];
image = childHandler[5].attributes.url;
details = childHandler[6];
}
}
}
img.loadMovie(image);
stop();
 
well assuming that _level0.image is the name of the file (seems unlikely but you never know) then you still have to add the file extension.

this will have to be either image.jpg or image.swf

what exactly do you get in the text box when you send the variable there.

You know you're old if you can remember when bacon, eggs and sunshine were good for you
 
i sorted it the call for the image had to be befor the the end of the function!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top