Advertisement
ExtReMLapin

0x

Jun 5th, 2014
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. function animTick()
  3. {
  4.     if (animCurrentFrame > images[ii].frameAmount)
  5.     {
  6.         animCurrentFrame = 1;
  7.     }
  8.     else
  9.     {
  10.         ++animCurrentFrame;
  11.     }
  12.     TheGif = flash.display.BitmapData.loadBitmap(images[ii].name + animCurrentFrame);
  13. }
  14. function changeImage()
  15. {
  16.     if (images[ii].anim == 0)
  17.     {
  18.         TheGif = flash.display.BitmapData.loadBitmap(images[ii].name);
  19.         return;
  20.     }
  21.     trace("Switching to animation, the first frame is:" + images[ii].name + animCurrentFrame);
  22.     TheGif = flash.display.BitmapData.loadBitmap(images[ii].name + animCurrentFrame);
  23. }
  24. function toggleHelp()
  25. {
  26.     UIButtons.helpBox._visible = !UIButtons.helpBox._visible;
  27.     UIButtons.SongPicker._visible = false;
  28.     UIButtons.ImgPicker._visible = false;
  29. }
  30. function activate()
  31. {
  32.     UIButtons.btnForward._alpha = 30;
  33.     UIButtons.btnBack._alpha = 30;
  34.     UIButtons.btnSongBack._alpha = 30;
  35.     UIButtons.btnSongForward._alpha = 30;
  36.     UIButtons.btnAuto._alpha = 30;
  37.     UIButtons.btnFullAuto._alpha = 30;
  38.     UIButtons.showHelp._alpha = 30;
  39.     if (btnUiHide._y - (Stage.height - 720) == 55)
  40.     {
  41.         showing = true;
  42.         btnUiHide.arrow._rotation = 0;
  43.         return;
  44.     }
  45.     if (btnUiHide._y - (Stage.height - 720) == 0)
  46.     {
  47.         hiding = true;
  48.         btnUiHide._alpha = 100;
  49.         btnUiHide.arrow._rotation = 180;
  50.         btnUiHide.enabled = false;
  51.     }
  52. }
  53. function changeUI()
  54. {
  55.     if (hiding)
  56.     {
  57.         UIButtons._alpha = UIButtons._alpha - 15;
  58.         UIText._alpha = UIText._alpha - 15;
  59.         UIBeats._alpha = UIBeats._alpha - 15;
  60.         if (btnUiHide._y - (Stage.height - 720) < 55)
  61.         {
  62.             btnUiHide._y = btnUiHide._y + 5;
  63.         }
  64.         else if (btnUiHide._y - (Stage.height - 720) == 55)
  65.         {
  66.             hiding = false;
  67.             hidden = true;
  68.             btnUiHide._alpha = 0;
  69.             btnUiHide.enabled = true;
  70.             UIButtons.btnForward.enabled = false;
  71.             UIButtons.btnBack.enabled = false;
  72.             UIButtons.btnSongBack.enabled = false;
  73.             UIButtons.btnSongForward.enabled = false;
  74.             UIButtons.btnAuto.enabled = false;
  75.             UIButtons.btnFullAuto.enabled = false;
  76.             UIButtons.showHelp.enabled = false;
  77.             UIButtons.btnSongs.enabled = false;
  78.             UIButtons._visible = false;
  79.         }
  80.         return;
  81.     }
  82.     if (showing)
  83.     {
  84.         btnUiHide._alpha = 8;
  85.         UIButtons._visible = true;
  86.         UIButtons._alpha = UIButtons._alpha + 15;
  87.         UIText._alpha = UIText._alpha + 15;
  88.         UIBeats._alpha = UIBeats._alpha + 15;
  89.         UIBeats.scode._alpha = UIBeats.scode._alpha + 15;
  90.         if (btnUiHide._y - (Stage.height - 720) > 0)
  91.         {
  92.             btnUiHide._y = btnUiHide._y - 5;
  93.             return;
  94.         }
  95.         if (btnUiHide._y - (Stage.height - 720) == 0)
  96.         {
  97.             showing = false;
  98.             hidden = false;
  99.             UIButtons.btnForward.enabled = true;
  100.             UIButtons.btnBack.enabled = true;
  101.             UIButtons.btnSongBack.enabled = true;
  102.             UIButtons.btnSongForward.enabled = true;
  103.             UIButtons.btnAuto.enabled = true;
  104.             UIButtons.btnFullAuto.enabled = true;
  105.             UIButtons.showHelp.enabled = true;
  106.             UIButtons.btnSongs.enabled = true;
  107.         }
  108.     }
  109. }
  110. function otherOnEnterFrame()
  111. {
  112.     changeUI();
  113.     UIBeats.scode = songs[ss].myRhythm.substr(beat, length(songs[ss].myRhythm) - beat) + songs[ss].myRhythm;
  114.     while (UIBeats.scode.length < 600)
  115.     {
  116.         UIBeats.scode = UIBeats.scode + songs[ss].myRhythm;
  117.     }
  118.     if (song.position > nextup && song.position - nextup < 1500)
  119.     {
  120.         if (songs[ss].myRhythm.charAt(beat) == "x")
  121.         {
  122.             blackening = false;
  123.             yblur = 96;
  124.         }
  125.         if (songs[ss].myRhythm.charAt(beat) == "o")
  126.         {
  127.             blackening = false;
  128.             xblur = 96;
  129.         }
  130.         if (songs[ss].myRhythm.charAt(beat) == "+")
  131.         {
  132.             blackening = true;
  133.             xblur = 500;
  134.         }
  135.         if (songs[ss].myRhythm.charAt(beat) != "." && songs[ss].myRhythm.charAt(beat) != "+")
  136.         {
  137.             changeit();
  138.         }
  139.         beat = (beat + 1) % length(songs[ss].myRhythm);
  140.         nextup = int(beat * blen);
  141.     }
  142.     if (song.position < 100 && !shrekActivated && !shrekedOut)
  143.     {
  144.         if (!shrekActivated && fullAuto)
  145.         {
  146.             shrekedOut = true;
  147.             trace("HOLEE SHET, A SHREK?");
  148.             var __reg2 = 1;
  149.             var __reg3 = 100;
  150.             var __reg1 = Math.floor(Math.random() * (__reg3 - __reg2 + 1)) + __reg2;
  151.             trace("We rolled: " + __reg1);
  152.             if (__reg1 <= shrekChance)
  153.             {
  154.                 trace("SHREK ACTIVATED");
  155.                 dreck._alpha = 10;
  156.                 dreck.enabled = true;
  157.                 shrekActivated = true;
  158.             }
  159.             else
  160.             {
  161.                 trace("SHREK NOT ACTIVATED :(");
  162.             }
  163.         }
  164.     }
  165.     else if (song.position > 100)
  166.     {
  167.         shrekedOut = false;
  168.     }
  169.     else if (song.position < 100 && shrekActivated && !shrekedOut)
  170.     {
  171.         trace("SHREK GOT AWAY SAFELY");
  172.         dreck.enabled = false;
  173.         dreck._alpha = 0;
  174.         shrekActivated = false;
  175.     }
  176.     if (blackening)
  177.     {
  178.         blackThing._alpha = blackThing._alpha + 25;
  179.     }
  180.     else
  181.     {
  182.         blackThing._alpha = 0;
  183.     }
  184.     UIText.tcode = conv(song.position, 4);
  185.     UIText.bcode = conv(beat, 2);
  186.     UIText.xcode = conv(xblur, 2);
  187.     UIText.ycode = conv(yblur, 2);
  188.     UIText.imageName = images[ii].name.toUpperCase();
  189.     blur = new flash.filters.BlurFilter(xblur, yblur, 1);
  190.     if (isShrek)
  191.     {
  192.         bmp[0].copyPixels(flash.display.BitmapData.loadBitmap("imgdreck"), fullscreen, origin);
  193.     }
  194.     else
  195.     {
  196.         bmp[0].copyPixels(TheGif, fullscreen, origin);
  197.     }
  198.     if (xblur * yblur != 1)
  199.     {
  200.         bmp[0].applyFilter(bmp[0], fullscreen, origin, blur);
  201.     }
  202.     if (xblur != 1)
  203.     {
  204.         xblur = xblur / 2;
  205.     }
  206.     if (yblur != 1)
  207.     {
  208.         yblur = yblur / 2;
  209.     }
  210. }
  211. function changeit()
  212. {
  213.     if (!isShrek)
  214.     {
  215.         if (fullAuto)
  216.         {
  217.             var __reg2 = ii;
  218.             while (__reg2 == ii)
  219.             {
  220.                 var __reg1 = random(images.length);
  221.                 if (contains(__reg1, imageQueue) == -1)
  222.                 {
  223.                     imageQueue.push(__reg1);
  224.                     if (imageQueue.length > images.length * 0.75)
  225.                     {
  226.                         imageQueue.shift();
  227.                     }
  228.                     ii = __reg1;
  229.                 }
  230.             }
  231.             var __reg3 = "";
  232.             changeImage();
  233.         }
  234.         else if (changeAuto && beat == 0)
  235.         {
  236.             ii = (ii + random(images.length - 2) + 1) % images.length;
  237.             changeImage();
  238.         }
  239.     }
  240.     if (isShrek)
  241.     {
  242.         cc = shrekColors[random(shrekColors.length - 1)];
  243.     }
  244.     else
  245.     {
  246.         cc = (cc + random(colors.length - 2) + 1) % colors.length;
  247.     }
  248.     UIText.ccode = conv(cc, 2);
  249.     UIText.ctxt = colors[cc].toUpperCase();
  250.     x = cc % 4;
  251.     y = int(cc / 4) % 4;
  252.     z = int(cc / 16);
  253.     rect(1, 0, 0, 1280, 720, 4278190080 + 5570560 * x + 21760 * y + 85 * z);
  254. }
  255. function conv(number, digits)
  256. {
  257.     ret = number.toString(16).toUpperCase();
  258.     while (ret.length < digits)
  259.     {
  260.         ret = "0" + ret;
  261.     }
  262.     return ret;
  263. }
  264. function rect(r, x, y, w, h, c)
  265. {
  266.     bmp[r].fillRect(new flash.geom.Rectangle(x, y, w, h), c);
  267. }
  268. function playForward()
  269. {
  270.     if (isShrek)
  271.     {
  272.         return;
  273.     }
  274.     changeAuto = false;
  275.     fullAuto = false;
  276.     UIText.mode = "NORMAL";
  277.     if (ii < images.length - 1)
  278.     {
  279.         ++ii;
  280.     }
  281.     else
  282.     {
  283.         ii = 0;
  284.     }
  285.     if (images[ii].anim == 1)
  286.     {
  287.         animTimer = setInterval(animTick, images[ii].animationLength / images[ii].frameAmount);
  288.         animCurrentFrame = 1;
  289.     }
  290.     else
  291.     {
  292.         clearInterval(animTimer);
  293.         animCurrentFrame = 1;
  294.     }
  295.     changeImage();
  296. }
  297. function playBack()
  298. {
  299.     if (isShrek)
  300.     {
  301.         return;
  302.     }
  303.     changeAuto = false;
  304.     fullAuto = false;
  305.     UIText.mode = "NORMAL";
  306.     if (ii > 0)
  307.     {
  308.         --ii;
  309.     }
  310.     else
  311.     {
  312.         ii = images.length - 1;
  313.     }
  314.     if (images[ii].anim == 1)
  315.     {
  316.         animTimer = setInterval(animTick, images[ii].animationLength / images[ii].frameAmount);
  317.         animCurrentFrame = 1;
  318.     }
  319.     else
  320.     {
  321.         clearInterval(animTimer);
  322.         animCurrentFrame = 1;
  323.     }
  324.     changeImage();
  325. }
  326. function playAuto()
  327. {
  328.     fullAuto = false;
  329.     if (changeAuto)
  330.     {
  331.         changeAuto = false;
  332.         UIText.mode = "NORMAL";
  333.         return;
  334.     }
  335.     changeAuto = true;
  336.     UIText.mode = "AUTO";
  337. }
  338. function playFullAuto()
  339. {
  340.     changeAuto = false;
  341.     if (fullAuto)
  342.     {
  343.         fullAuto = false;
  344.         UIText.mode = "NORMAL";
  345.         return;
  346.     }
  347.     fullAuto = true;
  348.     UIText.mode = "FULL AUTO";
  349. }
  350. function colImgInitializations()
  351. {
  352.     images = new Array({anim: 0, name: "ExtReM1"}, {anim: 0, name: "ExtReM2"}, {anim: 0, name: "ExtReM3"}, {anim: 0, name: "ExtReM4"}, {anim: 0, name: "ExtReM5"})
  353.     images.sortOn("name");
  354.     _global.imgList = images.concat();
  355.     ii = 0;
  356.     colors = new Array();
  357.     colors[0] = "black";
  358.     colors[1] = "brick";
  359.     colors[2] = "crimson";
  360.     colors[3] = "red";
  361.     colors[4] = "turtle";
  362.     colors[5] = "sludge";
  363.     colors[6] = "brown";
  364.     colors[7] = "orange";
  365.     colors[8] = "green";
  366.     colors[9] = "grass";
  367.     colors[10] = "maize";
  368.     colors[11] = "citrus";
  369.     colors[12] = "lime";
  370.     colors[13] = "leaf";
  371.     colors[14] = "chartreuse";
  372.     colors[15] = "yellow";
  373.     colors[16] = "midnight";
  374.     colors[17] = "plum";
  375.     colors[18] = "pomegranate";
  376.     colors[19] = "rose";
  377.     colors[20] = "swamp";
  378.     colors[21] = "dust";
  379.     colors[22] = "dirt";
  380.     colors[23] = "blossom";
  381.     colors[24] = "sea";
  382.     colors[25] = "ill";
  383.     colors[26] = "haze";
  384.     colors[27] = "peach";
  385.     colors[28] = "spring";
  386.     colors[29] = "mantis";
  387.     colors[30] = "brilliant";
  388.     colors[31] = "canary";
  389.     colors[32] = "navy";
  390.     colors[33] = "grape";
  391.     colors[34] = "mauve";
  392.     colors[35] = "purple";
  393.     colors[36] = "cornflower";
  394.     colors[37] = "deep";
  395.     colors[38] = "lilac";
  396.     colors[39] = "lavender";
  397.     colors[40] = "aqua";
  398.     colors[41] = "steel";
  399.     colors[42] = "grey";
  400.     colors[43] = "pink";
  401.     colors[44] = "bay";
  402.     colors[45] = "marina";
  403.     colors[46] = "tornado";
  404.     colors[47] = "saltine";
  405.     colors[48] = "blue";
  406.     colors[49] = "twilight";
  407.     colors[50] = "orchid";
  408.     colors[51] = "magenta";
  409.     colors[52] = "azure";
  410.     colors[53] = "liberty";
  411.     colors[54] = "royalty";
  412.     colors[55] = "thistle";
  413.     colors[56] = "ocean";
  414.     colors[57] = "sky";
  415.     colors[58] = "periwinkle";
  416.     colors[59] = "carnation";
  417.     colors[60] = "cyan";
  418.     colors[61] = "turquoise";
  419.     colors[62] = "powder";
  420.     colors[63] = "white";
  421.     cc = 0;
  422. }
  423. function songStuff()
  424. {
  425.     songs = new Array();
  426.     ss = 0;
  427.     songOffset = 0;
  428.     songs = new Array({myRhythm: "x..xo...x...o...x..xo...x...o...x..xo...x...o...x..xo...x...oxoox..xo...x...o...x..xo...x...o...x..xo...x...o...x...o...x...oooo", buildUpFile: "build_Finale", buildUp: 1, myFile: "Finale", myname: "Madeon - Finale"}, {myRhythm: "o...x.o.o...x.o.o...x...o...x.o.o...x.o.o...x.......x.......x...", myFile: "Radioactive", myname: "Imagine Dragons - Radioactive"}, {myRhythm: "o...x...o...x...o...x...o...x...o...x...o...x...o...x...o...xxx.x...x...o...x...o...x...o...x...o...x...o...x...o...o...o...o...", myFile: "RowRow", myname: "@LILINTERNET - Row Row Fight the Power (RAGEFOXX & SLUTTT MIX)"}, {myRhythm: "o...x...o.o.x.x...o.x...o.o.x...o...x...o.o.x.x...o.x...oo..x.x.o...x...o.o.x.x...o.x...oo..x.x.o...x...o.o.x.x...o.x...x...x.xx", myFile: "Desire", myname: "Outlaw Star OST - Desire"}, {myRhythm: "o.....oox.......o.o....ox.......o.....oox...o...o.o....ox.......o......ox.......o.o....ox.......o.....oox...o...o.o.....+.......", myFile: "Sight", myname: "The Bloody Beetroots - Out of Sight"}, {myRhythm: "o......ox.....o.o.......x.......o......ox.....o.o.....o.x.ooooooo......ox.....o.o.......x.......o......ox.....o.o.....o.x.oooooo", myFile: "Smile", myname: "Buckethead - Smile Without a Face"}, {myRhythm: "o...x.....o.x...o...x.....o.x...o...x.....o.x...o...x.....o.+...", myFile: "Courtship", myname: "Crystal Castles - Courtship Dating"}, {myRhythm: "o...x..---o.x...-.o.x------.x..-o.-.x.o..-.ox-.-----x-o-------o-o...x..---o.x...-.o.x------.x..-o.-.x.o..-.ox-.-----x-o-------o-", myFile: "Vordhosbn", myname: "Aphex Twin - Vordhosbn"}, {myRhythm: "o.o.x..o.x.x....o..ox......x....o...x....o.x....o...x....o.xx...o.o.x..o.x.x....o..ox......x....o...x....o.x...xo...x....o.xx...", myFile: "Orange", myname: "Culprate - Orange (Sunrise, Sunset)"}, {myRhythm: "x+......o+......x+......o+......x+......o+......x+......o+......x+......o+......x+......o+......x+......o+......x+..............x+......o+......x+......o+......x+......o+......x+......o+......x+......o+......x+......o+......x+......o+......x+......o.......", myFile: "Spoiler", myname: "Hyper - Spoiler"}, {myRhythm: "o.x..ox.o.x..ox.o.x..ox.o.x..ox.o.x..xx.o.x..xx.o.x..xx.o.x..xx.o.x..ox.o.x..ox.o.x..ox.o.x..ox.o.x..xx.o.x..xx.o.xx.xx.o.x..xx.", myFile: "Kryptonite", myname: "DJ Fresh - Kryptonite"}, {myRhythm: "o.......x...o.......o...xxxxx...o.o.....x...o.......o...xxxxx...o.......x...o.......o...xxxxx...o.......x...o...o.......+.......o.......x...o.......o...xxxxx...o.o.....x...o...-.-.o.-.xxx+x+x+o.......x...o.......o...xxxxx...o.......x...o...o...x.x.+.......", myFile: "Glitch", myname: "STS9 - Beyond Right Now (Glitch Mob Remix)"}, {myRhythm: "o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...o...............+...", myFile: "Liquor", myname: "Kanye West - Hold My Liquor"}, {myRhythm: "o...x...o...x...o...x...o...x...o...x...o...x...o...x...o...x.-.o...x...o...x...o...x...o...x...o...x...o...x...o...x...o...xx-.", myFile: "Heart", myname: "Savant - Heart"}, {myRhythm: "o.-.x...o...x...o.-.x...o...x...o.-.x...o...x...o.-.x...o...x...o.-.x...o...x...o.-.x...o...x...o..o..o...o...o.............x...", myFile: "Weapon", myname: "deadmau5 - Raise Your Weapon (Madeon Remix)"}, {myRhythm: "o...x..oo.o.x...o...x..oo.o.x...o...x..oo.o.x...o...x..oo.x.x...o...x..oo.o.x...o...x..oo.o.x...o...x..oo.o.x...o...x..oo.o.x...", myFile: "All-Star", myname: "Triple-Q - All Star Circulation"});
  429.     UIText.stxt = songs[0].myname.toUpperCase();
  430.     song = new Sound();
  431.     song.attachSound(songs[ss].myFile);
  432.     if (songs[ss].buildUp == 1)
  433.     {
  434.         delaySong(songs[ss].buildUpFile);
  435.     }
  436.     else
  437.     {
  438.         song.start(songOffset, 9999);
  439.         beat = nextup = 0;
  440.         xblur = 1;
  441.         yblur = 1;
  442.     }
  443.     blen = song.duration / length(songs[ss].myRhythm);
  444. }
  445. function checkForEndOfDelay()
  446. {
  447.     if (thebuildSong.position > thebuildSong.duration - 50)
  448.     {
  449.         song.start(songOffset, 9999);
  450.         beat = nextup = 0;
  451.         xblur = 1;
  452.         yblur = 1;
  453.         clearInterval(checkForEndBuild);
  454.     }
  455. }
  456. function delaySong(delayName)
  457. {
  458.     thebuildSong = new Sound();
  459.     thebuildSong.attachSound(delayName);
  460.     thebuildSong.start();
  461.     checkForEndBuild = setInterval(this, "checkForEndOfDelay", 5);
  462. }
  463. function changeSong()
  464. {
  465.     song.stop();
  466.     song.attachSound(songs[ss].myFile);
  467.     song.start(songOffset, 9999);
  468.     beat = nextup = 0;
  469.     xblur = yblur = 1;
  470.     UIText.stxt = songs[ss].myname.toUpperCase();
  471.     blen = song.duration / length(songs[ss].myRhythm);
  472. }
  473. function songForward()
  474. {
  475.     if (isShrek)
  476.     {
  477.         return;
  478.     }
  479.     if (ss < songs.length - 2)
  480.     {
  481.         ++ss;
  482.     }
  483.     else
  484.     {
  485.         ss = 0;
  486.     }
  487.     changeSong();
  488. }
  489. function songBack()
  490. {
  491.     if (isShrek)
  492.     {
  493.         return;
  494.     }
  495.     if (ss > 0)
  496.     {
  497.         --ss;
  498.     }
  499.     else
  500.     {
  501.         ss = songs.length - 2;
  502.     }
  503.     changeSong();
  504. }
  505. function incVolume()
  506. {
  507.     if (volume < 100)
  508.     {
  509.         volume = volume + 4;
  510.     }
  511.     muted = false;
  512.     updateVolume();
  513. }
  514. function decVolume()
  515. {
  516.     if (!muted && volume > 0)
  517.     {
  518.         volume = volume - 4;
  519.     }
  520.     updateVolume();
  521. }
  522. function toggleMute()
  523. {
  524.     if (muted)
  525.     {
  526.         volume = preMute;
  527.     }
  528.     else
  529.     {
  530.         preMute = volume;
  531.         volume = 0;
  532.     }
  533.     muted = !muted;
  534.     updateVolume();
  535. }
  536. function updateVolume()
  537. {
  538.     if (volume < 0)
  539.     {
  540.         volume = 0;
  541.     }
  542.     if (volume > 100)
  543.     {
  544.         volume = 100;
  545.     }
  546.     song.setVolume(volume);
  547.     UIText.volume = conv(volume, 2);
  548.     UIButtons.VolumeSlider.SliderVolume.VolumeKnob.volumeChanged(volume);
  549. }
  550. var changeAuto = false;
  551. var fullAuto = true;
  552. var song;
  553. var rhythm = "";
  554. var setHeight = 720;
  555. var setWidth = 1280;
  556. var preShrekSS = 0;
  557. var isShrek = false;
  558. var shrekActivated = false;
  559. var shrekedOut = false;
  560. var shrekChance = 2;
  561. var shrekColors = [9, 11, 12, 13, 20, 24, 28, 30, 33, 40, 45, 47, 52, 56, 60, 61];
  562. var imageQueue = new Array();
  563. var TheGif;
  564. var hidden = false;
  565. var animCurrentFrame = 1;
  566. var volume = 100;
  567. var preMute = 100;
  568. var muted = false;
  569. var mouseListener = new Object();
  570. dreck.enabled = false;
  571. UIText.volume = "64";
  572. UIText.mode = "NORMAL";
  573. colImgInitializations();
  574. changeImage();
  575. if (images[ii].anim == 1)
  576. {
  577.     animTimer = setInterval(animTick, images[ii].animationLength / images[ii].frameAmount);
  578.     animCurrentFrame = 1;
  579. }
  580. else
  581. {
  582.     clearInterval(animTimer);
  583.     animCurrentFrame = 1;
  584. }
  585. var fullscreen = new flash.geom.Rectangle(0, 0, 1280, 720);
  586. var origin = new flash.geom.Point(0, 0);
  587. focusRect = false;
  588. tabEnabled = false;
  589. var bmp = new Array();
  590. x = 0;
  591. while (x < 2)
  592. {
  593.     bmp[x] = new flash.display.BitmapData(1280, 720, true, 4278190080);
  594.     ++x;
  595. }
  596. bh.attachBitmap(bmp[0], 0);
  597. br.attachBitmap(bmp[1], 1);
  598. bmp[0].copyPixels(TheGif, new flash.geom.Rectangle(0, 0, 1280, 720), origin);
  599. songStuff();
  600. _global.songList = songs.concat();
  601. this.desiredFrameRate = 60;
  602. Stage.scaleMode = "noScale";
  603. Stage.align = "TL";
  604. var resizeListener = new Object();
  605. resizeListener.onResize = function ()
  606. {
  607.     UIBeats._y = Stage.height - 720;
  608.     UIText._y = Stage.height - 720;
  609.     UIButtons._y = Stage.height - 720;
  610.     UIButtons._x = Stage.width - 1280;
  611.     btnUiHide._x = Stage.width - 1280;
  612.     if (Stage.width / Stage.height > 1.77777777778)
  613.     {
  614.         scale = 100 * Stage.height / 720;
  615.     }
  616.     else
  617.     {
  618.         scale = 100 * Stage.width / 1280;
  619.     }
  620.     bh._x = Stage.width / 2 - 640 * scale / 100;
  621.     bh._y = Stage.height / 2 - 360 * scale / 100;
  622.     bh._xscale = scale;
  623.     bh._yscale = scale;
  624.     br._xscale = 100 * Stage.width / 1280;
  625.     br._yscale = 100 * Stage.height / 720;
  626.     if (hidden)
  627.     {
  628.         btnUiHide._y = Stage.height - 665;
  629.     }
  630.     else
  631.     {
  632.         btnUiHide._y = Stage.height - 720;
  633.     }
  634.     blackThing._xscale = 100 * Stage.width / 1280;
  635.     blackThing._yscale = 100 * Stage.height / 720;
  636. }
  637. ;
  638. Stage.addListener(resizeListener);
  639. this.callFunctionInt = setInterval(this, "otherOnEnterFrame", 10 / this.desiredFrameRate);
  640. UIButtons.btnSongs.onRelease = function ()
  641. {
  642.     UIButtons.SongPicker._visible = !UIButtons.SongPicker._visible;
  643.     UIButtons.ImgPicker._visible = false;
  644.     UIButtons.helpBox._visible = false;
  645. }
  646. ;
  647. UIButtons.btnImgPicker.onRelease = function ()
  648. {
  649.     UIButtons.ImgPicker._visible = !UIButtons.ImgPicker._visible;
  650.     UIButtons.SongPicker._visible = false;
  651.     UIButtons.helpBox._visible = false;
  652. }
  653. ;
  654. btnUiHide.onRollOver = function ()
  655. {
  656.     this._alpha = 100;
  657. }
  658. ;
  659. btnUiHide.onRollOut = function ()
  660. {
  661.     if (hidden)
  662.     {
  663.         this._alpha = 0;
  664.         return;
  665.     }
  666.     if (btnUiHide.enabled)
  667.     {
  668.         this._alpha = 8;
  669.     }
  670. }
  671. ;
  672. UIText.credits.onRollOver = function ()
  673. {
  674.     this._alpha = 100;
  675. }
  676. ;
  677. UIText.credits.onRollOut = function ()
  678. {
  679.     this._alpha = 14;
  680. }
  681. ;
  682. UIText.credits.useHandCursor = false;
  683. dreck.onRelease = function ()
  684. {
  685.     if (isShrek)
  686.     {
  687.         isShrek = false;
  688.         ss = preShrekSS;
  689.         changeSong();
  690.         UIText.mode = "NORMAL";
  691.         dreck._alpha = 0;
  692.         dreck.enabled = false;
  693.         shrekActivated = false;
  694.         return;
  695.     }
  696.     isShrek = true;
  697.     preShrekSS = ss;
  698.     ss = songs.length - 1;
  699.     changeSong();
  700.     UIText.mode = "SHREK IS DRECK";
  701. }
  702. ;
  703. UIButtons.btnForward.onRelease = playForward;
  704. UIButtons.btnBack.onRelease = playBack;
  705. UIButtons.btnSongBack.onRelease = songBack;
  706. UIButtons.btnSongForward.onRelease = songForward;
  707. UIButtons.btnAuto.onRelease = playAuto;
  708. UIButtons.btnFullAuto.onRelease = playFullAuto;
  709. UIButtons.btnVolumeUp.onRelease = incVolume;
  710. UIButtons.btnVolumeDown.onRelease = decVolume;
  711. UIButtons.btnVolumeMute.onRelease = toggleMute;
  712. btnUiHide.onRelease = activate;
  713. btnUiHide.useHandCursor = true;
  714. UIButtons.showHelp.onRelease = toggleHelp;
  715. hiding = false;
  716. showing = false;
  717. keylistener = new Object();
  718. keylistener.onKeyDown = function ()
  719. {
  720.     if ((__reg0 = Key.getCode()) === 39)
  721.     {
  722.         playForward();
  723.         return;
  724.     }
  725.     else if (__reg0 === 37)
  726.     {
  727.         playBack();
  728.         return;
  729.     }
  730.     else if (__reg0 === 38)
  731.     {
  732.         songForward();
  733.         return;
  734.     }
  735.     else if (__reg0 === 40)
  736.     {
  737.         songBack();
  738.         return;
  739.     }
  740.     else if (__reg0 === 65)
  741.     {
  742.         playAuto();
  743.         return;
  744.     }
  745.     else if (__reg0 === 66)
  746.     {
  747.         nextAnimationFrame();
  748.         return;
  749.     }
  750.     else if (__reg0 === 67)
  751.     {
  752.         UIButtons.btnImgPicker.onRelease();
  753.         return;
  754.     }
  755.     else if (__reg0 === 70)
  756.     {
  757.         playFullAuto();
  758.         return;
  759.     }
  760.     else if (__reg0 === 71)
  761.     {
  762.         Stage.displayState = Stage.displayState == "normal" ? "fullScreen" : "normal";
  763.         return;
  764.     }
  765.     else if (__reg0 === 72)
  766.     {
  767.         activate();
  768.         return;
  769.     }
  770.     else if (__reg0 === 77)
  771.     {
  772.         toggleMute();
  773.         return;
  774.     }
  775.     else if (__reg0 === 83)
  776.     {
  777.         UIButtons.btnSongs.onRelease();
  778.         return;
  779.     }
  780.     else if (__reg0 === 189)
  781.     {
  782.         decVolume();
  783.         return;
  784.     }
  785.     else if (__reg0 === 109)
  786.     {
  787.         decVolume();
  788.         return;
  789.     }
  790.     else if (__reg0 !== 187)
  791.     {
  792.         if (__reg0 !== 107)
  793.         {
  794.             return;
  795.         }
  796.     }
  797.     incVolume();
  798.     return;
  799. }
  800. ;
  801. Key.addListener(keylistener);
  802. var blackening = false;
  803. resizeListener.onResize();
  804. mouseListener.onMouseWheel = function (delta)
  805. {
  806.     if (UIButtons.ImgPicker._visible)
  807.     {
  808.         UIButtons.ImgPicker.scrollNotify(delta);
  809.         return;
  810.     }
  811.     if (UIButtons.SongPicker._visible)
  812.     {
  813.         UIButtons.SongPicker.scrollNotify(delta);
  814.     }
  815. }
  816. ;
  817. Mouse.addListener(mouseListener);
  818. contains = function (input, arrayData)
  819. {
  820.     i = 0;
  821.     while (i < arrayData.length)
  822.     {
  823.         if (arrayData[i] == input)
  824.         {
  825.             return 1;
  826.         }
  827.         ++i;
  828.     }
  829.     return -1;
  830. }
  831. ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement