Advertisement
Guest User

[muffet] MainTimeline.as

a guest
Nov 1st, 2015
1,138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package Muffet62_fla
  2. {
  3.    import flash.display.MovieClip;
  4.    import flash.ui.ContextMenu;
  5.    import flash.events.ContextMenuEvent;
  6.    import flash.net.navigateToURL;
  7.    import flash.net.URLRequest;
  8.    import flash.events.Event;
  9.    import flash.events.MouseEvent;
  10.    import flash.text.TextField;
  11.    import flash.media.Sound;
  12.    import flash.media.SoundChannel;
  13.    import flash.media.SoundMixer;
  14.    import flash.events.KeyboardEvent;
  15.    import flash.media.SoundTransform;
  16.    import flash.ui.ContextMenuItem;
  17.    
  18.    public dynamic class MainTimeline extends MovieClip
  19.    {
  20.        
  21.       public var black:MovieClip;
  22.      
  23.       public var eggMenu:MovieClip;
  24.      
  25.       public var texts:MovieClip;
  26.      
  27.       public var thePreLoader:MovieClip;
  28.      
  29.       public var s:MovieClip;
  30.      
  31.       public var reloader:MovieClip;
  32.      
  33.       public var ea1:MovieClip;
  34.      
  35.       public var nigel:MovieClip;
  36.      
  37.       public var ea2:MovieClip;
  38.      
  39.       public var ea3:MovieClip;
  40.      
  41.       public var ea4:MovieClip;
  42.      
  43.       public var totalBytes:Number;
  44.      
  45.       public var loadedBytes:Number;
  46.      
  47.       public var my_menu:ContextMenu;
  48.      
  49.       public var my_thing;
  50.      
  51.       public var Egg:EasterEggCodeEngine;
  52.      
  53.       public var eggGoing:Boolean;
  54.      
  55.       public var started:int;
  56.      
  57.       public var pausePosition:int;
  58.      
  59.       public var endings;
  60.      
  61.       public var previousText;
  62.      
  63.       public var enteredEggText:String;
  64.      
  65.       public var eggPromptShowing:Boolean;
  66.      
  67.       public var eggText:TextField;
  68.      
  69.       public var shygirlSounds:Boolean;
  70.      
  71.       public var music:Boolean;
  72.      
  73.       public var track:Boolean;
  74.      
  75.       public var squish:Boolean;
  76.      
  77.       public var cumTrigger:Boolean;
  78.      
  79.       public var secondCumTrigger:Boolean;
  80.      
  81.       public var bgms:Sound;
  82.      
  83.       public var bgmChannel:SoundChannel;
  84.      
  85.       public var allSounds:Array;
  86.      
  87.       public var s1:Sound;
  88.      
  89.       public var s2:Sound;
  90.      
  91.       public var s3:Sound;
  92.      
  93.       public var s4:Sound;
  94.      
  95.       public var s5:Sound;
  96.      
  97.       public var regularText;
  98.      
  99.       public var shuffledRegularText:Array;
  100.      
  101.       public var randomPos:Number;
  102.      
  103.       public var shuffledRegularTextCounter;
  104.      
  105.       public var loopsWithoutTextCounter;
  106.      
  107.       public var i:int;
  108.      
  109.       public var cumText;
  110.      
  111.       public function MainTimeline()
  112.       {
  113.          super();
  114.          addFrameScript(0,this.frame1,1,this.frame2);
  115.       }
  116.      
  117.       public function openLink(param1:ContextMenuEvent) : void
  118.       {
  119.          navigateToURL(new URLRequest("http://meaconscientia.tumblr.com/"));
  120.       }
  121.      
  122.       public function loaderFrame(param1:Event) : *
  123.       {
  124.          trace("loading");
  125.          this.loadedBytes = stage.loaderInfo.bytesLoaded;
  126.          if(Math.round(this.loadedBytes / this.totalBytes * 100) < 100)
  127.          {
  128.             this.thePreLoader.gotoAndStop(Math.round(this.loadedBytes / this.totalBytes * 100));
  129.          }
  130.          else if(Math.round(this.loadedBytes / this.totalBytes * 100) == 100)
  131.          {
  132.             if(this.thePreLoader.currentFrame < 100)
  133.             {
  134.                this.thePreLoader.gotoAndPlay(100);
  135.             }
  136.             else if(this.thePreLoader.currentFrame == 135)
  137.             {
  138.                if(this.thePreLoader.isPlaying)
  139.                {
  140.                   this.thePreLoader.stop();
  141.                }
  142.                if(this.thePreLoader.getChildByName("playButton") != null)
  143.                {
  144.                   trace("Adding play");
  145.                   if(!this.thePreLoader.getChildByName("playButton").hasEventListener(MouseEvent.CLICK))
  146.                   {
  147.                      this.thePreLoader.getChildByName("playButton").addEventListener(MouseEvent.CLICK,this.playButtonClick);
  148.                   }
  149.                   if(!this.thePreLoader.getChildByName("u").hasEventListener(MouseEvent.CLICK))
  150.                   {
  151.                      this.thePreLoader.getChildByName("u").addEventListener(MouseEvent.CLICK,this.und);
  152.                   }
  153.                   if(!this.thePreLoader.getChildByName("b").hasEventListener(MouseEvent.CLICK))
  154.                   {
  155.                      this.thePreLoader.getChildByName("b").addEventListener(MouseEvent.CLICK,this.boo);
  156.                   }
  157.                }
  158.             }
  159.          }
  160.       }
  161.      
  162.       public function playButtonClick(param1:MouseEvent) : *
  163.       {
  164.          param1.currentTarget.removeEventListener(MouseEvent.CLICK,this.playButtonClick);
  165.          this.removeEventListener(Event.ENTER_FRAME,this.loaderFrame);
  166.          this.thePreLoader.addEventListener(Event.ENTER_FRAME,this.PLL);
  167.          this.thePreLoader.play();
  168.       }
  169.      
  170.       public function und(param1:MouseEvent) : *
  171.       {
  172.          navigateToURL(new URLRequest("http://store.steampowered.com/app/391540/"),"_blank");
  173.       }
  174.      
  175.       public function boo(param1:MouseEvent) : *
  176.       {
  177.          navigateToURL(new URLRequest("https://www.patreon.com/NotBoogie"),"_blank");
  178.       }
  179.      
  180.       public function PLL(param1:Event) : *
  181.       {
  182.          if(param1.target.currentFrame == param1.target.totalFrames)
  183.          {
  184.             param1.target.stop();
  185.             this.gotoAndPlay(2);
  186.             param1.target.removeEventListener(Event.ENTER_FRAME,this.PLL);
  187.          }
  188.       }
  189.      
  190.       public function randomSort(param1:*, param2:*) : Number
  191.       {
  192.          if(Math.random() < 0.5)
  193.          {
  194.             return -1;
  195.          }
  196.          return 1;
  197.       }
  198.      
  199.       public function resetButtonClick(param1:MouseEvent) : *
  200.       {
  201.          SoundMixer.stopAll();
  202.          this.cumTrigger = false;
  203.          if(this.music == false)
  204.          {
  205.             this.music = true;
  206.             this.bgmChannel = this.bgms.play(this.pausePosition,100);
  207.          }
  208.          this.reloader.getChildByName("resetButton").removeEventListener(MouseEvent.CLICK,this.resetButtonClick);
  209.          this.reloader.gotoAndStop(1);
  210.          gotoAndPlay(2);
  211.       }
  212.      
  213.       public function eggController(param1:Event) : *
  214.       {
  215.          if(this.eggMenu.currentFrame == 20)
  216.          {
  217.             this.eggMenu.stop();
  218.          }
  219.          else if(this.eggMenu.currentFrame == 80)
  220.          {
  221.             this.eggPromptShowing = false;
  222.             this.eggMenu.gotoAndStop(1);
  223.             this.enteredEggText = "";
  224.             this.eggText.text = this.enteredEggText;
  225.             this.eggMenu.removeEventListener(Event.ENTER_FRAME,this.eggController);
  226.          }
  227.       }
  228.      
  229.       public function checkText(... rest) : Boolean
  230.       {
  231.          var _loc2_:* = undefined;
  232.          var _loc3_:* = undefined;
  233.          for each(_loc2_ in rest)
  234.          {
  235.             trace(_loc2_);
  236.             for each(_loc3_ in _loc2_)
  237.             {
  238.                trace(_loc3_);
  239.                if(this.enteredEggText.toUpperCase().indexOf(_loc3_.toUpperCase()) >= 0)
  240.                {
  241.                   trace("FOUND");
  242.                   return true;
  243.                }
  244.             }
  245.          }
  246.          return false;
  247.       }
  248.      
  249.       public function keyDownListener(param1:KeyboardEvent) : *
  250.       {
  251.          if(this.eggPromptShowing == false)
  252.          {
  253.             if(param1.keyCode != 32)
  254.             {
  255.                this.eggMenu.play();
  256.                this.eggPromptShowing = true;
  257.                this.eggMenu.addEventListener(Event.ENTER_FRAME,this.eggController);
  258.             }
  259.          }
  260.          else
  261.          {
  262.             trace(this.eggMenu.g.eggTextField.text);
  263.             trace(this.eggText.text);
  264.             if(param1.charCode == 8)
  265.             {
  266.                if(this.eggText.text.length > 0)
  267.                {
  268.                   this.enteredEggText = this.enteredEggText.substring(0,this.enteredEggText.length - 1);
  269.                   this.eggText.text = this.enteredEggText;
  270.                }
  271.             }
  272.             else if(param1.charCode == 13)
  273.             {
  274.                trace("Entered");
  275.                if(this.enteredEggText.toUpperCase().indexOf("BOOGIE") >= 0 || this.enteredEggText.toUpperCase().indexOf("STOMACH") >= 0 || this.enteredEggText.toUpperCase().indexOf("GUT") >= 0 || this.enteredEggText.toUpperCase().indexOf("BELLY") >= 0 || this.enteredEggText.toUpperCase().indexOf("VORE") >= 0 || this.enteredEggText.toUpperCase().indexOf("LEGS") >= 0 || this.enteredEggText.toUpperCase().indexOf("BULGE") >= 0 || this.enteredEggText.toUpperCase().indexOf("LATEX") >= 0 || this.enteredEggText.toUpperCase().indexOf("MUSIC") >= 0 || this.enteredEggText.toUpperCase().indexOf("VOICE") >= 0 || this.enteredEggText.toUpperCase().indexOf("SIZE") >= 0 || this.enteredEggText.toUpperCase().indexOf("SHORT") >= 0 || this.enteredEggText.toUpperCase().indexOf("DANCING") >= 0 || this.enteredEggText.toUpperCase().indexOf("TOBY") >= 0 || this.enteredEggText.toUpperCase().indexOf("NIGEL") >= 0 || this.enteredEggText.toUpperCase().indexOf("THORNBERRY") >= 0)
  276.                {
  277.                   this.eggPromptShowing = false;
  278.                   this.eggText.text = "";
  279.                   this.eggMenu.gotoAndStop(1);
  280.                   this.reloader.getChildByName("resetButton").removeEventListener(MouseEvent.CLICK,this.resetButtonClick);
  281.                   this.reloader.gotoAndStop(1);
  282.                   this.texts.gotoAndStop(1);
  283.                   this.pausePosition = this.bgmChannel.position;
  284.                   this.bgmChannel.stop();
  285.                   SoundMixer.stopAll();
  286.                   this.eggGoing = true;
  287.                   gotoAndPlay(156);
  288.                   this.music = false;
  289.                }
  290.                else
  291.                {
  292.                   if(this.checkText(["FUCK","SHIT","PISS","ASS","CUNT","DICK","COCK"]))
  293.                   {
  294.                      this.eggText.text = "THIS IS A CHILDREN\'S SHOW ASSHOLE";
  295.                   }
  296.                   else if(this.checkText(["MIDNA","TRISTANA"]))
  297.                   {
  298.                      navigateToURL(new URLRequest("https://youtu.be/1_xCx9sVYmU?t=4m7s"),"_blank");
  299.                   }
  300.                   else if(this.checkText(["MELOME"]))
  301.                   {
  302.                      navigateToURL(new URLRequest("https://youtu.be/NLJYdkJpViQ?t=9s"),"_blank");
  303.                   }
  304.                   else if(this.enteredEggText.length == 0)
  305.                   {
  306.                      this.eggText.text = "Speechless eh?  I can hardly say I\'m surprised";
  307.                   }
  308.                   else if(this.checkText(["FREAKAZOID","UNDYNE"]))
  309.                   {
  310.                      navigateToURL(new URLRequest("https://www.youtube.com/watch?v=K5DH7XY8Tho"),"_blank");
  311.                   }
  312.                   else if(this.checkText(["PUPSPIDER","MUFFET","SPIDER","MULTIPLE","CHUCK NORRIS"]))
  313.                   {
  314.                      navigateToURL(new URLRequest("https://www.youtube.com/watch?v=O-qloBShqCo"),"_blank");
  315.                   }
  316.                   else if(this.checkText(["SONG","DRAGONFORCE"]))
  317.                   {
  318.                      navigateToURL(new URLRequest("https://soundcloud.com/wendyfag/through-the-core-and-ruins"),"_blank");
  319.                   }
  320.                   else if(this.checkText(["TEM"]))
  321.                   {
  322.                      navigateToURL(new URLRequest("http://www.themostamazingwebsiteontheinternet.com/"),"_blank");
  323.                   }
  324.                   else if(this.checkText(["SONIC","SANIC"]))
  325.                   {
  326.                      navigateToURL(new URLRequest("https://www.youtube.com/watch?v=PrLSgac3WmM"),"_blank");
  327.                   }
  328.                   else
  329.                   {
  330.                      this.eggText.text = "YOU GET A GOLD STAR!";
  331.                      this.eggMenu.play();
  332.                   }
  333.                   if(this.checkText(["FUCK YOU"]))
  334.                   {
  335.                      this.eggText.text = "AYY FUG YOU 2 BUDDY";
  336.                   }
  337.                   this.eggMenu.play();
  338.                }
  339.             }
  340.             else
  341.             {
  342.                this.enteredEggText = this.enteredEggText + String.fromCharCode(param1.charCode);
  343.                this.eggText.text = this.enteredEggText;
  344.                trace("aaa");
  345.             }
  346.          }
  347.          if(this.eggPromptShowing == false)
  348.          {
  349.             if(param1.keyCode == 49)
  350.             {
  351.                if(this.music == true)
  352.                {
  353.                   this.music = false;
  354.                   this.pausePosition = this.bgmChannel.position;
  355.                   this.bgmChannel.stop();
  356.                }
  357.                else
  358.                {
  359.                   this.music = true;
  360.                   this.bgmChannel = this.bgms.play(this.pausePosition,100);
  361.                }
  362.             }
  363.             else if(param1.keyCode == 32)
  364.             {
  365.                if(this.cumTrigger == false)
  366.                {
  367.                   this.cumTrigger = true;
  368.                }
  369.                else
  370.                {
  371.                   this.secondCumTrigger = true;
  372.                }
  373.             }
  374.          }
  375.          trace(param1.keyCode.toString());
  376.       }
  377.      
  378.       public function frameCheck(param1:Event) : *
  379.       {
  380.          var surrender:Function = null;
  381.          var e:Event = param1;
  382.          var playRandomSound:Function = function():*
  383.          {
  384.             var _loc1_:* = Math.round(Math.random());
  385.             if(_loc1_ == 0)
  386.             {
  387.                _loc1_ = -1;
  388.             }
  389.             var _loc2_:* = (Math.random() * 40 + 60) / 100;
  390.             var _loc3_:SoundTransform = new SoundTransform(_loc2_,_loc1_ * Math.random());
  391.             var _loc4_:SoundChannel = allSounds[Math.round(Math.random() * (allSounds.length - 1))].play(0,1,_loc3_);
  392.          };
  393.          surrender = function(param1:MouseEvent):*
  394.          {
  395.             SoundMixer.stopAll();
  396.             s.gotoAndStop(1);
  397.             gotoAndPlay(556);
  398.          };
  399.          if(this.black.alpha > 0)
  400.          {
  401.             this.black.alpha = this.black.alpha - 0.02;
  402.          }
  403.          if(this.eggGoing == false)
  404.          {
  405.             if(this.currentFrame == 9 || this.currentFrame == 26 || this.currentFrame == 43 || this.currentFrame == 60 || this.currentFrame == 71 || this.currentFrame == 82)
  406.             {
  407.                if(this.squish == true)
  408.                {
  409.                   playRandomSound();
  410.                }
  411.             }
  412.             if(this.currentFrame == 36)
  413.             {
  414.                if(this.cumTrigger == false)
  415.                {
  416.                   gotoAndPlay(2);
  417.                }
  418.                else
  419.                {
  420.                   gotoAndPlay(37);
  421.                }
  422.             }
  423.             else if(this.currentFrame == 41)
  424.             {
  425.                if(this.cumTrigger == true)
  426.                {
  427.                   this.texts.gotoAndPlay(516);
  428.                }
  429.             }
  430.             else if(this.currentFrame == 124)
  431.             {
  432.                gotoAndPlay(99);
  433.             }
  434.             else if(this.currentFrame == 354)
  435.             {
  436.                this.secondCumTrigger = false;
  437.                gotoAndPlay(179);
  438.             }
  439.             else if(this.currentFrame == 59)
  440.             {
  441.                this.music = false;
  442.                this.pausePosition = this.bgmChannel.position;
  443.                this.bgmChannel.stop();
  444.             }
  445.             else if(this.currentFrame == 30)
  446.             {
  447.                if(this.texts.currentFrame == 1)
  448.                {
  449.                   if(Math.floor(Math.random() * 5) == 1 || this.loopsWithoutTextCounter > 5)
  450.                   {
  451.                      if(this.shuffledRegularTextCounter > this.shuffledRegularText.length)
  452.                      {
  453.                         this.shuffledRegularTextCounter = 0;
  454.                      }
  455.                      trace(this.shuffledRegularText);
  456.                      trace("shuffledRegularTextCounter: " + this.shuffledRegularTextCounter + " | " + this.shuffledRegularText[this.shuffledRegularTextCounter]);
  457.                      this.texts.gotoAndPlay(this.shuffledRegularText[this.shuffledRegularTextCounter]);
  458.                      this.shuffledRegularTextCounter = this.shuffledRegularTextCounter + 1;
  459.                      this.loopsWithoutTextCounter = 0;
  460.                   }
  461.                   else
  462.                   {
  463.                      this.loopsWithoutTextCounter = this.loopsWithoutTextCounter + 1;
  464.                   }
  465.                }
  466.             }
  467.             else if(this.currentFrame == 110)
  468.             {
  469.                if(this.texts.currentFrame == 1)
  470.                {
  471.                   if(Math.floor(Math.random() * 10) == 1)
  472.                   {
  473.                      this.texts.gotoAndPlay(this.cumText[Math.floor(Math.random() * this.cumText.length)]);
  474.                   }
  475.                }
  476.             }
  477.             else if(this.currentFrame == 95)
  478.             {
  479.                if(this.reloader.getChildByName("resetButton") != null)
  480.                {
  481.                   trace("reset exists");
  482.                   trace("Adding reset");
  483.                   if(!this.reloader.getChildByName("resetButton").hasEventListener(MouseEvent.CLICK))
  484.                   {
  485.                      this.reloader.getChildByName("resetButton").addEventListener(MouseEvent.CLICK,this.resetButtonClick);
  486.                      this.reloader.play();
  487.                   }
  488.                }
  489.             }
  490.          }
  491.          else if(this.currentFrame == 555)
  492.          {
  493.             stop();
  494.             if(this.s.currentFrame == 1)
  495.             {
  496.                this.s.play();
  497.             }
  498.             else if(this.s.currentFrame == 15)
  499.             {
  500.                this.s.stop();
  501.             }
  502.             if(!this.s.getChildByName("surrend").hasEventListener(MouseEvent.CLICK))
  503.             {
  504.                this.s.getChildByName("surrend").addEventListener(MouseEvent.CLICK,surrender);
  505.             }
  506.          }
  507.          else if(this.currentFrame == 1125)
  508.          {
  509.             this.eggGoing = false;
  510.             gotoAndPlay(2);
  511.             this.s.gotoAndStop(1);
  512.             SoundMixer.stopAll();
  513.             this.cumTrigger = false;
  514.             if(this.music == false)
  515.             {
  516.                this.music = true;
  517.                this.bgmChannel = this.bgms.play(this.pausePosition,100);
  518.             }
  519.             navigateToURL(new URLRequest("https://www.youtube.com/watch?v=eUYeBaCoseE"),"_blank");
  520.          }
  521.       }
  522.      
  523.       public function textcheck(param1:Event) : *
  524.       {
  525.          if(this.isAtEndFrame(this.texts.currentFrame))
  526.          {
  527.             this.texts.gotoAndStop(1);
  528.          }
  529.       }
  530.      
  531.       public function isAtEndFrame(param1:int) : Boolean
  532.       {
  533.          var _loc2_:* = 0;
  534.          while(_loc2_ < this.endings.length)
  535.          {
  536.             if(param1 == this.endings[_loc2_])
  537.             {
  538.                return true;
  539.             }
  540.             _loc2_ = _loc2_ + 1;
  541.          }
  542.          return false;
  543.       }
  544.      
  545.       function frame1() : *
  546.       {
  547.          if(!this.hasEventListener("loaderFrame"))
  548.          {
  549.             this.totalBytes = stage.loaderInfo.bytesTotal;
  550.             this.addEventListener(Event.ENTER_FRAME,this.loaderFrame);
  551.             trace("Setting up preloader");
  552.             this.stop();
  553.             this.thePreLoader.stop();
  554.             this.my_menu = new ContextMenu();
  555.             this.my_menu.hideBuiltInItems();
  556.             this.my_thing = new ContextMenuItem("Happy Halloween!");
  557.             this.my_menu.customItems.push(this.my_thing);
  558.             this.my_thing.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,this.openLink);
  559.             contextMenu = this.my_menu;
  560.          }
  561.       }
  562.      
  563.       function frame2() : *
  564.       {
  565.          this.eggGoing = false;
  566.          this.endings = [74,149,280,374,456,515,579,669,726,810,878,962,1032,1086,1144,1220,1325,1395,1484,1565,1660,1735,1815,1894];
  567.          this.previousText = 0;
  568.          if(this.started == 0)
  569.          {
  570.             this.enteredEggText = "";
  571.             this.eggPromptShowing = false;
  572.             this.eggText = this.eggMenu.g.eggTextField;
  573.             this.eggMenu.stop();
  574.             this.Egg = new EasterEggCodeEngine("LEGS");
  575.             this.started = 1;
  576.             this.texts.stop();
  577.             this.reloader.stop();
  578.             this.s.stop();
  579.             this.texts.addEventListener(Event.ENTER_FRAME,this.textcheck);
  580.             this.shygirlSounds = true;
  581.             this.music = true;
  582.             this.track = true;
  583.             this.squish = true;
  584.             this.cumTrigger = false;
  585.             this.secondCumTrigger = false;
  586.             trace("AAAAAAAAAA");
  587.             this.bgms = new bgm();
  588.             this.bgmChannel = this.bgms.play(0,100);
  589.             this.s1 = new M1();
  590.             this.s2 = new M2();
  591.             this.s3 = new M3();
  592.             this.s4 = new M4();
  593.             this.s5 = new M5();
  594.             this.allSounds = [this.s1,this.s2,this.s3,this.s4,this.s5];
  595.             this.regularText = [75,150,281,375,581,670,727,811,879,963,1033,1222,1566,1661,1736,1816];
  596.             this.shuffledRegularText = new Array(this.regularText.length);
  597.             this.randomPos = 0;
  598.             this.shuffledRegularTextCounter = 0;
  599.             this.loopsWithoutTextCounter = 0;
  600.             this.i = 0;
  601.             while(this.i < this.shuffledRegularText.length)
  602.             {
  603.                this.randomPos = int(Math.random() * this.regularText.length);
  604.                this.shuffledRegularText[this.i] = this.regularText.splice(this.randomPos,1)[0];
  605.                this.i++;
  606.             }
  607.             this.cumText = [2,457,1087,1146,1327,1397,1485];
  608.             stage.addEventListener(KeyboardEvent.KEY_DOWN,this.keyDownListener);
  609.             stage.addEventListener(Event.ENTER_FRAME,this.frameCheck);
  610.          }
  611.       }
  612.    }
  613. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement