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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2nd request - xml flash images not working

Status
Not open for further replies.

lyric

Programmer
May 31, 2000
3
US
I do not know what else to do here. Relatively new at flash (but experienced in other programming languages) and seriously stumped. I am making a jeopardy style game. I have the categories/points/questions/answers, etc. in an xml file. Everything works except for that an image can not be displayed in either the question or the answer box. I have read many tutorials, many posts, and have tried everything I can think of. I believe the problem lies somewhere with the array that is used for keeping track of points and my inability to incorporate anything in there. First the xml:

<?xml version = '1.0' encoding = 'utf-8'?>
<Jeopardy>
<category name = 'Blood'>
<first points = '100' answer = 'what is?'> image here </first>

<second points = '200' answer = '200 answer1'>except that it wont work </second>
<third points = '300' answer = '300 answer1'>300 question</third>
<fourth points = '400' answer = '400 answer1'>400 question</fourth>
<fifth points = '500' answer = '500 answer1'>500 question</fifth>
</category>
(and so on through 5 categories and final jeopardy.

here is the action script code:

//sets fullscren on startup
fscommand("fullscreen", "true");

//creates global variables
var points = 10;

var catigory = 10;
// final = 0 not time for final jeopardy, 1 = time for final jeopardy
var final = 0;

//var correct is to determine the final answers of the teams for the final round. default is

false because they are not right yet
var correct1 = false;
var correct2 = false;
var correct3 = false;
var correct4 = false;
var correct5 = false;
var correct6 = false;


jeopardy=new XML();
jeopardy.ignoreWhite=true;
jeopardy.load("jeopardy.xml");


//if the xml node jeopardy load was a success do the following
jeopardy.onLoad = function (success){

_root.cat1.points = _root.jeopardy.firstChild.childNodes[0].attributes.name;
_root.cat2.points = _root.jeopardy.firstChild.childNodes[1].attributes.name;
_root.cat3.points = _root.jeopardy.firstChild.childNodes[2].attributes.name;
_root.cat4.points = _root.jeopardy.firstChild.childNodes[3].attributes.name;
_root.cat5.points = _root.jeopardy.firstChild.childNodes[4].attributes.name;

for (i=0;i< 5;i++){
for (j=0;j<5;j++){

_root[""+i+j].points = _root.jeopardy.firstChild.childNodes

.childNodes[j].attributes.points;
}
}
}


 
In your example XML I don't see any image references?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top