home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 March / CMCD0305.ISO / Software / Shareware / Programare / diskdriver / diskdriver.swf / scripts / frame_1 / DoAction.as
Text File  |  2005-01-10  |  8KB  |  305 lines

  1. actualurl = _url;
  2. theindex = length(actualurl) - 14;
  3. thekey = actualurl.substr(0,theindex);
  4. activetrack = 1;
  5. activealbum = 1;
  6. playpause.gotoAndStop(2);
  7. loading.stop();
  8. _soundbuftime = 0;
  9. libraryload = true;
  10. libraryplay = true;
  11. loadlist = true;
  12. this.onEnterFrame = function()
  13. {
  14.    if(loadlist eq true)
  15.    {
  16.       tryingtoload = true;
  17.       songtitle = "loading play list";
  18.       playlist = new LoadVars();
  19.       playlist.wherearesongs = thekey add "diskdriver/";
  20.       playlist.thekey = thekey;
  21.       playlist.model = 201;
  22.       playlist.makelog = true;
  23.       playlist.makeplaylist = true;
  24.       playlist.onLoad = function(success)
  25.       {
  26.          if(success)
  27.          {
  28.             songtitle = "play list loaded";
  29.             loadpagedata = true;
  30.          }
  31.          else
  32.          {
  33.             playlist.sendAndLoad("http://www.visualsteel.net/cgi-bin/diskdriver/diskdriver2.0.cgi",playlist,"POST");
  34.          }
  35.       };
  36.       playlist.sendAndLoad("http://www.visualsteel.net/cgi-bin/diskdriver/diskdriver2.0.cgi",playlist,"POST");
  37.       loadlist = false;
  38.    }
  39.    if(loadpagedata eq true)
  40.    {
  41.       if(playlist.registered eq true)
  42.       {
  43.          pagedata = new LoadVars();
  44.          pagedata.onLoad = function(success)
  45.          {
  46.             if(success)
  47.             {
  48.                loadplaylist = true;
  49.             }
  50.             else
  51.             {
  52.                pagedata.sendAndLoad("",pagedata,"GET");
  53.             }
  54.          };
  55.          pagedata.sendAndLoad("",pagedata,"GET");
  56.       }
  57.       else
  58.       {
  59.          loadplaylist = true;
  60.       }
  61.       loadpagedata = false;
  62.    }
  63.    if(loadplaylist eq true)
  64.    {
  65.       if(playlist.authorized eq true)
  66.       {
  67.          thevolume = 99;
  68.       }
  69.       if(playlist.warning eq true)
  70.       {
  71.          this.attachMovie("warning","warning",this.getNextHighestDepth(),{_x:40,_y:125});
  72.       }
  73.       if(pagedata.track ne undefined)
  74.       {
  75.          activetrack = pagedata.track;
  76.       }
  77.       if(pagedata.album ne undefined)
  78.       {
  79.          activealbum = pagedata.album;
  80.       }
  81.       albumchange = true;
  82.       playtrack = true;
  83.       tryingtoload = false;
  84.       loadplaylist = false;
  85.    }
  86.    if(playtrack eq true)
  87.    {
  88.       playpause.gotoAndStop(1);
  89.       thestatus.colorfield._rotation = 90;
  90.       thestream.colorfield._rotation = 90;
  91.       if(albumchange eq true)
  92.       {
  93.          loadMovie(thekey add "covers/cdrom" add activealbum add ".jpg","artback");
  94.          loadMovie(thekey add "covers/cdrom_spin" add activealbum add ".jpg","loading.rom.artspin");
  95.          activetrack = 1;
  96.          albumchange = false;
  97.       }
  98.       thesoundclip = new Sound();
  99.       thesoundclip.loadSound(thekey add "diskdriver/" add eval("playlist.album" add activealbum) add "/" add eval("playlist.track" add activealbum add "_" add activetrack),true);
  100.       playtrack = false;
  101.    }
  102.    if(thevolume < 99 and volumeup eq true and playlist.authorized eq true)
  103.    {
  104.       thevolume = Number(thevolume) + 1;
  105.    }
  106.    if(thevolume > 0 and volumedown eq true)
  107.    {
  108.       thevolume = Number(thevolume) - 1;
  109.    }
  110.    if(rewind eq true)
  111.    {
  112.       whereisit = thesoundclip.position - thesoundclip.duration / 200;
  113.       thesoundclip.start(whereisit / 1000);
  114.    }
  115.    if(fast eq true)
  116.    {
  117.       whereisit = thesoundclip.position + thesoundclip.duration / 200;
  118.       thesoundclip.start(whereisit / 1000);
  119.    }
  120.    if(dragtoc eq true and getProperty(_root, _ymouse) < 180 and getProperty("theplaylist.tableofcontent", _height) > 180)
  121.    {
  122.       setProperty("theplaylist.tableofcontent", _Y, - (getProperty(_root, _ymouse) - 0) * ((getProperty("theplaylist.tableofcontent", _height) - 180) / 180));
  123.    }
  124.    if(mylistplay eq true)
  125.    {
  126.       activetrack = activerealtrack;
  127.    }
  128.    thesoundclip.onSoundComplete = function()
  129.    {
  130.       if(libraryplay eq true)
  131.       {
  132.          if(activetrack < eval("playlist.albumcount" add activealbum))
  133.          {
  134.             activetrack = Number(activetrack) + 1;
  135.          }
  136.          else
  137.          {
  138.             activetrack = 1;
  139.             if(activealbum < playlist.totalalbums)
  140.             {
  141.                activealbum = Number(activealbum) + 1;
  142.             }
  143.             else
  144.             {
  145.                activealbum = 1;
  146.             }
  147.          }
  148.          playtrack = true;
  149.       }
  150.       else if(mylistplay eq true)
  151.       {
  152.          if(activerealtrack < sortorder)
  153.          {
  154.             activerealtrack = Number(activerealtrack) + 1;
  155.             thesoundclip = new Sound();
  156.             thesoundclip.loadSound(thekey add eval("_root.realtrack" add activerealtrack),true);
  157.          }
  158.          else
  159.          {
  160.             activerealtrack = 1;
  161.             thesoundclip = new Sound();
  162.             thesoundclip.loadSound(thekey add _root.realtrack1,true);
  163.          }
  164.       }
  165.    };
  166.    if(libraryplay eq true)
  167.    {
  168.       songtitle = eval("playlist.track" add activealbum add "_" add activetrack).substring(0,eval("playlist.track" add activealbum add "_" add activetrack).length - 4);
  169.    }
  170.    else if(mylistplay eq true)
  171.    {
  172.       songtitle = eval("realtrackname" add activerealtrack);
  173.    }
  174.    thesoundclip.setVolume(thevolume);
  175.    thestatus.colorfield._rotation = 90 - 90 / thesoundclip.duration * thesoundclip.position;
  176.    thestream.colorfield._rotation = 90 - 90 / thesoundclip.getBytesTotal() * thesoundclip.getBytesLoaded();
  177.    if(playlist.authorized ne true)
  178.    {
  179.       thevolume = 0;
  180.    }
  181.    if(playlist.demo eq true and getTimer() > 20000)
  182.    {
  183.       thevolume = 10;
  184.    }
  185. };
  186. volumeup.onPress = function()
  187. {
  188.    volumeup = true;
  189. };
  190. volumeup.onRelease = function()
  191. {
  192.    volumeup = false;
  193. };
  194. volumeup.onReleaseOutside = function()
  195. {
  196.    volumeup = false;
  197. };
  198. volumedown.onPress = function()
  199. {
  200.    volumedown = true;
  201. };
  202. volumedown.onRelease = function()
  203. {
  204.    volumedown = false;
  205. };
  206. volumedown.onReleaseOutside = function()
  207. {
  208.    volumedown = false;
  209. };
  210. rewind.onPress = function()
  211. {
  212.    playpause.gotoAndStop(1);
  213.    rewind = true;
  214. };
  215. rewind.onRelease = function()
  216. {
  217.    rewind = false;
  218.    thesoundclip.start(thesoundclip.position / 1000);
  219. };
  220. rewind.onReleaseOutside = function()
  221. {
  222.    rewind = false;
  223.    thesoundclip.start(thesoundclip.position / 1000);
  224. };
  225. fast.onPress = function()
  226. {
  227.    playpause.gotoAndStop(1);
  228.    fast = true;
  229. };
  230. fast.onRelease = function()
  231. {
  232.    fast = false;
  233.    thesoundclip.start(thesoundclip.position / 1000);
  234. };
  235. fast.onReleaseOutside = function()
  236. {
  237.    fast = false;
  238.    thesoundclip.start(thesoundclip.position / 1000);
  239. };
  240. restart.onPress = function()
  241. {
  242.    thesoundclip.start(0);
  243.    playpause.gotoAndStop(1);
  244. };
  245. trackdown.onRelease = function()
  246. {
  247.    if(libraryplay eq true)
  248.    {
  249.       if(activetrack > 1 and tryingtoload ne true)
  250.       {
  251.          activetrack = Number(activetrack) - 1;
  252.          playtrack = true;
  253.       }
  254.    }
  255.    else if(mylistplay eq true and activerealtrack > 1)
  256.    {
  257.       playpause.gotoAndStop(1);
  258.       activerealtrack = Number(activerealtrack) - 1;
  259.       thesoundclip = new Sound();
  260.       thesoundclip.loadSound(thekey add eval("_root.realtrack" add activerealtrack),true);
  261.    }
  262. };
  263. trackup.onRelease = function()
  264. {
  265.    if(libraryplay eq true and activetrack < eval("playlist.albumcount" add activealbum) and tryingtoload ne true)
  266.    {
  267.       activetrack = Number(activetrack) + 1;
  268.       playtrack = true;
  269.    }
  270.    else if(mylistplay eq true and activerealtrack < sortorder)
  271.    {
  272.       playpause.gotoAndStop(1);
  273.       activerealtrack = Number(activerealtrack) + 1;
  274.       thesoundclip = new Sound();
  275.       thesoundclip.loadSound(thekey add eval("_root.realtrack" add activerealtrack),true);
  276.    }
  277. };
  278. albumdown.onRelease = function()
  279. {
  280.    if(activealbum > 1 and tryingtoload ne true and libraryplay eq true)
  281.    {
  282.       activealbum = Number(activealbum) - 1;
  283.       albumchange = true;
  284.       playtrack = true;
  285.    }
  286. };
  287. albumup.onRelease = function()
  288. {
  289.    if(activealbum < playlist.totalalbums and tryingtoload ne true and libraryplay eq true)
  290.    {
  291.       activealbum = Number(activealbum) + 1;
  292.       albumchange = true;
  293.       playtrack = true;
  294.    }
  295. };
  296. lists.onRelease = function()
  297. {
  298.    attachMovie("thelists","thelists",999,{_x:0,_y:0});
  299. };
  300. logo.onRelease = function()
  301. {
  302.    attachMovie("notice","notice",1000,{_x:0,_y:0});
  303. };
  304. stop();
  305.