home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 127 / maccd 127.iso / software / diskdriver_mini.sit / diskdriver_mini / diskdriver_mini.swf / scripts / frame_1 / DoAction.as
Encoding:
Text File  |  2005-02-22  |  4.9 KB  |  217 lines

  1. function basic_complete()
  2. {
  3.    if(activetrack < 5)
  4.    {
  5.       realtrack = Number(activetrack) + 1;
  6.    }
  7.    else
  8.    {
  9.       realtrack = 1;
  10.    }
  11.    basic_playtrack.call();
  12. }
  13. function basic_playtrack()
  14. {
  15.    activealbum = realalbum;
  16.    activetrack = realtrack;
  17.    thestatus.colorfield._x = 175;
  18.    thestream.colorfield._x = 175;
  19.    thesoundclip = new Sound();
  20.    thesoundclip.onLoad = function(success)
  21.    {
  22.       if(!success)
  23.       {
  24.          realtrack = 1;
  25.          basic_playtrack.call();
  26.       }
  27.    };
  28.    thesoundclip.onSoundComplete = basic_complete;
  29.    thesoundclip.loadSound(master_dir add "/track" add realtrack add ".mp3",true);
  30.    playpause.gotoAndStop(1);
  31. }
  32. playpause.gotoAndStop(2);
  33. _soundbuftime = 1;
  34. status_text = "checking registration";
  35. thekey = _url.substr(0,length(_url) - 19);
  36. registration_path = "http://www.visualsteel.net/cgi-bin/diskdriver/diskdriver_mini.cgi";
  37. registration = new LoadVars();
  38. registration.thekey = thekey;
  39. registration.model = 210;
  40. registration.makelog = true;
  41. registration.onLoad = function(success)
  42. {
  43.    if(success)
  44.    {
  45.       if(registration.warning eq true)
  46.       {
  47.          attachMovie("warning","warning",this.getNextHighestDepth(),{_x:63,_y:35});
  48.       }
  49.       if(registration.authorized eq true)
  50.       {
  51.          thevolume = 99;
  52.          activetrack = 1;
  53.          realtrack = 1;
  54.          master_dir = "diskdriver";
  55.          basic_playtrack.call();
  56.       }
  57.    }
  58. };
  59. registration.sendAndLoad(registration_path,registration,"POST");
  60. this.onEnterFrame = function()
  61. {
  62.    thesoundclip.setVolume(thevolume);
  63.    thestatus.colorfield._x = 175 / thesoundclip.duration * thesoundclip.position;
  64.    thestream.colorfield._x = 175 / thesoundclip.getBytesTotal() * thesoundclip.getBytesLoaded();
  65.    tracktext = "TRACK " add activetrack;
  66.    thesoundclip.onID3 = function()
  67.    {
  68.       songtitle = thesoundclip.id3.songname;
  69.    };
  70.    if(registration.authorized ne true)
  71.    {
  72.       thevolume = 0;
  73.    }
  74.    if(thevolume < 99 and volumeup eq true and registration.authorized eq true)
  75.    {
  76.       thevolume = Number(thevolume) + 1;
  77.    }
  78.    if(thevolume > 0 and volumedown eq true)
  79.    {
  80.       thevolume = Number(thevolume) - 1;
  81.    }
  82.    if(rewind eq true)
  83.    {
  84.       whereisit = thesoundclip.position - thesoundclip.duration / 200;
  85.       thesoundclip.start(whereisit / 1000);
  86.    }
  87.    if(fast eq true)
  88.    {
  89.       whereisit = thesoundclip.position + thesoundclip.duration / 200;
  90.       thesoundclip.start(whereisit / 1000);
  91.    }
  92.    if(getProperty("playpause", _currentframe) eq 1 and thesoundclip.getBytesTotal() / thesoundclip.getBytesLoaded() < 10 and thesoundclip.getBytesTotal > 10 and thesoundclip.position < 1)
  93.    {
  94.       thesoundclip.start();
  95.    }
  96.    if(songtitle ne undefined)
  97.    {
  98.       setProperty("title", _alpha, 0);
  99.    }
  100.    else
  101.    {
  102.       setProperty("title", _alpha, 100);
  103.    }
  104. };
  105. trackdown.onRelease = function()
  106. {
  107.    if(activetrack > 1 and registration.authorized eq true)
  108.    {
  109.       realtrack = Number(activetrack) - 1;
  110.       basic_playtrack.call();
  111.    }
  112. };
  113. trackup.onRelease = function()
  114. {
  115.    if(activetrack < 5 and registration.authorized eq true)
  116.    {
  117.       realtrack = Number(activetrack) + 1;
  118.       basic_playtrack.call();
  119.    }
  120. };
  121. volumeup.onPress = function()
  122. {
  123.    volumeup = true;
  124. };
  125. volumeup.onRelease = function()
  126. {
  127.    volumeup = false;
  128. };
  129. volumeup.onReleaseOutside = function()
  130. {
  131.    volumeup = false;
  132. };
  133. volumedown.onPress = function()
  134. {
  135.    volumedown = true;
  136. };
  137. volumedown.onRelease = function()
  138. {
  139.    volumedown = false;
  140. };
  141. volumedown.onReleaseOutside = function()
  142. {
  143.    volumedown = false;
  144. };
  145. rewind.onPress = function()
  146. {
  147.    playpause.gotoAndStop(1);
  148.    rewind = true;
  149. };
  150. rewind.onRelease = function()
  151. {
  152.    rewind = false;
  153.    thesoundclip.start(thesoundclip.position / 1000);
  154. };
  155. rewind.onReleaseOutside = function()
  156. {
  157.    rewind = false;
  158.    thesoundclip.start(thesoundclip.position / 1000);
  159. };
  160. fast.onPress = function()
  161. {
  162.    playpause.gotoAndStop(1);
  163.    fast = true;
  164. };
  165. fast.onRelease = function()
  166. {
  167.    fast = false;
  168.    thesoundclip.start(thesoundclip.position / 1000);
  169. };
  170. fast.onReleaseOutside = function()
  171. {
  172.    fast = false;
  173.    thesoundclip.start(thesoundclip.position / 1000);
  174. };
  175. restart.onPress = function()
  176. {
  177.    thesoundclip.start(0);
  178.    playpause.gotoAndStop(1);
  179. };
  180. volumedown.onRelease = function()
  181. {
  182.    volumedown = false;
  183. };
  184. volumedown.onReleaseOutside = function()
  185. {
  186.    volumedown = false;
  187. };
  188. volumeup.onRelease = function()
  189. {
  190.    volumeup = false;
  191. };
  192. volumeup.onReleaseOutside = function()
  193. {
  194.    volumeup = false;
  195. };
  196. volumeup.onPress = function()
  197. {
  198.    volumeup = true;
  199. };
  200. volumedown.onPress = function()
  201. {
  202.    volumedown = true;
  203. };
  204. logo.onRelease = function()
  205. {
  206.    getUrl("http://www.visualsteel.net/diskdriver.shtml", "_blank");
  207. };
  208. logo.onRollOver = function()
  209. {
  210.    attachMovie("notice","notice",1000,{_x:5,_y:23});
  211. };
  212. logo.onRollOut = function()
  213. {
  214.    removeMovieClip("notice");
  215. };
  216. stop();
  217.