Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. var list:List = new List();
  2. var tf:TextFormat = new TextFormat();
  3. tf.color = 0x333333;
  4. tf.font = "Teen";
  5. tf.size = 11;
  6. list.setRendererStyle('textFormat',tf);
  7. list.setSize(288,80);
  8. list.move(-144,184);
  9. addChild(list);
  10.  
  11. //--### LIST.EVENT.LISTENER ###--//
  12.  
  13. list.addEventListener(Event.CHANGE, itemClick);
  14. function itemClick(event:Event):void{
  15. var q = (event.target.selectedItem.label)+".mp3".toString()
  16. channel.stop();
  17. channel = snd.play(q);
  18. }
  19.  
  20. for (var i:Number=1; i<56; i++){
  21. snd = new Sound();
  22. snd.load(new URLRequest("SOUNDS/"+i+".mp3"));
  23. snd.addEventListener(Event.ID3, onID3);
  24. }
  25.  
  26. function onID3 (event:Event):void {
  27. snd = event.currentTarget as Sound;
  28. var songArtist = snd.id3.artist.toUpperCase();
  29. var songTitle = snd.id3.songName.toUpperCase();
  30. list.addItem({label:count+" - "+songArtist+" - "+songTitle});
  31. trace(count);
  32. count++;
  33. }
  34.  
  35. //--### HIGHLIGHT.FIRST.ON.LIST ###--//
  36.  
  37. var myArray = new Array(0,0);
  38. list.selectedIndices = myArray;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement