Skip to main content
Inspiring
April 21, 2006
Answered

Plotting a clips on the stage, based off an XML

  • April 21, 2006
  • 1 reply
  • 159 views
Hi All,
I'm having a problem plotting a clip with AS2 onto the stage based off an XML. I think its looping thought the xml fine but for some reason its not plotting all the clips on the time line...

So what I'm trying to do is plot a clip on a line based off its <note_position> and <note_height> which it does just fine. But its not plotting all the <note> nodes... it plots 2 <note> clips from <line tName="Name-1" color="0x336633"> then it plots 1 <note>clips from <line tName="Name-2" color="0x333366"> then it plots 2 <note>clips from <line tName="Name-3" color="0x663366">

what it should do is plot all the <note>clips from <line tName="Name-1" color="0x336633"> then plot all the of the <note>clips from <line tName="Name-2" color="0x333366"> and last but not least plot all the of the <note>clips from <line tName="Name-3" color="0x663366">...

So all in all what it is doing is plotting 5 <note>clips in total in stead of the 10 <note> clips it should be plotting on the stage...

OK well I think I'm going to loos my mind... I no longer think its the looping thought the XML that is the problem. I think its either the way I'm attaching the plot clip or something I can't see thought the fog...

Any ideas? Ive been battaling this for the last two day and I'm at a total loss... so any help would be greatly apprecated...

Thank in advance
Scott :eek:

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer halcyon32
Ok I got this working here is my fix...

function attachXMLNodes () {
// Attach the clip and insert my data
var newPlot = attachMovie ("plot", "plot" + h + "" + i, this.getNextHighestDepth ());
//duplicateMovieClip("plot", "plot" + i, depth);
// assign the values...
this["plot" + h + "" + i].entry_clip.entry_date = "<i>" + entry_date + "</i>";
// finally set the position
this["plot" + h + "" + i]._y = 685;
this["plot" + h + "" + i]._x = Number (entry_pos);

}

1 reply

halcyon32AuthorCorrect answer
Inspiring
April 21, 2006
Ok I got this working here is my fix...

function attachXMLNodes () {
// Attach the clip and insert my data
var newPlot = attachMovie ("plot", "plot" + h + "" + i, this.getNextHighestDepth ());
//duplicateMovieClip("plot", "plot" + i, depth);
// assign the values...
this["plot" + h + "" + i].entry_clip.entry_date = "<i>" + entry_date + "</i>";
// finally set the position
this["plot" + h + "" + i]._y = 685;
this["plot" + h + "" + i]._x = Number (entry_pos);

}