home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 January / 01_03.iso / service / winamp3 / files / skins / Chronabie.wal / toast / toast.m < prev    next >
Text File  |  2002-02-28  |  1KB  |  46 lines

  1. #include "../../lib/std.mi"
  2.  
  3. Global Group standardframeGroup, toastGroup;
  4. Global Container StandardFrameContainer;
  5. Global Layout StandardFrameNormalLayout;
  6. Global animatedLayer toast;
  7. Global Timer toasterTimer;
  8. Global List frameList;
  9. Global int frameNum;
  10. System.onScriptLoaded(){
  11. StandardFrameContainer = getContainer("StandardFrameContainer");
  12. StandardFrameNormalLayout = StandardFrameContainer.getLayout("normal");
  13. standardframeGroup = StandardFrameNormalLayout.getObject("studio.standardframe");
  14. toastGroup  = standardframeGroup.getObject("toastgroup");
  15. toast = toastGroup.getObject("toast");
  16. toasterTimer = new Timer;
  17. toasterTimer.setDelay(225);
  18. frameList = new List;
  19. frameList.addItem(3); frameList.addItem(2); frameList.addItem(1);
  20. frameList.addItem(0); frameList.addItem(0); frameList.addItem(0);
  21. frameList.addItem(0); frameList.addItem(0); frameList.addItem(0);
  22. frameList.addItem(0); frameList.addItem(0); frameList.addItem(4);
  23. frameList.addItem(5); frameList.addItem(6); frameList.addItem(7);
  24. frameNum = 0;
  25. }
  26.  
  27. System.onScriptUnloading(){
  28. delete toasterTimer;
  29. delete frameList;
  30. }
  31.  
  32. toast.onLeftButtonUp(int x, int y){
  33. toasterTimer.start();
  34. }
  35.  
  36. toasterTimer.onTimer(){
  37. if (frameNum<15){
  38.     toast.gotoFrame(frameList.enumItem(frameNum) );
  39.     frameNum++;
  40.     }
  41. else{
  42.     frameNum=0;
  43.     toasterTimer.stop();
  44.     }
  45.  
  46. }