home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / Chip_2004-04_cd1.bin / opsys / wmakeup / downloads / Simplicity.wmz / Simplicity.js < prev    next >
Text File  |  2004-02-12  |  2KB  |  111 lines

  1. var Play    = false;
  2.  
  3. var Closed  = 276;
  4. var Opened  = 0;
  5. var IsOpen  = false;
  6.  
  7. var speed = 120;
  8.  
  9. function DoLoad()
  10. {
  11. pl.setColumnWidth(1, 100)
  12. OnPlayStateChange()
  13. }
  14.  
  15. function OnPlayStateChange()
  16. {
  17. if(player.Playstate==3)
  18. {
  19.     Play = true
  20. }
  21. ChangeImage();
  22.  
  23. nowplaying.value=player.currentmedia.getiteminfo("author");
  24. if(nowplaying.value != "")
  25. {
  26. nowplaying.value += " - "
  27. }
  28. nowplaying.value += player.currentmedia.name;
  29.  
  30. if(nowplaying.textwidth > 218)
  31. {
  32.           nowplaying.scrolling="true";
  33.     nowplaying.left="32"
  34.     nowplaying.width = "234"
  35.     nowplaying.value += "      -=-";
  36. }
  37. else
  38. {
  39.         nowplaying.scrolling="false";
  40.     nowplaying.left="40"
  41.     nowplaying.width = "218"
  42.  
  43. }
  44. }
  45.  
  46. function OnOpenStateChange()
  47. {
  48. }
  49.  
  50. function PClick()
  51. {
  52.     if(Play)
  53. {
  54.     jscript:player.controls.pause();
  55. }
  56.     else 
  57. {
  58.     jscript:player.controls.play();
  59. }
  60.     Play = !Play;
  61. ChangeImage();
  62. }
  63.  
  64. function StopClick()
  65. {
  66.     jscript:player.controls.stop();
  67.     Play = false
  68.     ChangeImage();
  69. }
  70.  
  71. function ChangeImage()
  72. {
  73.     if(Play==false)
  74.     {
  75.     PlayBut.image="Play.bmp";
  76.     PlayBut.downimage="Play_off.bmp";
  77.     PlayBut.hoverimage="Play_over.bmp";
  78.     PlayBut.upToolTip="Play";
  79.  }
  80.     else
  81.     {
  82.     PlayBut.image="Pause.bmp";
  83.     PlayBut.downimage="Pause_off.bmp";
  84.     PlayBut.Hoverimage="Pause_over.bmp";
  85.     PlayBut.upToolTip="Pause";
  86.     }
  87. }
  88.  
  89. function OpenC()
  90. {
  91.     if(IsOpen)
  92.     {
  93.         sPlEar.moveto(Closed, sPlEar.top, speed);
  94.     }
  95.     else
  96.     {
  97.         sPlEar.moveto(Opened, sPlEar.top, speed);
  98.     }
  99.     IsOpen = !IsOpen;
  100. }
  101.  
  102. function OpenFile()
  103. {
  104.     media = theme.openDialog('FILE_OPEN','FILES_ALLMEDIA');
  105.     if (media) {
  106.         player.URL = media;
  107.         player.controls.play();
  108.     }
  109. }
  110.  
  111.