Posted By

sicbot on 04/02/08


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

dazza


load XML


 / Published in: ActionScript
 

  1. stop();
  2. var music:Array = [];
  3. var songNum:Number = 0;
  4. var mySound:Sound = new Sound();
  5. var myXML:XML = new XML();
  6. myXML.load("con.xml");
  7. myXML.ignoreWhite = true;
  8. var nn:Number;
  9. myXML.onLoad = function() {
  10. nn = myXML.childNodes[1].childNodes.length;
  11. for (n=0; n<nn; n++) {
  12. music.push(myXML.childNodes[1].childNodes[n].childNodes[0]);
  13. }
  14. sound.loadSound(music[songNumber]);
  15. trace(music[songNum]);
  16. };
  17. next_mc.onRelease = function() {
  18. songNum++;
  19. if (songNum == nn) {
  20. songNum = 0;
  21. }
  22. trace(music)
  23. };
  24.  
  25.  
  26. ////////////////////////////////////////////////////////////////////////
  27.  
  28.  
  29. <img>
  30. <pic>image1.png</pic>
  31. <pic>image2.png</pic>
  32. <pic>image3.png</pic>
  33. </img>
  34. <mus>
  35. <song>track1.mp3</song>
  36. <song>track2.mp3</song>
  37. <song>track3.mp3</song>
  38. </mus>

Report this snippet  

You need to login to post a comment.