home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / aether.swf / scripts / Aether_fla / MainTimeline.as < prev    next >
Encoding:
Text File  |  2008-09-11  |  131.1 KB  |  3,482 lines

  1. package Aether_fla
  2. {
  3.    import adobe.utils.*;
  4.    import flash.accessibility.*;
  5.    import flash.display.*;
  6.    import flash.errors.*;
  7.    import flash.events.*;
  8.    import flash.external.*;
  9.    import flash.filters.*;
  10.    import flash.geom.*;
  11.    import flash.media.*;
  12.    import flash.net.*;
  13.    import flash.printing.*;
  14.    import flash.system.*;
  15.    import flash.text.*;
  16.    import flash.ui.*;
  17.    import flash.utils.*;
  18.    import flash.xml.*;
  19.    
  20.    public dynamic class MainTimeline extends MovieClip
  21.    {
  22.        
  23.       
  24.       public var durrr:int;
  25.       
  26.       public var floating:Boolean;
  27.       
  28.       public var starsC:MovieClip;
  29.       
  30.       public var planet1mass:*;
  31.       
  32.       public var back2:MovieClip;
  33.       
  34.       public var gemed:Boolean;
  35.       
  36.       public var currentCloud:MovieClip;
  37.       
  38.       public var strength:Number;
  39.       
  40.       public var bg:MovieClip;
  41.       
  42.       public var speed:Vector;
  43.       
  44.       public var center:Vector;
  45.       
  46.       public var cc:int;
  47.       
  48.       public var stars:Array;
  49.       
  50.       public var bn:Number;
  51.       
  52.       public var SFX:Array;
  53.       
  54.       public var paus:Boolean;
  55.       
  56.       public var i:int;
  57.       
  58.       public var j:int;
  59.       
  60.       public var cn:Number;
  61.       
  62.       public var pos2:Vector;
  63.       
  64.       public var n:*;
  65.       
  66.       public var currentPlanet:*;
  67.       
  68.       public var f:int;
  69.       
  70.       public var speedFactor:Number;
  71.       
  72.       public var grounded:Boolean;
  73.       
  74.       public var kRight:Boolean;
  75.       
  76.       public var k:int;
  77.       
  78.       public var kUp:Boolean;
  79.       
  80.       public var abs:*;
  81.       
  82.       public var sfx:SoundChannel;
  83.       
  84.       public var dir:Dir;
  85.       
  86.       public var won:Array;
  87.       
  88.       public var momentum:Number;
  89.       
  90.       public var beatgame:Boolean;
  91.       
  92.       public var framey:String;
  93.       
  94.       public var area:*;
  95.       
  96.       public var srange:Number;
  97.       
  98.       public var flasher:Flasher;
  99.       
  100.       public var talk:Talk;
  101.       
  102.       public var ff:int;
  103.       
  104.       public var background5:Background5;
  105.       
  106.       public var speedC:Vector;
  107.       
  108.       public var clouds:Array;
  109.       
  110.       public var gg:int;
  111.       
  112.       public var explode:Boolean;
  113.       
  114.       public var back:MovieClip;
  115.       
  116.       public var density:*;
  117.       
  118.       public var speedP:Number;
  119.       
  120.       public var loadPerc:Number;
  121.       
  122.       public var i8:int;
  123.       
  124.       public var crazies:Array;
  125.       
  126.       public var fished:int;
  127.       
  128.       public var rope:MovieClip;
  129.       
  130.       public var GR:Vector;
  131.       
  132.       public var effects:MovieClip;
  133.       
  134.       public var j8:int;
  135.       
  136.       public var sdensity:*;
  137.       
  138.       public var pollupy:Number;
  139.       
  140.       public var sqrt:*;
  141.       
  142.       public var kA:Boolean;
  143.       
  144.       public var kD:Boolean;
  145.       
  146.       public var range:Number;
  147.       
  148.       public var kM:Boolean;
  149.       
  150.       public var kS:Boolean;
  151.       
  152.       public var kW:Boolean;
  153.       
  154.       public var btn1:SimpleButton;
  155.       
  156.       public var btn3:SimpleButton;
  157.       
  158.       public var mc2:MovieClip;
  159.       
  160.       public var mc3:MovieClip;
  161.       
  162.       public var splashes:Array;
  163.       
  164.       public var earths:Array;
  165.       
  166.       public var bubbles:Array;
  167.       
  168.       public var planet1r2:*;
  169.       
  170.       public var gemSounds:Array;
  171.       
  172.       public var fader:Number;
  173.       
  174.       public var transformSFX:SoundTransform;
  175.       
  176.       public var n2:*;
  177.       
  178.       public var bmp:Bitmap;
  179.       
  180.       public var n8:int;
  181.       
  182.       public var mc:MovieClip;
  183.       
  184.       public var planet:MovieClip;
  185.       
  186.       public var planet2:MovieClip;
  187.       
  188.       public var linkAG:SimpleButton;
  189.       
  190.       public var mp:int;
  191.       
  192.       public var fadery:MovieClip;
  193.       
  194.       public var planet1mass2:*;
  195.       
  196.       public var mus2:T2;
  197.       
  198.       public var mus3:T3;
  199.       
  200.       public var mus4:T4;
  201.       
  202.       public var mus5:T5;
  203.       
  204.       public var mus1:T1;
  205.       
  206.       public var box:MovieClip;
  207.       
  208.       public var musB:TB;
  209.       
  210.       public var planets:Array;
  211.       
  212.       public var talph:Number;
  213.       
  214.       public var planet1r:*;
  215.       
  216.       public var ttt:int;
  217.       
  218.       public var timerGGG:int;
  219.       
  220.       public var shrink:Boolean;
  221.       
  222.       public var namesT:int;
  223.       
  224.       public var len:Number;
  225.       
  226.       public var brange:Number;
  227.       
  228.       public var linkED:SimpleButton;
  229.       
  230.       public var anchored:Boolean;
  231.       
  232.       public var wholegame:MovieClip;
  233.       
  234.       public var Gravity:Vector;
  235.       
  236.       public var str:Number;
  237.       
  238.       public var transform1:SoundTransform;
  239.       
  240.       public var transform2:SoundTransform;
  241.       
  242.       public var transform4:SoundTransform;
  243.       
  244.       public var cut:MovieClip;
  245.       
  246.       public var transform5:SoundTransform;
  247.       
  248.       public var bdensity:*;
  249.       
  250.       public var transformB:SoundTransform;
  251.       
  252.       public var fish:Array;
  253.       
  254.       public var sn:Number;
  255.       
  256.       public var stag:BitmapData;
  257.       
  258.       public var grav:Vector;
  259.       
  260.       public var linkGG:SimpleButton;
  261.       
  262.       public var pos:Vector;
  263.       
  264.       public var arr:Array;
  265.       
  266.       public var transform3:SoundTransform;
  267.       
  268.       public var transformW:SoundTransform;
  269.       
  270.       public var aliens:Array;
  271.       
  272.       public var linkAG2:SimpleButton;
  273.       
  274.       public var particles:Array;
  275.       
  276.       public var controls:int;
  277.       
  278.       public var ended:Boolean;
  279.       
  280.       public var bobber:Bobber;
  281.       
  282.       public var base:BitmapData;
  283.       
  284.       public var elastic:Number;
  285.       
  286.       public var gassed:int;
  287.       
  288.       public var pauzz:Paus;
  289.       
  290.       public var mass:Number;
  291.       
  292.       public var friction:Number;
  293.       
  294.       public var kLeft:Boolean;
  295.       
  296.       public var rspeed:Number;
  297.       
  298.       public var latching:Boolean;
  299.       
  300.       public var timeE:int;
  301.       
  302.       public var faderTIM:int;
  303.       
  304.       public var log:logo;
  305.       
  306.       public var names:Names;
  307.       
  308.       public var hi1:Number;
  309.       
  310.       public var hi2:Number;
  311.       
  312.       public var kSpace:Boolean;
  313.       
  314.       public var mooned:int;
  315.       
  316.       public var Vecg:Vector;
  317.       
  318.       public var Vec:Vector;
  319.       
  320.       public var Vecp:Vector;
  321.       
  322.       public var sarea:*;
  323.       
  324.       public var ggg:*;
  325.       
  326.       public var channel2:SoundChannel;
  327.       
  328.       public var channel4:SoundChannel;
  329.       
  330.       public var channel1:SoundChannel;
  331.       
  332.       public var channel3:SoundChannel;
  333.       
  334.       public var channel5:SoundChannel;
  335.       
  336.       public var wi1:Number;
  337.       
  338.       public var wi2:Number;
  339.       
  340.       public var foregrounds:Array;
  341.       
  342.       public var gemCounter:int;
  343.       
  344.       public var charH:Number;
  345.       
  346.       public var channelW:SoundChannel;
  347.       
  348.       public var channelB:SoundChannel;
  349.       
  350.       public var loadBX:TextField;
  351.       
  352.       public var bubblesC:MovieClip;
  353.       
  354.       public var kDown:Boolean;
  355.       
  356.       public var cam:Cam;
  357.       
  358.       public var container1:MovieClip;
  359.       
  360.       public var container2:MovieClip;
  361.       
  362.       public var container3:MovieClip;
  363.       
  364.       public var container4:MovieClip;
  365.       
  366.       public var win1:Win1;
  367.       
  368.       public var win2:Win2;
  369.       
  370.       public var win3:Win3;
  371.       
  372.       public var win4:Win4;
  373.       
  374.       public var barea:*;
  375.       
  376.       public var inside:Boolean;
  377.       
  378.       public function MainTimeline()
  379.       {
  380.          super();
  381.          addFrameScript(0,frame1,2,frame3,3,frame4,4,frame5,5,frame6,6,frame7,7,frame8,8,frame9);
  382.       }
  383.       
  384.       public function backBTN(param1:Event) : *
  385.       {
  386.          framey = "game";
  387.          fadery.play();
  388.       }
  389.       
  390.       public function ag_btnclick2(param1:MouseEvent) : *
  391.       {
  392.          navigateToURL(new URLRequest("http://www.armorgames.com"),"_blank");
  393.       }
  394.       
  395.       public function ed_btnclick(param1:MouseEvent) : *
  396.       {
  397.          navigateToURL(new URLRequest("http://www.thisisacryforhelp.com"),"_blank");
  398.       }
  399.       
  400.       public function goBTN(param1:Event) : *
  401.       {
  402.          cut.play();
  403.       }
  404.       
  405.       public function updo() : *
  406.       {
  407.          gotoAndStop(framey);
  408.       }
  409.       
  410.       internal function frame5() : *
  411.       {
  412.          stop();
  413.          btn1.addEventListener(MouseEvent.CLICK,backBTN,false,0,true);
  414.       }
  415.       
  416.       internal function frame9() : *
  417.       {
  418.          stop();
  419.          btn1.addEventListener(MouseEvent.CLICK,backBTN2,false,0,true);
  420.       }
  421.       
  422.       internal function frame6() : *
  423.       {
  424.          stop();
  425.          framey = "inst";
  426.          btn1.addEventListener(MouseEvent.CLICK,goBTN,false,0,true);
  427.       }
  428.       
  429.       internal function frame1() : *
  430.       {
  431.          linkAG.addEventListener(MouseEvent.CLICK,ag_btnclick,false,0,true);
  432.          linkGG.addEventListener(MouseEvent.CLICK,gg_btnclick,false,0,true);
  433.          linkED.addEventListener(MouseEvent.CLICK,ed_btnclick,false,0,true);
  434.          stop();
  435.          base = new BitmapData(100,100,true,0);
  436.          stag = new BitmapData(stage.stageWidth,stage.stageHeight,true,2434861);
  437.          bmp = new Bitmap(stag);
  438.          box.addChild(bmp);
  439.          log = new logo();
  440.          base.draw(log);
  441.          abs = Math.abs;
  442.          sqrt = Math.sqrt;
  443.          arr = new Array();
  444.          loadPerc = new Number(0);
  445.          shrink = false;
  446.          wi1 = (stage.stageWidth - 400) / 2;
  447.          hi1 = (stage.stageHeight - 400) / 2;
  448.          wi2 = (stage.stageWidth - 200) / 2;
  449.          hi2 = (stage.stageHeight - 200) / 2;
  450.          timerGGG = 30;
  451.          i8 = 0;
  452.          while(i8 < 100)
  453.          {
  454.             j8 = 0;
  455.             while(j8 < 100)
  456.             {
  457.                arr.push(new Array(0,0,0,0,0));
  458.                n8 = arr.length - 1;
  459.                arr[n8][0] = base.getPixel32(i8,j8);
  460.                arr[n8][1] = new Number(i8 * 4 + wi1);
  461.                arr[n8][2] = new Number(j8 * 4 + hi1);
  462.                arr[n8][3] = Math.random() * 700;
  463.                arr[n8][4] = Math.random() * 700;
  464.                arr[n8][5] = Math.random() * 10 - 5;
  465.                arr[n8][6] = Math.random() * 10 - 5;
  466.                arr[n8][7] = i8;
  467.                arr[n8][8] = j8;
  468.                ++j8;
  469.             }
  470.             ++i8;
  471.          }
  472.          explode = false;
  473.          loaderInfo.addEventListener(ProgressEvent.PROGRESS,calculatepcent,false,0,true);
  474.          addEventListener(Event.ENTER_FRAME,update2,false,0,true);
  475.          stage.addEventListener(MouseEvent.MOUSE_DOWN,expl,false,0,true);
  476.          stage.addEventListener(MouseEvent.MOUSE_UP,uexpl,false,0,true);
  477.          stage.showDefaultContextMenu = false;
  478.          stage.quality = "MEDIUM";
  479.          framey = "title";
  480.          try
  481.          {
  482.             MochiBot.track(this,"c0587ff8");
  483.          }
  484.          catch(e:Error)
  485.          {
  486.          }
  487.       }
  488.       
  489.       public function advance() : *
  490.       {
  491.          framey = "title";
  492.          fadery.play();
  493.       }
  494.       
  495.       public function update2(param1:Event) : *
  496.       {
  497.          var _loc2_:Boolean = false;
  498.          var _loc3_:int = 0;
  499.          var _loc4_:Number = NaN;
  500.          if(loadPerc >= 1)
  501.          {
  502.             loadPerc = 1;
  503.             shrink = true;
  504.          }
  505.          loadBX.text = String(Math.round(loadPerc * 100)) + "% Loaded";
  506.          log.gotoAndStop(Math.floor(loadPerc * 100) + 1);
  507.          base.draw(log);
  508.          _loc2_ = false;
  509.          if(shrink == true)
  510.          {
  511.             if(abs(mouseX - stage.stageWidth / 2) <= 50 && abs(mouseY - stage.stageHeight / 2) < 50)
  512.             {
  513.                _loc2_ = true;
  514.             }
  515.          }
  516.          stag.colorTransform(new Rectangle(0,0,stage.stageWidth,stage.stageHeight),new ColorTransform(1,1,1,0.9,0,0,0,0));
  517.          if(timerGGG > 0)
  518.          {
  519.             _loc3_ = 0;
  520.             while(_loc3_ < arr.length)
  521.             {
  522.                if(timerGGG <= 0)
  523.                {
  524.                   arr[_loc3_][0] = 0;
  525.                }
  526.                else
  527.                {
  528.                   arr[_loc3_][0] = base.getPixel32(arr[_loc3_][7],arr[_loc3_][8]);
  529.                }
  530.                if(!shrink)
  531.                {
  532.                   arr[_loc3_][5] += (arr[_loc3_][1] - arr[_loc3_][3]) / 50;
  533.                   arr[_loc3_][6] += (arr[_loc3_][2] - arr[_loc3_][4]) / 50;
  534.                   _loc4_ = sqrt((arr[_loc3_][3] - mouseX) * (arr[_loc3_][3] - mouseX) + (arr[_loc3_][4] - mouseY) * (arr[_loc3_][4] - mouseY));
  535.                   if(explode)
  536.                   {
  537.                      arr[_loc3_][5] += 450 * (arr[_loc3_][3] - mouseX) / (_loc4_ * _loc4_ + 30);
  538.                      arr[_loc3_][6] += 450 * (arr[_loc3_][4] - mouseY) / (_loc4_ * _loc4_ + 30);
  539.                   }
  540.                   else
  541.                   {
  542.                      arr[_loc3_][5] += 90 * (arr[_loc3_][3] - mouseX) / (_loc4_ * _loc4_ + 30);
  543.                      arr[_loc3_][6] += 90 * (arr[_loc3_][4] - mouseY) / (_loc4_ * _loc4_ + 30);
  544.                   }
  545.                }
  546.                else
  547.                {
  548.                   arr[_loc3_][3] += ((arr[_loc3_][1] - wi1) / 2 + wi2 - arr[_loc3_][3]) / 5;
  549.                   arr[_loc3_][4] += ((arr[_loc3_][2] - hi1) / 2 + hi2 - arr[_loc3_][4]) / 5;
  550.                   arr[_loc3_][5] = 0;
  551.                   arr[_loc3_][6] = 0;
  552.                }
  553.                arr[_loc3_][5] *= 0.95;
  554.                arr[_loc3_][6] *= 0.95;
  555.                if(arr[_loc3_][5] > 50)
  556.                {
  557.                   arr[_loc3_][5] = 50;
  558.                }
  559.                if(arr[_loc3_][5] < -50)
  560.                {
  561.                   arr[_loc3_][5] = -50;
  562.                }
  563.                if(arr[_loc3_][6] > 50)
  564.                {
  565.                   arr[_loc3_][6] = 50;
  566.                }
  567.                if(arr[_loc3_][6] < -50)
  568.                {
  569.                   arr[_loc3_][6] = -50;
  570.                }
  571.                arr[_loc3_][3] += arr[_loc3_][5];
  572.                arr[_loc3_][4] += arr[_loc3_][6];
  573.                stag.fillRect(new Rectangle(arr[_loc3_][3],arr[_loc3_][4],2,2),arr[_loc3_][0]);
  574.                _loc3_++;
  575.             }
  576.          }
  577.          bmp.bitmapData = stag;
  578.          if(shrink == true)
  579.          {
  580.             --timerGGG;
  581.             if(timerGGG == 0)
  582.             {
  583.                box.addChild(log);
  584.                log.scaleX = 2;
  585.                log.scaleY = 2;
  586.                log.x = wi2;
  587.                log.y = hi2;
  588.             }
  589.             if(timerGGG <= 0)
  590.             {
  591.                if(abs(mouseX - stage.stageWidth / 2) <= 100 && abs(mouseY - stage.stageHeight / 2) < 100)
  592.                {
  593.                   log.gotoAndStop(101);
  594.                }
  595.                else
  596.                {
  597.                   log.gotoAndStop(100);
  598.                }
  599.                if(explode && abs(mouseX - stage.stageWidth / 2) <= 100 && abs(mouseY - stage.stageHeight / 2) < 100)
  600.                {
  601.                   framey = "logos";
  602.                   fadery.play();
  603.                   loaderInfo.removeEventListener(ProgressEvent.PROGRESS,calculatepcent);
  604.                   removeEventListener(Event.ENTER_FRAME,update2);
  605.                   stage.removeEventListener(MouseEvent.MOUSE_DOWN,expl);
  606.                   stage.removeEventListener(MouseEvent.MOUSE_UP,uexpl);
  607.                }
  608.             }
  609.             explode = false;
  610.          }
  611.       }
  612.       
  613.       internal function frame7() : *
  614.       {
  615.          stop();
  616.          paus = false;
  617.          pauzz = new Paus();
  618.          clouds = new Array();
  619.          crazies = new Array();
  620.          back = new MovieClip();
  621.          back2 = new MovieClip();
  622.          mc = new MovieClip();
  623.          mc2 = new MovieClip();
  624.          mc3 = new MovieClip();
  625.          starsC = new MovieClip();
  626.          container1 = new MovieClip();
  627.          mc.addChild(back2);
  628.          mc.addChild(starsC);
  629.          mc.addChild(back);
  630.          container2 = new MovieClip();
  631.          container3 = new MovieClip();
  632.          container4 = new MovieClip();
  633.          bg = new BG();
  634.          bubblesC = new MovieClip();
  635.          effects = new MovieClip();
  636.          bubbles = new Array();
  637.          aliens = new Array();
  638.          ttt = 0;
  639.          Gravity = new Vector(0,0);
  640.          mc.addChild(bg);
  641.          wholegame.addChild(mc3);
  642.          names = new Names();
  643.          wholegame.addChild(names);
  644.          wholegame.addChild(pauzz);
  645.          pauzz.visible = false;
  646.          names.gotoAndStop(2);
  647.          names.alpha = 0;
  648.          timeE = 90;
  649.          namesT = 0;
  650.          mc3.addChild(mc2);
  651.          mc2.addChild(mc);
  652.          mc.addChild(container1);
  653.          mc.addChild(container2);
  654.          mc.addChild(container3);
  655.          mc.addChild(container4);
  656.          fader = 1;
  657.          faderTIM = 0;
  658.          dir = new Dir();
  659.          dir.alpha = 0;
  660.          dir.d1.gotoAndStop(1);
  661.          dir.d2.gotoAndStop(2);
  662.          dir.d3.gotoAndStop(3);
  663.          dir.d4.gotoAndStop(4);
  664.          dir.d5.gotoAndStop(5);
  665.          ended = false;
  666.          durrr = 300;
  667.          dir.visible = false;
  668.          container4.addChild(dir);
  669.          range = 1900;
  670.          srange = 1300;
  671.          cam = new Cam(700,700,mc);
  672.          cam.x = range / 2;
  673.          cam.y = range / 2;
  674.          speedC = new Vector(0,4);
  675.          density = 1 / 90000;
  676.          area = range * range;
  677.          cn = density * area;
  678.          sdensity = 1 / 16000;
  679.          sarea = srange * srange;
  680.          sn = sdensity * sarea;
  681.          brange = 2800;
  682.          bdensity = 1 / 5000000;
  683.          barea = brange * brange;
  684.          bn = bdensity * barea;
  685.          momentum = 0;
  686.          mass = 20;
  687.          friction = 1;
  688.          strength = 1;
  689.          speed = new Vector(0,0);
  690.          pos = new Vector(0,0);
  691.          len = 180;
  692.          pos2 = new Vector(0,0);
  693.          rope = new MovieClip();
  694.          bobber = new Bobber();
  695.          center = new Vector(0,500);
  696.          anchored = false;
  697.          rspeed = 0;
  698.          speedFactor = 0.5;
  699.          controls = 1;
  700.          inside = false;
  701.          currentCloud = null;
  702.          elastic = 10;
  703.          speedP = 0;
  704.          charH = 30;
  705.          stars = new Array();
  706.          fish = new Array();
  707.          splashes = new Array();
  708.          floating = false;
  709.          pollupy = 0;
  710.          fished = 0;
  711.          won = new Array(false,false,false,false);
  712.          particles = new Array();
  713.          f = 0;
  714.          while(f < 10)
  715.          {
  716.             fish.push(new Array(new Fish(),new Vector(3,0),3,1));
  717.             fished += 1;
  718.             ++f;
  719.          }
  720.          ff = 0;
  721.          while(ff < 30)
  722.          {
  723.             fish.push(new Array(new Fish2(),new Vector(1,0),3,2));
  724.             ++ff;
  725.          }
  726.          k = 0;
  727.          while(k < fish.length)
  728.          {
  729.             bubblesC.addChild(fish[k][0]);
  730.             fish[k][0].x = 4000 + Math.random() * 500 - 250;
  731.             fish[k][0].y = 29000 + Math.random() * 500 - 250;
  732.             ++k;
  733.          }
  734.          background5 = new Background5();
  735.          container1.addChild(background5);
  736.          planets = new Array();
  737.          planets.push(new Array(new Planet1(),8000000,0));
  738.          planets.push(new Array(new Planet2(),8000000,0,0));
  739.          planets.push(new Array(new Planet3(),8000000,0,0));
  740.          planets.push(new Array(new Planet4(),8000000,0,0));
  741.          planets.push(new Array(new Planet5(),8000000,0));
  742.          planets.push(new Array(new Moon(),0,138 / 2,new Vector(0,0),1));
  743.          planets.push(new Array(new Moon(),0,138 / 2,new Vector(0,0),1));
  744.          planets.push(new Array(new Moon(),0,138 / 2,new Vector(0,0),1));
  745.          planets.push(new Array(new Moon(),0,138 / 2,new Vector(0,0),1));
  746.          container1.addChild(planets[5][0]);
  747.          container1.addChild(planets[6][0]);
  748.          container1.addChild(planets[7][0]);
  749.          container1.addChild(planets[8][0]);
  750.          container1.addChild(planets[0][0]);
  751.          container1.addChild(planets[1][0]);
  752.          container1.addChild(planets[2][0]);
  753.          container1.addChild(planets[3][0]);
  754.          container1.addChild(planets[4][0]);
  755.          foregrounds = new Array();
  756.          foregrounds.push(new Foreground2());
  757.          foregrounds.push(new Foreground3());
  758.          foregrounds.push(new Foreground4());
  759.          container3.addChild(foregrounds[0]);
  760.          container3.addChild(foregrounds[1]);
  761.          container3.addChild(foregrounds[2]);
  762.          planets[0][0].x = 0;
  763.          planets[0][0].y = 1000;
  764.          planets[1][0].x = 0;
  765.          planets[1][0].y = -20000;
  766.          foregrounds[0].x = 0;
  767.          foregrounds[0].y = -20000;
  768.          planets[2][0].x = 25000;
  769.          planets[2][0].y = 3000;
  770.          foregrounds[1].x = 25000;
  771.          foregrounds[1].y = 3000;
  772.          foregrounds[1].planet.visible = false;
  773.          planets[3][0].x = 4000;
  774.          planets[3][0].y = 29000;
  775.          foregrounds[2].x = 4000;
  776.          foregrounds[2].y = 29000;
  777.          planets[4][0].x = -30000;
  778.          planets[4][0].y = -10000;
  779.          background5.x = -30000;
  780.          background5.y = -10000;
  781.          planets[5][0].x = -30000;
  782.          planets[5][0].y = -11000;
  783.          planets[6][0].x = -31000;
  784.          planets[6][0].y = -10300;
  785.          planets[7][0].x = -29100;
  786.          planets[7][0].y = -10100;
  787.          planets[8][0].x = -29800;
  788.          planets[8][0].y = -8700;
  789.          planets[5][0].gotoAndStop(1);
  790.          planets[6][0].gotoAndStop(2);
  791.          planets[7][0].gotoAndStop(3);
  792.          planets[8][0].gotoAndStop(4);
  793.          planets.push(new Array(new Island(),0,157 / 2));
  794.          container1.addChild(planets[9][0]);
  795.          planets[9][0].x = 4000;
  796.          planets[9][0].y = 28600;
  797.          planets.push(new Array(new MoonE(),80000,187 / 2));
  798.          container1.addChild(planets[10][0]);
  799.          planets[10][0].x = 200;
  800.          planets[10][0].y = -700;
  801.          planets[10][0].rotation = Vector.angle2(new Vector(0,-1),new Vector(planets[10][0].x - planets[0][0].x,planets[10][0].y - planets[0][0].y));
  802.          planets.push(new Array(new MoonG(),80000,187 / 2));
  803.          container1.addChild(planets[11][0]);
  804.          planets[11][0].x = -200;
  805.          planets[11][0].y = -18000;
  806.          planets[11][0].rotation = Vector.angle2(new Vector(0,-1),new Vector(planets[11][0].x - planets[1][0].x,planets[11][0].y - planets[1][0].y));
  807.          planets.push(new Array(new MoonH(),80000,187 / 2));
  808.          container1.addChild(planets[12][0]);
  809.          planets[12][0].x = 23000;
  810.          planets[12][0].y = 3100;
  811.          planets[12][0].rotation = Vector.angle2(new Vector(0,-1),new Vector(planets[12][0].x - planets[2][0].x,planets[12][0].y - planets[2][0].y));
  812.          planets.push(new Array(new MoonB(),80000,187 / 2));
  813.          container1.addChild(planets[13][0]);
  814.          planets[13][0].x = -28000;
  815.          planets[13][0].y = -9500;
  816.          planets[13][0].rotation = Vector.angle2(new Vector(0,-1),new Vector(planets[13][0].x - planets[4][0].x,planets[13][0].y - planets[4][0].y));
  817.          planets.push(new Array(new MoonL(),80000,45));
  818.          container1.addChild(planets[14][0]);
  819.          planets[14][0].x = -27700;
  820.          planets[14][0].y = -9500;
  821.          planets[14][0].rotation = Vector.angle2(new Vector(0,-1),new Vector(planets[14][0].x - planets[4][0].x,planets[14][0].y - planets[4][0].y));
  822.          mp = 5;
  823.          while(mp < 9)
  824.          {
  825.             Vecp = new Vector(planets[mp][0].x - planets[4][0].x,planets[mp][0].y - planets[4][0].y);
  826.             planets[mp][0].rotation = Vector.angle2(new Vector(0,-1),Vecp);
  827.             ++mp;
  828.          }
  829.          mooned = 0;
  830.          gassed = 4;
  831.          gemCounter = 0;
  832.          planets[0][2] = 774 / 2;
  833.          planets[1][2] = 445.8 / 2;
  834.          planets[1][3] = 1616.4 / 2;
  835.          planets[2][2] = 1344.7 / 2;
  836.          planets[2][3] = 330.7 / 2;
  837.          planets[3][2] = 187 / 2;
  838.          planets[3][3] = 415;
  839.          planets[4][2] = 672;
  840.          earths = new Array(648 / 2,478 / 2,305 / 2,50);
  841.          talk = new Talk();
  842.          aliem();
  843.          container1.addChild(bubblesC);
  844.          container4.addChild(talk);
  845.          talk.alpha = 0;
  846.          talk.txt.text = "";
  847.          talk.visible = false;
  848.          container1.addChild(rope);
  849.          cc = 0;
  850.          while(cc < 8)
  851.          {
  852.             clouds.push(new Array(new Gem(),2));
  853.             container1.addChild(clouds[cc][0]);
  854.             clouds[cc][0].gotoAndStop(Math.floor(Math.random() * 3) + 1);
  855.             clouds[cc][0].rotation = Math.random() * 360;
  856.             Vec = new Vector(500,0);
  857.             Vec.rotate(cc * (360 / 8));
  858.             clouds[cc][0].x = planets[2][0].x + Vec.x;
  859.             clouds[cc][0].y = planets[2][0].y + Vec.y;
  860.             ++cc;
  861.          }
  862.          gg = 0;
  863.          while(gg < 4)
  864.          {
  865.             ggg = clouds.push(new Array(new Gasteroid(),3)) - 1;
  866.             container4.addChild(clouds[ggg][0]);
  867.             Vecg = new Vector(0,1300);
  868.             Vecg.rotate(gg * (360 / 4));
  869.             clouds[ggg][0].rotation = Vector.angle2(new Vector(0,-1),Vecg);
  870.             clouds[ggg][0].x = planets[1][0].x + Vecg.x;
  871.             clouds[ggg][0].y = planets[1][0].y + Vecg.y;
  872.             ++gg;
  873.          }
  874.          gemed = false;
  875.          grounded = false;
  876.          currentPlanet = 2;
  877.          container1.addChild(bobber);
  878.          container1.addChild(effects);
  879.          bobber.x = center.x;
  880.          bobber.y = center.y;
  881.          flasher = new Flasher();
  882.          wholegame.addChild(flasher);
  883.          latching = false;
  884.          while(Math.random() < cn)
  885.          {
  886.             --cn;
  887.             n = clouds.push(new Array(new Cloud(),0)) - 1;
  888.             container2.addChild(clouds[n][0]);
  889.             clouds[n][0].x = Math.random() * range;
  890.             clouds[n][0].y = Math.random() * range;
  891.             grav = new Vector(0,0);
  892.             i = 0;
  893.             while(i < 5)
  894.             {
  895.                planet = planets[i][0];
  896.                planet1mass = planets[i][1];
  897.                planet1r = planets[i][2];
  898.                GR = new Vector(planet.x - clouds[n][0].x,planet.y - clouds[n][0].y);
  899.                str = GR.length;
  900.                GR.length = planet1mass / (str * str);
  901.                grav.x += GR.x;
  902.                grav.y += GR.y;
  903.                ++i;
  904.             }
  905.             clouds[n][0].rotation = Vector.angle2(new Vector(0,1),grav);
  906.             clouds[n][0].gotoAndStop(Math.floor(Math.random() * 4) + 1);
  907.             clouds[n][0].scaleX = (Math.round(Math.random()) - 0.5) * 2;
  908.             j = 0;
  909.             while(j < planets.length)
  910.             {
  911.                planet2 = planets[j][0];
  912.                planet1mass2 = planets[j][1];
  913.                planet1r2 = planets[j][2];
  914.                if(j == 1)
  915.                {
  916.                   if((clouds[n][0].x - planet2.x) * (clouds[n][0].x - planet2.x) + (clouds[n][0].y - planet2.y) * (clouds[n][0].y - planet2.y) < (planet1r + 100) * (planet1r2 + 100))
  917.                   {
  918.                      container2.removeChild(clouds[n][0]);
  919.                      clouds.splice(n,1);
  920.                      break;
  921.                   }
  922.                }
  923.                else if(j >= 5)
  924.                {
  925.                   if((clouds[n][0].x - planet2.x) * (clouds[n][0].x - planet2.x) + (clouds[n][0].y - planet2.y) * (clouds[n][0].y - planet2.y) < (planet1r2 + 25) * (planet1r2 + 25))
  926.                   {
  927.                      container2.removeChild(clouds[n][0]);
  928.                      clouds.splice(n,1);
  929.                      break;
  930.                   }
  931.                }
  932.                else if((clouds[n][0].x - planet2.x) * (clouds[n][0].x - planet2.x) + (clouds[n][0].y - planet2.y) * (clouds[n][0].y - planet2.y) < (planet1r2 + 200) * (planet1r2 + 200))
  933.                {
  934.                   container2.removeChild(clouds[n][0]);
  935.                   clouds.splice(n,1);
  936.                   break;
  937.                }
  938.                ++j;
  939.             }
  940.          }
  941.          while(Math.random() < sn)
  942.          {
  943.             --sn;
  944.             n2 = stars.push(new Star()) - 1;
  945.             starsC.addChild(stars[n2]);
  946.             stars[n2].x = Math.random() * srange;
  947.             stars[n2].y = Math.random() * srange;
  948.             stars[n2].rotation = Math.random() * 360;
  949.             stars[n2].gotoAndStop(Math.floor(Math.random() * 9) + 1);
  950.          }
  951.          stage.addEventListener(Event.RENDER,shake);
  952.          addEventListener(Event.ENTER_FRAME,update,false,0,true);
  953.          talph = 0;
  954.          kUp = false;
  955.          kDown = false;
  956.          kLeft = false;
  957.          kRight = false;
  958.          kSpace = false;
  959.          kW = false;
  960.          kA = false;
  961.          kS = false;
  962.          kD = false;
  963.          kM = false;
  964.          stage.addEventListener(KeyboardEvent.KEY_DOWN,keyHandelerD,false,0,true);
  965.          stage.addEventListener(KeyboardEvent.KEY_UP,keyHandelerU,false,0,true);
  966.          stage.addEventListener(MouseEvent.MOUSE_DOWN,mouseHandelerD,false,0,true);
  967.          stage.addEventListener(MouseEvent.MOUSE_UP,mouseHandelerU,false,0,true);
  968.       }
  969.       
  970.       public function keyHandelerD(param1:KeyboardEvent) : *
  971.       {
  972.          var _loc2_:* = undefined;
  973.          if(!paus)
  974.          {
  975.             if(param1.keyCode == 87)
  976.             {
  977.                kW = true;
  978.             }
  979.             if(param1.keyCode == 65)
  980.             {
  981.                kA = true;
  982.             }
  983.             if(param1.keyCode == 83)
  984.             {
  985.                kS = true;
  986.             }
  987.             if(param1.keyCode == 68)
  988.             {
  989.                kD = true;
  990.             }
  991.             if(param1.keyCode == 38)
  992.             {
  993.                kUp = true;
  994.             }
  995.             if(param1.keyCode == 40)
  996.             {
  997.                kDown = true;
  998.             }
  999.             if(param1.keyCode == 37)
  1000.             {
  1001.                kLeft = true;
  1002.             }
  1003.             if(param1.keyCode == 39)
  1004.             {
  1005.                kRight = true;
  1006.             }
  1007.             if(param1.keyCode == 32)
  1008.             {
  1009.                kSpace = true;
  1010.             }
  1011.          }
  1012.          if(param1.keyCode == 27 || param1.keyCode == 80)
  1013.          {
  1014.             if(paus == false)
  1015.             {
  1016.                paus = true;
  1017.                stage.frameRate = 0;
  1018.                pauzz.visible = true;
  1019.             }
  1020.             else
  1021.             {
  1022.                paus = false;
  1023.                stage.frameRate = 30;
  1024.                pauzz.visible = false;
  1025.             }
  1026.          }
  1027.          if(param1.keyCode == 81)
  1028.          {
  1029.             _loc2_ = stage.quality;
  1030.             if(_loc2_ == "LOW")
  1031.             {
  1032.                stage.quality = "HIGH";
  1033.             }
  1034.             if(_loc2_ == "MEDIUM")
  1035.             {
  1036.                stage.quality = "LOW";
  1037.             }
  1038.             if(_loc2_ == "HIGH")
  1039.             {
  1040.                stage.quality = "MEDIUM";
  1041.             }
  1042.          }
  1043.       }
  1044.       
  1045.       public function updo2() : *
  1046.       {
  1047.          framey = "inst";
  1048.          fadery.play();
  1049.       }
  1050.       
  1051.       public function ag_btnclick(param1:MouseEvent) : *
  1052.       {
  1053.          navigateToURL(new URLRequest("http://www.armorgames.com"),"_blank");
  1054.       }
  1055.       
  1056.       public function keyHandelerU(param1:KeyboardEvent) : *
  1057.       {
  1058.          if(param1.keyCode == 87)
  1059.          {
  1060.             kW = false;
  1061.          }
  1062.          if(param1.keyCode == 65)
  1063.          {
  1064.             kA = false;
  1065.          }
  1066.          if(param1.keyCode == 83)
  1067.          {
  1068.             kS = false;
  1069.          }
  1070.          if(param1.keyCode == 68)
  1071.          {
  1072.             kD = false;
  1073.          }
  1074.          if(param1.keyCode == 38)
  1075.          {
  1076.             kUp = false;
  1077.          }
  1078.          if(param1.keyCode == 40)
  1079.          {
  1080.             kDown = false;
  1081.          }
  1082.          if(param1.keyCode == 37)
  1083.          {
  1084.             kLeft = false;
  1085.          }
  1086.          if(param1.keyCode == 39)
  1087.          {
  1088.             kRight = false;
  1089.          }
  1090.          if(param1.keyCode == 32)
  1091.          {
  1092.             kSpace = false;
  1093.          }
  1094.       }
  1095.       
  1096.       internal function frame3() : *
  1097.       {
  1098.          if(gemSounds == undefined)
  1099.          {
  1100.             beatgame = false;
  1101.             mus1 = new T1();
  1102.             mus2 = new T2();
  1103.             mus3 = new T3();
  1104.             mus4 = new T4();
  1105.             mus5 = new T5();
  1106.             musB = new TB();
  1107.             gemSounds = new Array(new G1(),new G2(),new G3(),new G4(),new G5(),new G6(),new G7(),new G8());
  1108.             SFX = new Array(new SFX1(),new SFX2(),new SFX3(),new SFX4(),new SFX5(),new SFX6(),new SFX7());
  1109.             win1 = new Win1();
  1110.             win2 = new Win2();
  1111.             win3 = new Win3();
  1112.             win4 = new Win4();
  1113.             channel1 = new SoundChannel();
  1114.             channel2 = new SoundChannel();
  1115.             channel3 = new SoundChannel();
  1116.             channel4 = new SoundChannel();
  1117.             channel5 = new SoundChannel();
  1118.             channelW = new SoundChannel();
  1119.             channelB = new SoundChannel();
  1120.             sfx = new SoundChannel();
  1121.             transform1 = new SoundTransform(0,0);
  1122.             transform2 = new SoundTransform(0,0);
  1123.             transform3 = new SoundTransform(0,0);
  1124.             transform4 = new SoundTransform(0,0);
  1125.             transform5 = new SoundTransform(0,0);
  1126.             transformW = new SoundTransform(1.5,0);
  1127.             transformB = new SoundTransform(1,0);
  1128.             transformSFX = new SoundTransform(1,0);
  1129.             channel2 = mus2.play(0,65535);
  1130.             channel5 = mus5.play(channel2.position,65535);
  1131.             channel1 = mus1.play(channel2.position,65535);
  1132.             channelB = musB.play(channel2.position,65535);
  1133.             channel3 = mus4.play(channel2.position,65535);
  1134.             channel4 = mus3.play(channel2.position,65535);
  1135.             channel1.soundTransform = transform1;
  1136.             channel2.soundTransform = transform2;
  1137.             channel3.soundTransform = transform3;
  1138.             channel4.soundTransform = transform4;
  1139.             channel5.soundTransform = transform5;
  1140.             channelB.soundTransform = transformB;
  1141.             channelW.soundTransform = transformW;
  1142.             sfx.soundTransform = transformSFX;
  1143.          }
  1144.       }
  1145.       
  1146.       internal function frame8() : *
  1147.       {
  1148.          stop();
  1149.          beatgame = true;
  1150.          removeEventListener(Event.ENTER_FRAME,update);
  1151.          removeEventListener(KeyboardEvent.KEY_DOWN,keyHandelerD);
  1152.          removeEventListener(KeyboardEvent.KEY_UP,keyHandelerU);
  1153.          removeEventListener(MouseEvent.MOUSE_DOWN,mouseHandelerD);
  1154.          removeEventListener(MouseEvent.MOUSE_UP,mouseHandelerU);
  1155.          btn1.addEventListener(MouseEvent.CLICK,goBTN,false,0,true);
  1156.       }
  1157.       
  1158.       public function update(param1:Event) : *
  1159.       {
  1160.          var i:int = 0;
  1161.          var vSPEED:Number = NaN;
  1162.          var force:Vector = null;
  1163.          var rad2:Vector = null;
  1164.          var pFl:* = undefined;
  1165.          var netForce:Vector = null;
  1166.          var busty:Boolean = false;
  1167.          var numcg:Boolean = false;
  1168.          var bbbbbbb:Boolean = false;
  1169.          var strn:* = undefined;
  1170.          var winned:int = 0;
  1171.          var planet:MovieClip = null;
  1172.          var planet1mass:* = undefined;
  1173.          var planet1r:* = undefined;
  1174.          var GR:Vector = null;
  1175.          var str:Number = NaN;
  1176.          var aaaaaa:Vector = null;
  1177.          var nnn:* = undefined;
  1178.          var rVAL:Vector = null;
  1179.          var bobbery:Vector = null;
  1180.          var n:Vector = null;
  1181.          var C:Number = NaN;
  1182.          var Y:Number = NaN;
  1183.          var X:Number = NaN;
  1184.          var xp1:Vector = null;
  1185.          var xp2:Vector = null;
  1186.          var rad:Vector = null;
  1187.          var j:int = 0;
  1188.          var pp:int = 0;
  1189.          var ang:Vector = null;
  1190.          var disss:Vector = null;
  1191.          var dissst:Vector = null;
  1192.          var disst:Vector = null;
  1193.          var nnnn:Vector = null;
  1194.          var aaan:Vector = null;
  1195.          var shortestC:int = 0;
  1196.          var distC:Number = NaN;
  1197.          var ass:Boolean = false;
  1198.          var grav:Vector = null;
  1199.          var planet2:MovieClip = null;
  1200.          var planet1mass2:* = undefined;
  1201.          var planet1r2:* = undefined;
  1202.          var CFF:int = 0;
  1203.          var rrr:Vector = null;
  1204.          var rr:Vector = null;
  1205.          var targSiz:Number = NaN;
  1206.          var e:Event = param1;
  1207.          try
  1208.          {
  1209.             if(ended)
  1210.             {
  1211.                lockControls();
  1212.             }
  1213.             i = 0;
  1214.             while(i < clouds.length)
  1215.             {
  1216.                if(clouds[i] == null || clouds[i] == undefined || clouds[i][0] == null || clouds[i][0] == undefined || clouds[i][1] == null || clouds[i][1] == undefined || isNaN(clouds[i][1]))
  1217.                {
  1218.                   clouds.splice(i,1);
  1219.                   i--;
  1220.                }
  1221.                i++;
  1222.             }
  1223.             vSPEED = 0;
  1224.             foregrounds[0].alpha = gassed / 4;
  1225.             if(!inside && planets[2][0].planet.currentFrame == 1)
  1226.             {
  1227.                foregrounds[1].planet.visible = false;
  1228.                planets[2][0].planet.visible = true;
  1229.             }
  1230.             if(inside && planets[2][0].planet.currentFrame == 1)
  1231.             {
  1232.                planets[2][0].planet.play();
  1233.                foregrounds[1].planet.play();
  1234.                foregrounds[1].planet.visible = true;
  1235.                planets[2][0].planet.visible = false;
  1236.             }
  1237.             if(!inside && planets[2][0].planet.currentFrame != 1)
  1238.             {
  1239.                planets[2][0].planet.play();
  1240.                foregrounds[1].planet.play();
  1241.             }
  1242.             if(planets[0][0].currentFrame == 6)
  1243.             {
  1244.                if(currentPlanet == 10 || grounded)
  1245.                {
  1246.                   --timeE;
  1247.                   if(timeE <= 0)
  1248.                   {
  1249.                      framey = "ending";
  1250.                      fadery.play();
  1251.                   }
  1252.                }
  1253.             }
  1254.             Gravity = new Vector(0,0);
  1255.             i = 0;
  1256.             while(i < planets.length)
  1257.             {
  1258.                planet = planets[i][0];
  1259.                planet1mass = planets[i][1];
  1260.                planet1r = planets[i][2];
  1261.                GR = new Vector(planet.x - bobber.x,planet.y - bobber.y);
  1262.                str = GR.length;
  1263.                GR.length = planet1mass / (str * str);
  1264.                Gravity.x += GR.x;
  1265.                Gravity.y += GR.y;
  1266.                i++;
  1267.             }
  1268.             if(Gravity.length > 2)
  1269.             {
  1270.                Gravity.length = 2;
  1271.             }
  1272.             if(Gravity.length < 0.2 && planets[0][0].currentFrame != 6)
  1273.             {
  1274.                names.gotoAndStop(6);
  1275.             }
  1276.             force = new Vector((Number(kD) - Number(kA)) * strength,(Number(kS) - Number(kW)) * strength);
  1277.             if(grounded && kW && controls == 2)
  1278.             {
  1279.                bobber.gotoAndStop(6);
  1280.                force.y *= 25;
  1281.                controls = 1;
  1282.             }
  1283.             if(grounded && currentPlanet >= 5)
  1284.             {
  1285.                aaaaaa = new Vector(bobber.x - planets[currentPlanet][0].x,bobber.y - planets[currentPlanet][0].y);
  1286.                force.rotate(Vector.angle2(new Vector(0,-1),aaaaaa));
  1287.             }
  1288.             else
  1289.             {
  1290.                force.rotate(Vector.angle2(new Vector(0,1),Gravity));
  1291.             }
  1292.             if(force.length > 0 && !anchored && !latching && bobber.currentFrame == 1 && controls == 1)
  1293.             {
  1294.                bobber.ani.play();
  1295.                rspeed = Vector.angle2(new Vector(0,-1).rotateNew(bobber.rotation),force) / 5;
  1296.             }
  1297.             if(bobber.currentFrame == 7 && bobber.ani.currentFrame == 8)
  1298.             {
  1299.                bobber.gotoAndStop(1);
  1300.             }
  1301.             friction = 1 - Gravity.length / 100;
  1302.             if(anchored)
  1303.             {
  1304.                friction = 1;
  1305.             }
  1306.             if(planets[0][0].currentFrame == 5)
  1307.             {
  1308.                aaaaaa = new Vector(bobber.x - planets[0][0].x,bobber.y - planets[0][0].y);
  1309.                if(aaaaaa.length < 700)
  1310.                {
  1311.                   namesT = 200;
  1312.                   names.gotoAndStop(1);
  1313.                   friction = 0.95;
  1314.                   force.x = 0;
  1315.                   force.y = 0;
  1316.                   lockControls();
  1317.                   if(speed.length > 10)
  1318.                   {
  1319.                      speed.length -= (speed.length - 10) / 10;
  1320.                   }
  1321.                }
  1322.             }
  1323.             rad2 = new Vector(planets[1][0].x - bobber.x,planets[1][0].y - bobber.y);
  1324.             if(rad2.length < planets[1][3])
  1325.             {
  1326.                if(names.currentFrame != 2)
  1327.                {
  1328.                   namesT = 200;
  1329.                   names.gotoAndStop(2);
  1330.                }
  1331.                friction -= gassed * 0.05;
  1332.                if(anchored)
  1333.                {
  1334.                   friction = 1 - gassed * 0.007;
  1335.                }
  1336.                else if(!grounded)
  1337.                {
  1338.                   force.scale(10);
  1339.                }
  1340.             }
  1341.             rad2 = new Vector(planets[3][0].x - bobber.x,planets[3][0].y - bobber.y);
  1342.             pFl = floating;
  1343.             floating = false;
  1344.             if(rad2.length < planets[3][3])
  1345.             {
  1346.                Gravity.scale(-1);
  1347.                floating = true;
  1348.                if(names.currentFrame != 4)
  1349.                {
  1350.                   namesT = 200;
  1351.                   names.gotoAndStop(4);
  1352.                }
  1353.                if(anchored)
  1354.                {
  1355.                   friction = 0.99;
  1356.                }
  1357.                else
  1358.                {
  1359.                   friction = 0.94;
  1360.                }
  1361.             }
  1362.             if(floating == !pFl && speed.length > 25)
  1363.             {
  1364.                sfx = SFX[4].play();
  1365.                transformSFX.volume = 3;
  1366.                nnn = splashes.push(new Splash()) - 1;
  1367.                effects.addChild(splashes[nnn]);
  1368.                GR = new Vector(planets[3][0].x - (bobber.x + speed.x),planets[3][0].y - (bobber.y + speed.y));
  1369.                GR.length = planets[3][3];
  1370.                splashes[nnn].x = planets[3][0].x - GR.x;
  1371.                splashes[nnn].y = planets[3][0].y - GR.y;
  1372.                splashes[nnn].rotation = Vector.angle2(new Vector(0,1),GR);
  1373.             }
  1374.             if(rad2.length < planets[3][3] - 30)
  1375.             {
  1376.                if(foregrounds[2].alpha > 0.2)
  1377.                {
  1378.                   foregrounds[2].alpha -= 0.02;
  1379.                }
  1380.             }
  1381.             else if(foregrounds[2].alpha < 1)
  1382.             {
  1383.                foregrounds[2].alpha += 0.1;
  1384.             }
  1385.             if(!anchored && !grounded)
  1386.             {
  1387.                if(!floating)
  1388.                {
  1389.                   force.scale(0.1);
  1390.                }
  1391.                else
  1392.                {
  1393.                   force.scale(3);
  1394.                }
  1395.             }
  1396.             if(anchored)
  1397.             {
  1398.                force.scale(1.5);
  1399.             }
  1400.             netForce = new Vector(0,0);
  1401.             netForce = Vector.add(Gravity,netForce);
  1402.             netForce = Vector.add(force,netForce);
  1403.             speed.x += netForce.x;
  1404.             speed.y += netForce.y;
  1405.             speed.scale(friction);
  1406.             busty = false;
  1407.             if(anchored)
  1408.             {
  1409.                center.x = currentCloud.x;
  1410.                center.y = currentCloud.y;
  1411.                controls = 1;
  1412.                grounded = false;
  1413.                rVAL = new Vector(pos.x,pos.y);
  1414.                pos.x += speed.x * speedFactor;
  1415.                pos.y += speed.y * speedFactor;
  1416.                if(pos.length > len)
  1417.                {
  1418.                   n = new Vector(pos.length - len,0);
  1419.                   n.rotate(Vector.angle2(new Vector(1,0),pos));
  1420.                   speed.x += n.x / -elastic;
  1421.                   speed.y += n.y / -elastic;
  1422.                   pos.length -= n.length / elastic;
  1423.                }
  1424.                rope.graphics.clear();
  1425.                if(pos.length < len)
  1426.                {
  1427.                   C = len / 2;
  1428.                   Y = pos.length / 2;
  1429.                   X = Math.sqrt(C * C - Y * Y);
  1430.                   xp1 = new Vector(pos.x,pos.y);
  1431.                   xp1 = xp1.perpendicular(-1);
  1432.                   xp2 = new Vector(pos.x,pos.y);
  1433.                   xp2 = xp2.perpendicular(1);
  1434.                   xp1.length = X;
  1435.                   xp2.length = X;
  1436.                   xp1.x += pos.x / 2;
  1437.                   xp1.y += pos.y / 2;
  1438.                   xp2.x += pos.x / 2;
  1439.                   xp2.y += pos.y / 2;
  1440.                   if((xp1.x - pos2.x) * (xp1.x - pos2.x) + (xp1.y - pos2.y) * (xp1.y - pos2.y) < (xp2.x - pos2.x) * (xp2.x - pos2.x) + (xp2.y - pos2.y) * (xp2.y - pos2.y))
  1441.                   {
  1442.                      pos2.x = xp1.x;
  1443.                      pos2.y = xp1.y;
  1444.                   }
  1445.                   else
  1446.                   {
  1447.                      pos2.x = xp2.x;
  1448.                      pos2.y = xp2.y;
  1449.                   }
  1450.                }
  1451.                else
  1452.                {
  1453.                   pos2.x = pos.x / 2;
  1454.                   pos2.y = pos.y / 2;
  1455.                }
  1456.                if(!floating)
  1457.                {
  1458.                   rspeed += Vector.angle2(new Vector(0,1).rotateNew(bobber.rotation),Vector.add(Vector.subtract(pos,pos2),Gravity)) / 30;
  1459.                }
  1460.                else
  1461.                {
  1462.                   rspeed += Vector.angle2(new Vector(0,1).rotateNew(bobber.rotation),Vector.add(Gravity,Vector.subtract(pos,pos2))) / 30;
  1463.                }
  1464.                vSPEED = Vector.angle2(rVAL,pos);
  1465.                rspeed *= 0.95;
  1466.                bobbery = new Vector(0,-charH).rotateNew(bobber.rotation + rspeed * speedFactor);
  1467.                bobber.x = pos.x + center.x + bobbery.x;
  1468.                bobber.y = pos.y + center.y + bobbery.y;
  1469.                i = 0;
  1470.                while(i < planets.length)
  1471.                {
  1472.                   if(!(i == 0 && planets[0][0].currentFrame == 6))
  1473.                   {
  1474.                      if(!(i >= 5 && i <= 8 && planets[i][4] == 0))
  1475.                      {
  1476.                         planet = planets[i][0];
  1477.                         planet1mass = planets[i][1];
  1478.                         planet1r = planets[i][2];
  1479.                         rad = new Vector(planet.x - bobber.x,planet.y - bobber.y);
  1480.                         if(inside && i == 2)
  1481.                         {
  1482.                            if(rad.length > planet1r + 30)
  1483.                            {
  1484.                               inside = false;
  1485.                               j = 0;
  1486.                               while(j < 10)
  1487.                               {
  1488.                                  pp = int(particles.push(new Array(new Particle2(),new Vector(0,Math.random() * 3 + 10),new Vector(Gravity.x / 3,Gravity.y / 3),0.99,Math.random() * 100 - 50,20)) - 1);
  1489.                                  particles[pp][1].rotate(Vector.angle2(new Vector(0,-1),Gravity) + Math.random() * 30 - 15);
  1490.                                  particles[pp][0].x = planets[2][0].x - rad.x / rad.length * planets[2][2];
  1491.                                  particles[pp][0].y = planets[2][0].y - rad.y / rad.length * planets[2][2];
  1492.                                  particles[pp][0].gotoAndStop(Math.floor(Math.random() * 4) + 1);
  1493.                                  particles[pp][0].rotation = Math.random() * 360;
  1494.                                  effects.addChild(particles[pp][0]);
  1495.                                  j++;
  1496.                               }
  1497.                               nnn = splashes.push(new Poof()) - 1;
  1498.                               effects.addChild(splashes[nnn]);
  1499.                               splashes[nnn].x = planets[currentPlanet][0].x - rad.x / rad.length * planets[2][2];
  1500.                               splashes[nnn].y = planets[currentPlanet][0].y - rad.y / rad.length * planets[2][2];
  1501.                               splashes[nnn].rotation = Vector.angle2(new Vector(0,1),rad);
  1502.                            }
  1503.                            else
  1504.                            {
  1505.                               planet1r = planets[i][3];
  1506.                            }
  1507.                         }
  1508.                         if(rad.length < planet1r + charH)
  1509.                         {
  1510.                            busty = true;
  1511.                            rad.length = planet1r + charH;
  1512.                            bobber.x = planet.x - rad.x;
  1513.                            bobber.y = planet.y - rad.y;
  1514.                            rad.length = Vector.dot(rad,speed) / rad.length;
  1515.                            speed.x -= rad.x * 1.4;
  1516.                            speed.y -= rad.y * 1.4;
  1517.                            if(i >= 5)
  1518.                            {
  1519.                               speed.rotate(Vector.angle2(new Vector(0,1),rad));
  1520.                               speed.y = 0;
  1521.                               speed.rotate(-Vector.angle2(new Vector(0,1),rad));
  1522.                            }
  1523.                         }
  1524.                      }
  1525.                   }
  1526.                   i++;
  1527.                }
  1528.                rope.graphics.lineStyle(4,14277081);
  1529.                rope.graphics.moveTo(center.x,center.y);
  1530.                rope.graphics.curveTo(pos2.x + center.x,pos2.y + center.y,bobber.x + bobbery.x,bobber.y + bobbery.y);
  1531.                rope.graphics.lineStyle(1,16777215);
  1532.                rope.graphics.moveTo(center.x,center.y);
  1533.                rope.graphics.curveTo(pos2.x + center.x,pos2.y + center.y,bobber.x + bobbery.x,bobber.y + bobbery.y);
  1534.             }
  1535.             else
  1536.             {
  1537.                rspeed *= 0.99;
  1538.                rope.graphics.clear();
  1539.                ang = new Vector(bobber.x - planets[currentPlanet][0].x,bobber.y - planets[currentPlanet][0].y);
  1540.                if(currentPlanet == 2 && !inside && planets[2][0].box.hitTestObject(bobber.box) && ang.length < planets[currentPlanet][2] + charH + 5)
  1541.                {
  1542.                   inside = true;
  1543.                   if(controls == 2)
  1544.                   {
  1545.                      speed = new Vector(speedP * planets[2][2] * (Math.PI / 180),0);
  1546.                      speed.rotate(Vector.angle2(new Vector(0,-1),ang));
  1547.                   }
  1548.                   controls = 1;
  1549.                   grounded = false;
  1550.                }
  1551.                if(controls == 1)
  1552.                {
  1553.                   bobber.x += speed.x * speedFactor;
  1554.                   bobber.y += speed.y * speedFactor;
  1555.                }
  1556.                else if(controls == 2)
  1557.                {
  1558.                   if(kD)
  1559.                   {
  1560.                      speedP += 0.2;
  1561.                      if(inside)
  1562.                      {
  1563.                         speedP += 0.4;
  1564.                      }
  1565.                      if(currentPlanet == 0)
  1566.                      {
  1567.                         speedP += 0.16;
  1568.                      }
  1569.                      if(currentPlanet == 1)
  1570.                      {
  1571.                         speedP += 0.2 - gassed * 0.05;
  1572.                      }
  1573.                      if(currentPlanet >= 5)
  1574.                      {
  1575.                         speedP += 1;
  1576.                      }
  1577.                      if(currentPlanet == 0)
  1578.                      {
  1579.                         speedP += (planets[0][0].currentFrame - 1) / 10;
  1580.                      }
  1581.                   }
  1582.                   if(kA)
  1583.                   {
  1584.                      speedP -= 0.2;
  1585.                      if(inside)
  1586.                      {
  1587.                         speedP -= 0.4;
  1588.                      }
  1589.                      if(currentPlanet == 1)
  1590.                      {
  1591.                         speedP -= 0.2 - gassed * 0.05;
  1592.                      }
  1593.                      if(currentPlanet == 0)
  1594.                      {
  1595.                         speedP -= 0.16;
  1596.                      }
  1597.                      if(currentPlanet >= 5)
  1598.                      {
  1599.                         --speedP;
  1600.                      }
  1601.                      if(currentPlanet == 0)
  1602.                      {
  1603.                         speedP -= (planets[0][0].currentFrame - 1) / 10;
  1604.                      }
  1605.                   }
  1606.                   speedP *= 0.92;
  1607.                   ang.rotate(speedP * speedFactor);
  1608.                   speed = new Vector(speedP * ang.length * (Math.PI / 180),0);
  1609.                   speed.rotate(Vector.angle2(new Vector(0,-1),ang));
  1610.                   ang.length = planets[currentPlanet][2];
  1611.                   if(inside)
  1612.                   {
  1613.                      ang.length = planets[currentPlanet][3];
  1614.                   }
  1615.                   if(!floating)
  1616.                   {
  1617.                      bobber.x = ang.x + planets[currentPlanet][0].x;
  1618.                      bobber.y = ang.y + planets[currentPlanet][0].y;
  1619.                   }
  1620.                }
  1621.                grounded = false;
  1622.                i = int(planets.length - 1);
  1623.                while(i >= 0)
  1624.                {
  1625.                   if(!(i == 0 && planets[0][0].currentFrame == 6))
  1626.                   {
  1627.                      if(!(i >= 5 && i <= 8 && planets[i][4] == 0))
  1628.                      {
  1629.                         planet = planets[i][0];
  1630.                         planet1mass = planets[i][1];
  1631.                         planet1r = planets[i][2];
  1632.                         rad = new Vector(planet.x - bobber.x,planet.y - bobber.y);
  1633.                         if(rad.length < planet1r + charH + 50 && !floating && i <= 4 || bobber.currentFrame == 6 && rad.length < planet1r + 180 && !floating && i <= 4 || rad.length < planet1r + charH && !floating && i > 4)
  1634.                         {
  1635.                            bobber.rotation += Vector.angle2(new Vector(0,1).rotateNew(bobber.rotation),rad) / 4;
  1636.                         }
  1637.                         if(inside && i == 2)
  1638.                         {
  1639.                            if(rad.length > planet1r + charH + 6)
  1640.                            {
  1641.                               inside = false;
  1642.                               j = 0;
  1643.                               while(j < 10)
  1644.                               {
  1645.                                  pp = int(particles.push(new Array(new Particle2(),new Vector(0,Math.random() * 3 + 10),new Vector(Gravity.x / 3,Gravity.y / 3),0.99,Math.random() * 100 - 50,20)) - 1);
  1646.                                  particles[pp][1].rotate(Vector.angle2(new Vector(0,-1),Gravity) + Math.random() * 30 - 15);
  1647.                                  particles[pp][0].x = planets[2][0].x - rad.x / rad.length * planets[2][2];
  1648.                                  particles[pp][0].y = planets[2][0].y - rad.y / rad.length * planets[2][2];
  1649.                                  particles[pp][0].gotoAndStop(Math.floor(Math.random() * 4) + 1);
  1650.                                  particles[pp][0].rotation = Math.random() * 360;
  1651.                                  effects.addChild(particles[pp][0]);
  1652.                                  j++;
  1653.                               }
  1654.                               nnn = splashes.push(new Poof()) - 1;
  1655.                               effects.addChild(splashes[nnn]);
  1656.                               splashes[nnn].x = planets[currentPlanet][0].x - rad.x / rad.length * planets[2][2];
  1657.                               splashes[nnn].y = planets[currentPlanet][0].y - rad.y / rad.length * planets[2][2];
  1658.                               splashes[nnn].rotation = Vector.angle2(new Vector(0,1),rad);
  1659.                            }
  1660.                            else
  1661.                            {
  1662.                               planet1r = planets[i][3];
  1663.                            }
  1664.                         }
  1665.                         if(rad.length < planet1r + charH)
  1666.                         {
  1667.                            if(i == 0 && planets[0][0].currentFrame == 5)
  1668.                            {
  1669.                               planets[0][0].gotoAndStop(6);
  1670.                               ended = true;
  1671.                               sfx = SFX[5].play();
  1672.                               transformSFX.volume = 3;
  1673.                               speed.scale(0.5);
  1674.                               if(speed.length > 5)
  1675.                               {
  1676.                                  speed.length = 5;
  1677.                               }
  1678.                               planets[0][1] = 0;
  1679.                               j = 0;
  1680.                               while(j < 40)
  1681.                               {
  1682.                                  pp = int(particles.push(new Array(new Particle1(),new Vector(Math.random() * 10 + 5,0),new Vector(0,0),0.95,Math.random() * 100 - 50,40)) - 1);
  1683.                                  particles[pp][1].rotate(Math.random() * 360);
  1684.                                  particles[pp][0].x = planets[0][0].x;
  1685.                                  particles[pp][0].y = planets[0][0].y;
  1686.                                  particles[pp][0].gotoAndStop(Math.floor(Math.random() * 4) + 1);
  1687.                                  particles[pp][0].rotation = Math.random() * 360;
  1688.                                  effects.addChild(particles[pp][0]);
  1689.                                  j++;
  1690.                               }
  1691.                            }
  1692.                            else
  1693.                            {
  1694.                               rad.length = planet1r + charH;
  1695.                               bobber.x = planet.x - rad.x;
  1696.                               bobber.y = planet.y - rad.y;
  1697.                               rad.length = Vector.dot(rad,speed) / rad.length;
  1698.                               speed.x -= rad.x * 1.2;
  1699.                               speed.y -= rad.y * 1.2;
  1700.                               rspeed = 0;
  1701.                               grounded = true;
  1702.                               if(Math.abs(Vector.dot(speed,rad) / rad.length) < 25 && !floating)
  1703.                               {
  1704.                                  if(controls == 1)
  1705.                                  {
  1706.                                     speedP = Vector.dot(speed.perpendicular(),rad) / (rad.length * planet1r) * (180 / Math.PI);
  1707.                                     speed = new Vector(speedP * planet1r * (Math.PI / 180),0);
  1708.                                     speed.rotate(Vector.angle2(new Vector(0,1),rad));
  1709.                                  }
  1710.                                  controls = 2;
  1711.                                  if(currentPlanet != i)
  1712.                                  {
  1713.                                     currentPlanet = i;
  1714.                                  }
  1715.                                  if(i <= 4 && names.currentFrame != i + 1)
  1716.                                  {
  1717.                                     namesT = 200;
  1718.                                     names.gotoAndStop(i + 1);
  1719.                                  }
  1720.                               }
  1721.                            }
  1722.                         }
  1723.                      }
  1724.                   }
  1725.                   i--;
  1726.                }
  1727.             }
  1728.             if(bobber.currentFrame != 1 && bobber.currentFrame != 2 && bobber.currentFrame != 7 && (floating || Gravity.length < 1))
  1729.             {
  1730.                bobber.gotoAndStop(1);
  1731.             }
  1732.             if(currentPlanet == 9 && floating && controls == 2)
  1733.             {
  1734.                controls = 1;
  1735.                grounded = false;
  1736.             }
  1737.             if(mooned != 4)
  1738.             {
  1739.                i = 0;
  1740.                while(i < 4)
  1741.                {
  1742.                   disss = new Vector(planets[4][0].x - planets[5 + i][0].x,planets[4][0].y - planets[5 + i][0].y);
  1743.                   if(disss.length < planets[4][2] + planets[5 + i][2] + 100)
  1744.                   {
  1745.                      planets[5 + i][4] = 0;
  1746.                      if(controls == 2 && currentPlanet == 5 + i)
  1747.                      {
  1748.                         controls = 1;
  1749.                         grounded = false;
  1750.                      }
  1751.                   }
  1752.                   if(disss.length < planets[4][2] + planets[5 + i][2] && Boolean(planets[5 + i][0].visible))
  1753.                   {
  1754.                      j = 0;
  1755.                      while(j < 3)
  1756.                      {
  1757.                         pp = int(particles.push(new Array(new Particle2(),new Vector(0,Math.random() * 3 + 10),new Vector(Gravity.x / 3,Gravity.y / 3),0.99,Math.random() * 100 - 50,20)) - 1);
  1758.                         particles[pp][1].rotate(Vector.angle2(new Vector(0,-1),Gravity) + Math.random() * 60 - 30);
  1759.                         disst = new Vector(disss.x,disss.y);
  1760.                         disst.norm();
  1761.                         disst.rotate(Math.random() * 6 - 3);
  1762.                         particles[pp][0].x = planets[4][0].x - disst.x * planets[4][2];
  1763.                         particles[pp][0].y = planets[4][0].y - disst.y * planets[4][2];
  1764.                         particles[pp][0].gotoAndStop(Math.floor(Math.random() * 4) + 1);
  1765.                         particles[pp][0].rotation = Math.random() * 360;
  1766.                         effects.addChild(particles[pp][0]);
  1767.                         j++;
  1768.                      }
  1769.                      nnn = splashes.push(new Smoke()) - 1;
  1770.                      effects.addChild(splashes[nnn]);
  1771.                      dissst = new Vector(disss.x,disss.y);
  1772.                      dissst.norm();
  1773.                      dissst.rotate(Math.random() * 6 - 3);
  1774.                      splashes[nnn].x = planets[4][0].x - dissst.x * planets[4][2] + Math.random() * 40 - 20;
  1775.                      splashes[nnn].y = planets[4][0].y - dissst.y * planets[4][2] + Math.random() * 40 - 20;
  1776.                      splashes[nnn].rotation = Math.random() * 360;
  1777.                      if(planets[4][0].currentFrame == 1)
  1778.                      {
  1779.                         planets[4][0].gotoAndStop(2);
  1780.                         sfx = SFX[6].play();
  1781.                         transformSFX.volume = 1.5;
  1782.                      }
  1783.                   }
  1784.                   if(disss.length < planets[4][2] - planets[5 + i][2] - 50)
  1785.                   {
  1786.                      planets[5 + i][3].scale(0);
  1787.                      if(planets[4][0].currentFrame == 2 && Boolean(planets[5 + i][0].visible))
  1788.                      {
  1789.                         planets[4][0].gotoAndStop(1);
  1790.                         mooned += 1;
  1791.                         sfx.stop();
  1792.                         sfx = SFX[2].play();
  1793.                         transformSFX.volume = 2;
  1794.                      }
  1795.                      planets[5 + i][0].visible = false;
  1796.                   }
  1797.                   if(currentPlanet == 5 + i && controls == 2 && grounded)
  1798.                   {
  1799.                      if(planets[5 + i][0].ani.currentFrame == 1 && talph == 0)
  1800.                      {
  1801.                         planets[5 + i][0].ani.gotoAndStop(2);
  1802.                         talph = 1;
  1803.                      }
  1804.                      if(talph == 1)
  1805.                      {
  1806.                         talk.visible = true;
  1807.                         if(i == 0)
  1808.                         {
  1809.                            talk.txt.text = "\nI\'ll never go back home.";
  1810.                         }
  1811.                         if(i == 1)
  1812.                         {
  1813.                            talk.txt.text = "\nI\'ll go home when he leaves!";
  1814.                         }
  1815.                         if(i == 2)
  1816.                         {
  1817.                            talk.txt.text = "\nPersonally, I think hes pretty cool";
  1818.                         }
  1819.                         if(i == 3)
  1820.                         {
  1821.                            talk.txt.text = "\nI hate him so much...";
  1822.                         }
  1823.                         talk.bubb.scaleX = -1;
  1824.                         nnnn = new Vector(talk.bubb.scaleX * -130 * talk.scaleX,-100 * talk.scaleY);
  1825.                         nnnn.rotate(Vector.angle2(new Vector(0,-1),new Vector(0,-1).rotateNew(planets[5 + i][0].rotation)));
  1826.                         talk.x = planets[5 + i][0].x + nnnn.x;
  1827.                         talk.y = planets[5 + i][0].y + nnnn.y;
  1828.                         talk.rotation = planets[5 + i][0].rotation;
  1829.                      }
  1830.                   }
  1831.                   else if(planets[5 + i][0].ani.currentFrame == 2)
  1832.                   {
  1833.                      planets[5 + i][0].ani.gotoAndStop(1);
  1834.                      talph = 0;
  1835.                   }
  1836.                   if(currentPlanet == 5 + i && controls == 2 && grounded)
  1837.                   {
  1838.                      aaan = new Vector(planets[5 + i][0].x - bobber.x,planets[5 + i][0].y - bobber.y);
  1839.                      if(Vector.angle(aaan,Gravity) < 30)
  1840.                      {
  1841.                         aaan.norm();
  1842.                         planets[5 + i][3].x += aaan.x / 7;
  1843.                         planets[5 + i][3].y += aaan.y / 7;
  1844.                      }
  1845.                   }
  1846.                   if(planets[5 + i][4] != 0)
  1847.                   {
  1848.                      planets[5 + i][3].scale(0.95);
  1849.                   }
  1850.                   else if(planets[5 + i][3].length < 1)
  1851.                   {
  1852.                      planets[5 + i][3].length = 1;
  1853.                   }
  1854.                   planets[5 + i][0].x += planets[5 + i][3].x;
  1855.                   planets[5 + i][0].y += planets[5 + i][3].y;
  1856.                   i++;
  1857.                }
  1858.             }
  1859.             if(mooned == 4 && planets[4][0].currentFrame == 1)
  1860.             {
  1861.                planets[4][0].gotoAndStop(3);
  1862.             }
  1863.             bobber.rotation += rspeed * speedFactor;
  1864.             if(latching && !anchored)
  1865.             {
  1866.                latching = false;
  1867.                anchored = true;
  1868.                bobbery = new Vector(0,-charH).rotateNew(bobber.rotation);
  1869.                center.x = currentCloud.x;
  1870.                center.y = currentCloud.y;
  1871.                pos.x = bobber.x - bobbery.x - center.x;
  1872.                pos.y = bobber.y - bobbery.y - center.y;
  1873.                len = pos.length;
  1874.                if(len < 100 + Gravity.length * 20)
  1875.                {
  1876.                   len = 100 + Gravity.length * 20;
  1877.                }
  1878.                if(len > 600)
  1879.                {
  1880.                   len = 600;
  1881.                }
  1882.                rope.graphics.lineStyle(4,14277081);
  1883.                rope.graphics.moveTo(bobber.x + bobbery.x,bobber.y + bobbery.y);
  1884.                rope.graphics.lineTo(bobber.x + bobbery.x - 2 * (bobber.x + bobbery.x - center.x) / 3,bobber.y + bobbery.y - 2 * (bobber.y + bobbery.y - center.y) / 3);
  1885.                rope.graphics.lineStyle(1,16777215);
  1886.                rope.graphics.moveTo(bobber.x + bobbery.x,bobber.y + bobbery.y);
  1887.                rope.graphics.lineTo(bobber.x + bobbery.x - 2 * (bobber.x + bobbery.x - center.x) / 3,bobber.y + bobbery.y - 2 * (bobber.y + bobbery.y - center.y) / 3);
  1888.             }
  1889.             if(kM && !anchored && !latching && bobber.currentFrame != 2)
  1890.             {
  1891.                shortestC = -1;
  1892.                distC = 150 * 150;
  1893.                i = 0;
  1894.                while(i < clouds.length)
  1895.                {
  1896.                   if((clouds[i][1] == 0 || clouds[i][1] == 3) && !inside || clouds[i][1] == 2 && inside)
  1897.                   {
  1898.                      if((clouds[i][0].x - mc.mouseX) * (clouds[i][0].x - mc.mouseX) + (clouds[i][0].y - mc.mouseY) * (clouds[i][0].y - mc.mouseY) < distC)
  1899.                      {
  1900.                         if((clouds[i][0].x - bobber.x) * (clouds[i][0].x - bobber.x) + (clouds[i][0].y - bobber.y) * (clouds[i][0].y - bobber.y) < 600 * 600)
  1901.                         {
  1902.                            distC = (clouds[i][0].x - mc.mouseX) * (clouds[i][0].x - mc.mouseX) + (clouds[i][0].y - mc.mouseY) * (clouds[i][0].y - mc.mouseY);
  1903.                            shortestC = i;
  1904.                         }
  1905.                      }
  1906.                   }
  1907.                   i++;
  1908.                }
  1909.                if(shortestC != -1)
  1910.                {
  1911.                   center.x = clouds[shortestC][0].x;
  1912.                   center.y = clouds[shortestC][0].y;
  1913.                   currentCloud = clouds[shortestC][0];
  1914.                   bobber.gotoAndStop(2);
  1915.                }
  1916.             }
  1917.             if(bobber.currentFrame == 2 && bobber.ani != undefined && bobber.ani.currentFrame == 3 && !latching)
  1918.             {
  1919.                latching = true;
  1920.                bobbery = new Vector(0,-charH).rotateNew(bobber.rotation);
  1921.                rope.graphics.lineStyle(4,14277081);
  1922.                rope.graphics.moveTo(bobber.x + bobbery.x,bobber.y + bobbery.y);
  1923.                rope.graphics.lineTo(bobber.x + bobbery.x - (bobber.x + bobbery.x - center.x) / 3,bobber.y + bobbery.y - (bobber.y + bobbery.y - center.y) / 3);
  1924.                rope.graphics.lineStyle(1,16777215);
  1925.                rope.graphics.moveTo(bobber.x + bobbery.x,bobber.y + bobbery.y);
  1926.                rope.graphics.lineTo(bobber.x + bobbery.x - (bobber.x + bobbery.x - center.x) / 3,bobber.y + bobbery.y - (bobber.y + bobbery.y - center.y) / 3);
  1927.             }
  1928.             if(!anchored && !latching && bobber.currentFrame == 2 && bobber.ani != undefined && bobber.ani.currentFrame == 6 && controls == 1)
  1929.             {
  1930.                bobber.gotoAndStop(1);
  1931.             }
  1932.             if(bobber.currentFrame == 2 && !anchored)
  1933.             {
  1934.                rspeed = 0;
  1935.                bobber.rotation += Vector.angle2(new Vector(0,-1).rotateNew(bobber.rotation),new Vector(currentCloud.x - bobber.x,currentCloud.y - bobber.y)) / 3;
  1936.             }
  1937.             if(!kM)
  1938.             {
  1939.                anchored = false;
  1940.                latching = false;
  1941.                currentCloud = null;
  1942.                if(bobber.currentFrame == 2)
  1943.                {
  1944.                   bobber.gotoAndStop(1);
  1945.                }
  1946.             }
  1947.             speedC.x = -cam.x;
  1948.             speedC.y = -cam.y;
  1949.             cam.x += (cam.x - bobber.x) / -4;
  1950.             cam.y += (cam.y - bobber.y) / -4;
  1951.             speedC.x += cam.x;
  1952.             speedC.y += cam.y;
  1953.             area = range * Math.abs(speedC.x) + (range - Math.abs(speedC.x)) * Math.abs(speedC.y);
  1954.             cn = area * density;
  1955.             while(Math.random() < cn)
  1956.             {
  1957.                ass = false;
  1958.                if(Math.random() > Gravity.length - 0.3)
  1959.                {
  1960.                   ass = true;
  1961.                }
  1962.                --cn;
  1963.                if(ass && Math.random() > 0.5 || !ass)
  1964.                {
  1965.                   nnn = clouds.push(new Array(new Cloud(),0)) - 1;
  1966.                   container2.addChild(clouds[nnn][0]);
  1967.                   if(Math.random() < Math.abs(range * speedC.x) / area)
  1968.                   {
  1969.                      clouds[nnn][0].x = cam.x + Math.random() * speedC.x + range / 2 * (Math.abs(speedC.x) / speedC.x) - speedC.x;
  1970.                      clouds[nnn][0].y = cam.y + Math.random() * range - range / 2;
  1971.                   }
  1972.                   else
  1973.                   {
  1974.                      clouds[nnn][0].x = cam.x + Math.random() * range - range / 2;
  1975.                      clouds[nnn][0].y = cam.y + Math.random() * speedC.y + range / 2 * (Math.abs(speedC.y) / speedC.y) - speedC.y;
  1976.                   }
  1977.                   if(!ass)
  1978.                   {
  1979.                      grav = new Vector(0,0);
  1980.                      i = 0;
  1981.                      while(i < 5)
  1982.                      {
  1983.                         planet = planets[i][0];
  1984.                         planet1mass = planets[i][1];
  1985.                         planet1r = planets[i][2];
  1986.                         GR = new Vector(planet.x - clouds[nnn][0].x,planet.y - clouds[nnn][0].y);
  1987.                         str = GR.length;
  1988.                         GR.length = planet1mass / (str * str);
  1989.                         grav.x += GR.x;
  1990.                         grav.y += GR.y;
  1991.                         i++;
  1992.                      }
  1993.                      clouds[nnn][0].rotation = Vector.angle2(new Vector(0,1),grav);
  1994.                      clouds[nnn][0].gotoAndStop(Math.floor(Math.random() * 4) + 1);
  1995.                   }
  1996.                   else
  1997.                   {
  1998.                      clouds[nnn][0].rotation = Math.random() * 360;
  1999.                      clouds[nnn][0].gotoAndStop(Math.floor(Math.random() * 6) + 5);
  2000.                   }
  2001.                   clouds[nnn][0].scaleX = (Math.round(Math.random()) - 0.5) * 2;
  2002.                   j = 0;
  2003.                   while(j < planets.length)
  2004.                   {
  2005.                      planet2 = planets[j][0];
  2006.                      planet1mass2 = planets[j][1];
  2007.                      planet1r2 = planets[j][2];
  2008.                      if(j == 3)
  2009.                      {
  2010.                         planet1r2 = planets[3][3];
  2011.                      }
  2012.                      if(j == 1)
  2013.                      {
  2014.                         if((clouds[nnn][0].x - planet2.x) * (clouds[nnn][0].x - planet2.x) + (clouds[nnn][0].y - planet2.y) * (clouds[nnn][0].y - planet2.y) < (planet1r2 + 100) * (planet1r2 + 100))
  2015.                         {
  2016.                            container2.removeChild(clouds[nnn][0]);
  2017.                            clouds.splice(nnn,1);
  2018.                            break;
  2019.                         }
  2020.                      }
  2021.                      else if(j >= 5)
  2022.                      {
  2023.                         if((clouds[nnn][0].x - planet2.x) * (clouds[nnn][0].x - planet2.x) + (clouds[nnn][0].y - planet2.y) * (clouds[nnn][0].y - planet2.y) < (planet1r2 + 25) * (planet1r2 + 25))
  2024.                         {
  2025.                            container2.removeChild(clouds[nnn][0]);
  2026.                            clouds.splice(nnn,1);
  2027.                            break;
  2028.                         }
  2029.                      }
  2030.                      else if((clouds[nnn][0].x - planet2.x) * (clouds[nnn][0].x - planet2.x) + (clouds[nnn][0].y - planet2.y) * (clouds[nnn][0].y - planet2.y) < (planet1r2 + 200) * (planet1r2 + 200))
  2031.                      {
  2032.                         container2.removeChild(clouds[nnn][0]);
  2033.                         clouds.splice(nnn,1);
  2034.                         break;
  2035.                      }
  2036.                      j++;
  2037.                   }
  2038.                }
  2039.             }
  2040.             numcg = true;
  2041.             bbbbbbb = false;
  2042.             i = 0;
  2043.             while(i < clouds.length)
  2044.             {
  2045.                if(clouds[i][1] == 0)
  2046.                {
  2047.                   if(Math.abs(cam.x - clouds[i][0].x) > range / 2 || Math.abs(cam.y - clouds[i][0].y) > range / 2)
  2048.                   {
  2049.                      container2.removeChild(clouds[i][0]);
  2050.                      clouds.splice(i,1);
  2051.                      i--;
  2052.                   }
  2053.                   if(inside && currentCloud == clouds[i][0])
  2054.                   {
  2055.                      anchored = false;
  2056.                      latching = false;
  2057.                      currentCloud = null;
  2058.                      if(bobber.currentFrame == 2)
  2059.                      {
  2060.                         bobber.gotoAndStop(1);
  2061.                      }
  2062.                   }
  2063.                }
  2064.                if(clouds[i][1] == 2)
  2065.                {
  2066.                   clouds[i][0].visible = foregrounds[1].planet.visible;
  2067.                   if(currentCloud == clouds[i][0] && clouds[i][0].ani.currentFrame == 1 && anchored && !((grounded || controls == 2 || busty || !inside) && !gemed))
  2068.                   {
  2069.                      if(gemCounter != -1)
  2070.                      {
  2071.                         clouds[i][0].ani.gotoAndStop(2);
  2072.                         sfx = gemSounds[gemCounter].play();
  2073.                         transformSFX.volume = 1;
  2074.                         gemCounter += 1;
  2075.                      }
  2076.                   }
  2077.                   if((grounded || controls == 2 || busty || !inside) && clouds[i][0].ani.currentFrame == 2 && !gemed)
  2078.                   {
  2079.                      clouds[i][0].ani.gotoAndStop(1);
  2080.                      if(gemCounter != -1)
  2081.                      {
  2082.                         sfx = SFX[3].play();
  2083.                         transformSFX.volume = 2;
  2084.                      }
  2085.                      gemCounter = -1;
  2086.                   }
  2087.                   if(!inside && currentCloud == clouds[i][0])
  2088.                   {
  2089.                      anchored = false;
  2090.                      latching = false;
  2091.                      currentCloud = null;
  2092.                      if(bobber.currentFrame == 2)
  2093.                      {
  2094.                         bobber.gotoAndStop(1);
  2095.                      }
  2096.                   }
  2097.                   if(clouds[i][0].ani.currentFrame == 1)
  2098.                   {
  2099.                      numcg = false;
  2100.                   }
  2101.                }
  2102.                if(clouds[i][1] == 3)
  2103.                {
  2104.                   if(currentCloud == clouds[i][0])
  2105.                   {
  2106.                      bbbbbbb = true;
  2107.                      pollupy += vSPEED;
  2108.                      CFF = Math.abs(pollupy) / 3;
  2109.                      if(CFF <= 1)
  2110.                      {
  2111.                         CFF = 2;
  2112.                      }
  2113.                      if(CFF >= 201)
  2114.                      {
  2115.                         clouds[i][0].gaser.gotoAndPlay(201);
  2116.                         j = 0;
  2117.                         while(j < 20)
  2118.                         {
  2119.                            pp = int(particles.push(new Array(new Particle1(),new Vector(Math.random() * 10 + 5,0),new Vector(0,0),0.97,Math.random() * 100 - 50,40)) - 1);
  2120.                            particles[pp][1].rotate(Math.random() * 360);
  2121.                            particles[pp][0].x = clouds[i][0].x;
  2122.                            particles[pp][0].y = clouds[i][0].y;
  2123.                            particles[pp][0].gotoAndStop(Math.floor(Math.random() * 4) + 1);
  2124.                            particles[pp][0].rotation = Math.random() * 360;
  2125.                            effects.addChild(particles[pp][0]);
  2126.                            j++;
  2127.                         }
  2128.                         sfx = SFX[1].play();
  2129.                         transformSFX.volume = 1;
  2130.                         clouds[i][0].gas.play();
  2131.                         --gassed;
  2132.                         clouds[i][1] = -1;
  2133.                         anchored = false;
  2134.                         latching = false;
  2135.                         currentCloud = null;
  2136.                         if(bobber.currentFrame == 2)
  2137.                         {
  2138.                            bobber.gotoAndStop(1);
  2139.                         }
  2140.                      }
  2141.                      else if(clouds[i][0].gaser.currentFrame != CFF)
  2142.                      {
  2143.                         clouds[i][0].gaser.gotoAndStop(CFF);
  2144.                         stage.invalidate();
  2145.                      }
  2146.                   }
  2147.                   else if(clouds[i][0].gaser.currentFrame != 1 && clouds[i][1] == 3)
  2148.                   {
  2149.                      CFF = Math.abs(pollupy) / 3;
  2150.                      if(CFF <= 0)
  2151.                      {
  2152.                         CFF = 1;
  2153.                      }
  2154.                      if(CFF >= 201)
  2155.                      {
  2156.                         clouds[i][0].gaser.gotoAndPlay(201);
  2157.                         j = 0;
  2158.                         while(j < 20)
  2159.                         {
  2160.                            pp = int(particles.push(new Array(new Particle1(),new Vector(Math.random() * 10 + 5,0),new Vector(0,0),0.97,Math.random() * 100 - 50,40)) - 1);
  2161.                            particles[pp][1].rotate(Math.random() * 360);
  2162.                            particles[pp][0].x = clouds[i][0].x;
  2163.                            particles[pp][0].y = clouds[i][0].y;
  2164.                            particles[pp][0].gotoAndStop(Math.floor(Math.random() * 4) + 1);
  2165.                            particles[pp][0].rotation = Math.random() * 360;
  2166.                            effects.addChild(particles[pp][0]);
  2167.                            j++;
  2168.                         }
  2169.                         sfx = SFX[1].play();
  2170.                         transformSFX.volume = 1;
  2171.                         --gassed;
  2172.                         clouds[i][1] = -1;
  2173.                         anchored = false;
  2174.                         latching = false;
  2175.                         currentCloud = null;
  2176.                         if(bobber.currentFrame == 2)
  2177.                         {
  2178.                            bobber.gotoAndStop(1);
  2179.                         }
  2180.                      }
  2181.                      else if(clouds[i][0].gaser.currentFrame != CFF)
  2182.                      {
  2183.                         clouds[i][0].gaser.gotoAndStop(CFF);
  2184.                         stage.invalidate();
  2185.                      }
  2186.                   }
  2187.                }
  2188.                i++;
  2189.             }
  2190.             if(gemCounter == -1 && !anchored)
  2191.             {
  2192.                gemCounter = 0;
  2193.             }
  2194.             if(pollupy != 0)
  2195.             {
  2196.                if(pollupy > 0)
  2197.                {
  2198.                   pollupy -= 3;
  2199.                   if(pollupy < 0)
  2200.                   {
  2201.                      pollupy = 0;
  2202.                   }
  2203.                }
  2204.                else
  2205.                {
  2206.                   pollupy += 3;
  2207.                   if(pollupy > 0)
  2208.                   {
  2209.                      pollupy = 0;
  2210.                   }
  2211.                }
  2212.             }
  2213.             if(!bbbbbbb && pollupy != 0)
  2214.             {
  2215.                pollupy = Math.abs(pollupy);
  2216.                pollupy -= 15;
  2217.                if(pollupy < 0)
  2218.                {
  2219.                   pollupy = 0;
  2220.                }
  2221.             }
  2222.             if(numcg)
  2223.             {
  2224.                gemed = true;
  2225.             }
  2226.             alien();
  2227.             speedC.scale(2);
  2228.             sarea = srange * Math.abs(speedC.x) + (srange - Math.abs(speedC.x)) * Math.abs(speedC.y);
  2229.             sn = sarea * sdensity;
  2230.             while(Math.random() < sn)
  2231.             {
  2232.                --sn;
  2233.                nnn = stars.push(new Star()) - 1;
  2234.                starsC.addChild(stars[nnn]);
  2235.                if(Math.random() < Math.abs(srange * speedC.x) / sarea)
  2236.                {
  2237.                   stars[nnn].x = cam.x + Math.random() * speedC.x + srange / 2 * (Math.abs(speedC.x) / speedC.x) - speedC.x;
  2238.                   stars[nnn].y = cam.y + Math.random() * srange - srange / 2;
  2239.                }
  2240.                else
  2241.                {
  2242.                   stars[nnn].x = cam.x + Math.random() * srange - srange / 2;
  2243.                   stars[nnn].y = cam.y + Math.random() * speedC.y + srange / 2 * (Math.abs(speedC.y) / speedC.y) - speedC.y;
  2244.                }
  2245.                stars[nnn].rotation = Math.random() * 360;
  2246.                stars[nnn].gotoAndStop(Math.floor(Math.random() * 9) + 1);
  2247.             }
  2248.             i = 0;
  2249.             while(i < stars.length)
  2250.             {
  2251.                stars[i].x += speedC.x / 3;
  2252.                stars[i].y += speedC.y / 3;
  2253.                if(stars[i].visible)
  2254.                {
  2255.                   if(stars[i].currentFrame >= 4 && Math.random() < 0.1)
  2256.                   {
  2257.                      stars[i].visible = !stars[i].visible;
  2258.                   }
  2259.                }
  2260.                else if(stars[i].currentFrame >= 4 && Math.random() < 0.5)
  2261.                {
  2262.                   stars[i].visible = !stars[i].visible;
  2263.                }
  2264.                if(Math.abs(cam.x - stars[i].x) > srange / 2 || Math.abs(cam.y - stars[i].y) > srange / 2)
  2265.                {
  2266.                   starsC.removeChild(stars[i]);
  2267.                   stars.splice(i,1);
  2268.                   i--;
  2269.                }
  2270.                i++;
  2271.             }
  2272.             barea = brange * Math.abs(speedC.x) + (brange - Math.abs(speedC.x)) * Math.abs(speedC.y);
  2273.             bn += barea * bdensity;
  2274.             while(Math.random() < bn)
  2275.             {
  2276.                --bn;
  2277.                if(crazies.length <= 5)
  2278.                {
  2279.                   if(Math.random() < 0.3)
  2280.                   {
  2281.                      nnn = crazies.push(new Array(new Crazy(),1)) - 1;
  2282.                      back.addChild(crazies[nnn][0]);
  2283.                      if(Math.random() < Math.abs(brange * speedC.x) / barea)
  2284.                      {
  2285.                         crazies[nnn][0].x = cam.x + Math.random() * speedC.x + brange / 2 * (Math.abs(speedC.x) / speedC.x) - speedC.x;
  2286.                         crazies[nnn][0].y = cam.y + Math.random() * brange - brange / 2;
  2287.                      }
  2288.                      else
  2289.                      {
  2290.                         crazies[nnn][0].x = cam.x + Math.random() * brange - brange / 2;
  2291.                         crazies[nnn][0].y = cam.y + Math.random() * speedC.y + brange / 2 * (Math.abs(speedC.y) / speedC.y) - speedC.y;
  2292.                      }
  2293.                      crazies[nnn][0].rotation = Math.random() * 360;
  2294.                      crazies[nnn][0].scaleX = (Math.round(Math.random()) - 0.5) * 2;
  2295.                      crazies[nnn][0].gotoAndStop(Math.floor(Math.random() * 4) + 1);
  2296.                      if(won[crazies[nnn][0].currentFrame - 1] == false)
  2297.                      {
  2298.                         crazies[nnn][0].gotoAndStop(5);
  2299.                      }
  2300.                   }
  2301.                   else
  2302.                   {
  2303.                      nnn = crazies.push(new Array(new Planets(),2)) - 1;
  2304.                      back2.addChild(crazies[nnn][0]);
  2305.                      if(Math.random() < Math.abs(brange * speedC.x) / barea)
  2306.                      {
  2307.                         crazies[nnn][0].x = cam.x + Math.random() * speedC.x + brange / 2 * (Math.abs(speedC.x) / speedC.x) - speedC.x;
  2308.                         crazies[nnn][0].y = cam.y + Math.random() * brange - brange / 2;
  2309.                      }
  2310.                      else
  2311.                      {
  2312.                         crazies[nnn][0].x = cam.x + Math.random() * brange - brange / 2;
  2313.                         crazies[nnn][0].y = cam.y + Math.random() * speedC.y + brange / 2 * (Math.abs(speedC.y) / speedC.y) - speedC.y;
  2314.                      }
  2315.                      crazies[nnn][0].rotation = Math.random() * 360;
  2316.                      crazies[nnn][0].scaleX = (Math.round(Math.random()) - 0.5) * 2;
  2317.                      crazies[nnn][0].gotoAndStop(Math.floor(Math.random() * 11) + 1);
  2318.                   }
  2319.                }
  2320.             }
  2321.             i = 0;
  2322.             while(i < crazies.length)
  2323.             {
  2324.                if(crazies[i][1] == 1)
  2325.                {
  2326.                   crazies[i][0].x += speedC.x / 4;
  2327.                   crazies[i][0].y += speedC.y / 4;
  2328.                   if(Math.abs(cam.x - crazies[i][0].x) > brange / 2 || Math.abs(cam.y - crazies[i][0].y) > brange / 2)
  2329.                   {
  2330.                      back.removeChild(crazies[i][0]);
  2331.                      crazies.splice(i,1);
  2332.                      i--;
  2333.                   }
  2334.                }
  2335.                else
  2336.                {
  2337.                   crazies[i][0].x += speedC.x / 2.5;
  2338.                   crazies[i][0].y += speedC.y / 2.5;
  2339.                   if(Math.abs(cam.x - crazies[i][0].x) > brange / 2 || Math.abs(cam.y - crazies[i][0].y) > brange / 2)
  2340.                   {
  2341.                      back2.removeChild(crazies[i][0]);
  2342.                      crazies.splice(i,1);
  2343.                      i--;
  2344.                   }
  2345.                }
  2346.                i++;
  2347.             }
  2348.             if(bg.b1.alpha <= 0)
  2349.             {
  2350.                bg.b1.alpha = 0;
  2351.                bg.b1.visible = false;
  2352.             }
  2353.             else
  2354.             {
  2355.                bg.b1.visible = true;
  2356.             }
  2357.             if(bg.b2.alpha <= 0)
  2358.             {
  2359.                bg.b2.alpha = 0;
  2360.                bg.b2.visible = false;
  2361.             }
  2362.             else
  2363.             {
  2364.                bg.b2.visible = true;
  2365.             }
  2366.             if(bg.b3.alpha <= 0)
  2367.             {
  2368.                bg.b3.alpha = 0;
  2369.                bg.b3.visible = false;
  2370.             }
  2371.             else
  2372.             {
  2373.                bg.b3.visible = true;
  2374.             }
  2375.             if(bg.b4.alpha <= 0)
  2376.             {
  2377.                bg.b4.alpha = 0;
  2378.                bg.b4.visible = false;
  2379.             }
  2380.             else
  2381.             {
  2382.                bg.b4.visible = true;
  2383.             }
  2384.             if(bg.b5.alpha <= 0)
  2385.             {
  2386.                bg.b5.alpha = 0;
  2387.                bg.b5.visible = false;
  2388.             }
  2389.             else
  2390.             {
  2391.                bg.b5.visible = true;
  2392.             }
  2393.             dir.alpha = (1 - (bg.b1.alpha + bg.b2.alpha + bg.b3.alpha + bg.b4.alpha + bg.b5.alpha)) * 3;
  2394.             if(dir.alpha <= 0)
  2395.             {
  2396.                dir.visible = false;
  2397.             }
  2398.             else
  2399.             {
  2400.                dir.visible = true;
  2401.             }
  2402.             if(floating && Math.random() < 0.2)
  2403.             {
  2404.                nnn = bubbles.push(new Bubble()) - 1;
  2405.                bubblesC.addChild(bubbles[nnn]);
  2406.                bobbery = new Vector(0,-charH).rotateNew(bobber.rotation);
  2407.                bubbles[nnn].x = bobber.x + bobbery.x;
  2408.                bubbles[nnn].y = bobber.y + bobbery.y;
  2409.                bubbles[nnn].gotoAndStop(Math.floor(Math.random() * 3) + 1);
  2410.             }
  2411.             i = 0;
  2412.             while(i < bubbles.length)
  2413.             {
  2414.                rrr = new Vector(bubbles[i].x - planets[3][0].x,bubbles[i].y - planets[3][0].y);
  2415.                if(rrr.length > planets[3][3])
  2416.                {
  2417.                   bubblesC.removeChild(bubbles[i]);
  2418.                   bubbles.splice(i,1);
  2419.                   i--;
  2420.                }
  2421.                else
  2422.                {
  2423.                   rrr.norm();
  2424.                   rrr.scale(2);
  2425.                   bubbles[i].x += rrr.x + Math.random() - 0.5;
  2426.                   bubbles[i].y += rrr.y + Math.random() - 0.5;
  2427.                }
  2428.                i++;
  2429.             }
  2430.             if(planets[3][0].visible)
  2431.             {
  2432.                i = 0;
  2433.                while(i < fish.length)
  2434.                {
  2435.                   fish[i][0].visible = true;
  2436.                   rr = new Vector(fish[i][0].x - planets[3][0].x,fish[i][0].y - planets[3][0].y);
  2437.                   if(rr.length == 0)
  2438.                   {
  2439.                      rr.x = 0.1;
  2440.                   }
  2441.                   fish[i][0].rotation = Vector.angle2(new Vector(0,-1),rr);
  2442.                   fish[i][1].rotate(fish[i][2]);
  2443.                   if(Math.random() < 0.05)
  2444.                   {
  2445.                      fish[i][2] = Math.random() * 10 - 5;
  2446.                   }
  2447.                   if(rr.length > planets[3][3] - 50)
  2448.                   {
  2449.                      fish[i][1].x -= rr.x / rr.length;
  2450.                      fish[i][1].y -= rr.y / rr.length;
  2451.                   }
  2452.                   if(rr.length < planets[3][2] + 30)
  2453.                   {
  2454.                      fish[i][1].x += rr.x / rr.length;
  2455.                      fish[i][1].y += rr.y / rr.length;
  2456.                   }
  2457.                   if(Vector.dot(rr.perpendicular(),fish[i][1]) < 0)
  2458.                   {
  2459.                      fish[i][0].scaleX = -1;
  2460.                   }
  2461.                   else
  2462.                   {
  2463.                      fish[i][0].scaleX = 1;
  2464.                   }
  2465.                   if(fish[i][3] == 1)
  2466.                   {
  2467.                      if(fish[i][1].length < 1)
  2468.                      {
  2469.                         fish[i][1].length = 1;
  2470.                      }
  2471.                      if(fish[i][1].length > 4)
  2472.                      {
  2473.                         fish[i][1].length = 4;
  2474.                      }
  2475.                   }
  2476.                   else
  2477.                   {
  2478.                      if(fish[i][1].length < 0.3)
  2479.                      {
  2480.                         fish[i][1].length = 0.3;
  2481.                      }
  2482.                      if(fish[i][1].length > 2)
  2483.                      {
  2484.                         fish[i][1].length = 2;
  2485.                      }
  2486.                   }
  2487.                   fish[i][0].x += fish[i][1].x;
  2488.                   fish[i][0].y += fish[i][1].y;
  2489.                   if(Boolean(fish[i][0].box.hitTestObject(bobber.mouth)) && fish[i][3] == 1)
  2490.                   {
  2491.                      if(bobber.currentFrame != 7)
  2492.                      {
  2493.                         bobber.gotoAndStop(7);
  2494.                         sfx = SFX[0].play();
  2495.                         transformSFX.volume = 1;
  2496.                      }
  2497.                      if(fish[i][3] == 1)
  2498.                      {
  2499.                         --fished;
  2500.                      }
  2501.                      bubblesC.removeChild(fish[i][0]);
  2502.                      fish.splice(i,0);
  2503.                      i--;
  2504.                   }
  2505.                   i++;
  2506.                }
  2507.             }
  2508.             else
  2509.             {
  2510.                i = 0;
  2511.                while(i < fish.length)
  2512.                {
  2513.                   fish[i][0].visible = false;
  2514.                   i++;
  2515.                }
  2516.             }
  2517.             i = 0;
  2518.             while(i < splashes.length)
  2519.             {
  2520.                if(splashes[i].currentFrame == 20)
  2521.                {
  2522.                   effects.removeChild(splashes[i]);
  2523.                   splashes.splice(i,1);
  2524.                   i--;
  2525.                }
  2526.                i++;
  2527.             }
  2528.             i = 0;
  2529.             while(i < particles.length)
  2530.             {
  2531.                particles[i][1].x += particles[i][2].x;
  2532.                particles[i][1].y += particles[i][2].y;
  2533.                particles[i][1].scale(particles[i][3]);
  2534.                particles[i][0].x += particles[i][1].x;
  2535.                particles[i][0].y += particles[i][1].y;
  2536.                particles[i][0].rotation += particles[i][4];
  2537.                --particles[i][5];
  2538.                if(particles[i][5] < 0)
  2539.                {
  2540.                   particles[i][0].alpha -= 0.08;
  2541.                }
  2542.                if(particles[i][0].alpha <= 0)
  2543.                {
  2544.                   effects.removeChild(particles[i][0]);
  2545.                   particles.splice(i,1);
  2546.                   i--;
  2547.                }
  2548.                i++;
  2549.             }
  2550.             if(controls == 2)
  2551.             {
  2552.                if(kA)
  2553.                {
  2554.                   bobber.scaleX = 1;
  2555.                }
  2556.                if(kD)
  2557.                {
  2558.                   bobber.scaleX = -1;
  2559.                }
  2560.             }
  2561.             if(bobber.currentFrame == 5 && bobber.ani.currentFrame == 3)
  2562.             {
  2563.                bobber.gotoAndStop(3);
  2564.             }
  2565.             ++ttt;
  2566.             if(ttt > 4)
  2567.             {
  2568.                ttt = 0;
  2569.             }
  2570.             if(bobber.currentFrame == 4 && ttt == 0)
  2571.             {
  2572.                nnn = splashes.push(new Dust()) - 1;
  2573.                effects.addChild(splashes[nnn]);
  2574.                GR = new Vector(planets[currentPlanet][0].x - bobber.x,planets[currentPlanet][0].y - bobber.y);
  2575.                GR.length -= charH;
  2576.                splashes[nnn].x = planets[currentPlanet][0].x - GR.x;
  2577.                splashes[nnn].scaleX = bobber.scaleX;
  2578.                splashes[nnn].y = planets[currentPlanet][0].y - GR.y;
  2579.                splashes[nnn].rotation = Vector.angle2(new Vector(0,1),GR);
  2580.             }
  2581.             if(controls == 2 && bobber.currentFrame != 3 && bobber.currentFrame != 2 && bobber.currentFrame != 5)
  2582.             {
  2583.                if(bobber.currentFrame == 4)
  2584.                {
  2585.                   if(!kA && !kD)
  2586.                   {
  2587.                      bobber.gotoAndStop(3);
  2588.                   }
  2589.                }
  2590.                else
  2591.                {
  2592.                   bobber.gotoAndStop(5);
  2593.                   nnn = splashes.push(new Poof()) - 1;
  2594.                   effects.addChild(splashes[nnn]);
  2595.                   GR = new Vector(planets[currentPlanet][0].x - (bobber.x + speed.x),planets[currentPlanet][0].y - (bobber.y + speed.y));
  2596.                   GR.length -= charH;
  2597.                   splashes[nnn].x = planets[currentPlanet][0].x - GR.x;
  2598.                   splashes[nnn].y = planets[currentPlanet][0].y - GR.y;
  2599.                   splashes[nnn].rotation = Vector.angle2(new Vector(0,1),GR);
  2600.                }
  2601.             }
  2602.             if(controls == 2 && (kA || kD) && bobber.currentFrame != 4 && bobber.currentFrame != 2 && bobber.currentFrame != 5)
  2603.             {
  2604.                bobber.gotoAndStop(4);
  2605.                ttt = 4;
  2606.             }
  2607.             if(faderTIM > 0)
  2608.             {
  2609.                fader = 3;
  2610.                --faderTIM;
  2611.             }
  2612.             else
  2613.             {
  2614.                fader = 1;
  2615.             }
  2616.             Gravity = new Vector(planets[0][0].x - bobber.x,planets[0][0].y - bobber.y);
  2617.             strn = Gravity.length;
  2618.             Gravity.length = 672.35 / strn * 2;
  2619.             if(Gravity.length > 1)
  2620.             {
  2621.                Gravity.length = 1;
  2622.             }
  2623.             dir.d1.rotation = Vector.angle2(new Vector(0,-1),Gravity);
  2624.             transform1.volume = Gravity.length * 1.5 / fader;
  2625.             bg.b1.alpha = Gravity.length * 1.2 - 0.2;
  2626.             Gravity = new Vector(planets[1][0].x - bobber.x,planets[1][0].y - bobber.y);
  2627.             strn = Gravity.length;
  2628.             Gravity.length = 672.35 / strn * 2;
  2629.             if(Gravity.length > 1)
  2630.             {
  2631.                Gravity.length = 1;
  2632.             }
  2633.             dir.d2.rotation = Vector.angle2(new Vector(0,-1),Gravity);
  2634.             if(gassed == 0)
  2635.             {
  2636.                transform2.volume = 0.65 / fader;
  2637.                if(won[0] == false)
  2638.                {
  2639.                   flasher.play();
  2640.                   planets[1][0].gotoAndStop(2);
  2641.                   won[0] = true;
  2642.                   transformW.volume = 1.5;
  2643.                   channelW.soundTransform = transformW;
  2644.                   channelW = win1.play();
  2645.                   faderTIM = 120;
  2646.                }
  2647.             }
  2648.             else
  2649.             {
  2650.                transform2.volume = Gravity.length / fader;
  2651.             }
  2652.             bg.b2.alpha = Gravity.length * 1.2 - 0.2;
  2653.             Gravity = new Vector(planets[2][0].x - bobber.x,planets[2][0].y - bobber.y);
  2654.             strn = Gravity.length;
  2655.             Gravity.length = 672.35 / strn * 2;
  2656.             if(Gravity.length > 1)
  2657.             {
  2658.                Gravity.length = 1;
  2659.             }
  2660.             dir.d3.rotation = Vector.angle2(new Vector(0,-1),Gravity);
  2661.             if(gemed)
  2662.             {
  2663.                transform3.volume = 1 / fader;
  2664.                if(won[1] == false)
  2665.                {
  2666.                   flasher.play();
  2667.                   planets[2][0].gotoAndStop(2);
  2668.                   foregrounds[1].gotoAndStop(2);
  2669.                   stage.invalidate();
  2670.                   won[1] = true;
  2671.                   transformW.volume = 1.75;
  2672.                   channelW.soundTransform = transformW;
  2673.                   channelW = win2.play();
  2674.                   faderTIM = 120;
  2675.                }
  2676.             }
  2677.             else
  2678.             {
  2679.                transform3.volume = Gravity.length * 1.3 / fader;
  2680.             }
  2681.             bg.b3.alpha = Gravity.length * 1.2 - 0.2;
  2682.             Gravity = new Vector(planets[3][0].x - bobber.x,planets[3][0].y - bobber.y);
  2683.             strn = Gravity.length;
  2684.             Gravity.length = 672.35 / strn * 2;
  2685.             if(Gravity.length > 1)
  2686.             {
  2687.                Gravity.length = 1;
  2688.             }
  2689.             dir.d4.rotation = Vector.angle2(new Vector(0,-1),Gravity);
  2690.             if(fished == 0)
  2691.             {
  2692.                transform4.volume = 0.8 / fader;
  2693.                if(won[2] == false)
  2694.                {
  2695.                   flasher.play();
  2696.                   planets[3][0].gotoAndStop(2);
  2697.                   foregrounds[2].gotoAndStop(2);
  2698.                   planets[9][0].gotoAndStop(2);
  2699.                   won[2] = true;
  2700.                   transformW.volume = 1.5;
  2701.                   channelW.soundTransform = transformW;
  2702.                   channelW = win3.play();
  2703.                   faderTIM = 120;
  2704.                }
  2705.             }
  2706.             else
  2707.             {
  2708.                transform4.volume = Gravity.length * 1.3 / fader;
  2709.             }
  2710.             bg.b4.alpha = Gravity.length * 1.2 - 0.2;
  2711.             Gravity = new Vector(planets[4][0].x - bobber.x,planets[4][0].y - bobber.y);
  2712.             strn = Gravity.length;
  2713.             Gravity.length = 672.35 / strn * 2;
  2714.             if(Gravity.length > 1)
  2715.             {
  2716.                Gravity.length = 1;
  2717.             }
  2718.             dir.d5.rotation = Vector.angle2(new Vector(0,-1),Gravity);
  2719.             if(mooned == 4)
  2720.             {
  2721.                transform5.volume = 1 / fader;
  2722.                if(won[3] == false)
  2723.                {
  2724.                   flasher.play();
  2725.                   won[3] = true;
  2726.                   transformW.volume = 2;
  2727.                   channelW.soundTransform = transformW;
  2728.                   channelW = win4.play();
  2729.                   faderTIM = 120;
  2730.                }
  2731.             }
  2732.             else
  2733.             {
  2734.                transform5.volume = Gravity.length * 2 / fader;
  2735.             }
  2736.             bg.b5.alpha = Gravity.length * 1.2 - 0.2;
  2737.             sfx.soundTransform = transformSFX;
  2738.             channel1.soundTransform = transform1;
  2739.             channel2.soundTransform = transform2;
  2740.             channel3.soundTransform = transform3;
  2741.             channel4.soundTransform = transform4;
  2742.             channel5.soundTransform = transform5;
  2743.             channelB.soundTransform = transformB;
  2744.             Gravity = new Vector(0,0);
  2745.             i = 0;
  2746.             while(i < 5)
  2747.             {
  2748.                planet = planets[i][0];
  2749.                planet1mass = planets[i][1];
  2750.                planet1r = planets[i][2];
  2751.                GR = new Vector(planet.x - bobber.x,planet.y - bobber.y);
  2752.                str = GR.length;
  2753.                GR.length = planet1mass / (str * str);
  2754.                Gravity.x += GR.x;
  2755.                Gravity.y += GR.y;
  2756.                i++;
  2757.             }
  2758.             if(Gravity.length > 5)
  2759.             {
  2760.                targSiz = 900 - 5 * 70;
  2761.             }
  2762.             else
  2763.             {
  2764.                targSiz = 900 - Gravity.length * 70;
  2765.             }
  2766.             i = 5;
  2767.             while(i < planets.length)
  2768.             {
  2769.                planet = planets[i][0];
  2770.                planet1mass = planets[i][1];
  2771.                planet1r = planets[i][2];
  2772.                GR = new Vector(planet.x - bobber.x,planet.y - bobber.y);
  2773.                str = GR.length;
  2774.                GR.length = planet1mass / (str * str);
  2775.                Gravity.x += GR.x;
  2776.                Gravity.y += GR.y;
  2777.                i++;
  2778.             }
  2779.             if(Gravity.length > 5)
  2780.             {
  2781.                Gravity.length = 5;
  2782.             }
  2783.             if(!ended)
  2784.             {
  2785.                cam.w += (cam.w - targSiz) / -4;
  2786.                cam.h += (cam.h - targSiz) / -4;
  2787.                cam.r += Vector.angle2(new Vector(0,1).rotateNew(cam.r),Gravity) / 8;
  2788.             }
  2789.             dir.x = cam.x;
  2790.             dir.y = cam.y;
  2791.             bg.x = cam.x;
  2792.             bg.y = cam.y;
  2793.             bg.rotation = cam.r;
  2794.             i = 0;
  2795.             while(i < 5)
  2796.             {
  2797.                planet = planets[i][0];
  2798.                GR = new Vector(planet.x - cam.x,planet.y - cam.y);
  2799.                if(GR.length > 2000)
  2800.                {
  2801.                   planet.visible = false;
  2802.                }
  2803.                else
  2804.                {
  2805.                   planet.visible = true;
  2806.                }
  2807.                i++;
  2808.             }
  2809.             i = 0;
  2810.             while(i < foregrounds.length)
  2811.             {
  2812.                planet = foregrounds[i];
  2813.                GR = new Vector(planet.x - cam.x,planet.y - cam.y);
  2814.                if(GR.length > 2000)
  2815.                {
  2816.                   planet.visible = false;
  2817.                }
  2818.                else
  2819.                {
  2820.                   planet.visible = true;
  2821.                }
  2822.                i++;
  2823.             }
  2824.             if(isNaN(bobber.rotation) || bobber.rotation == undefined)
  2825.             {
  2826.                bobber.rotation = 0;
  2827.             }
  2828.             if(speed.x == undefined || isNaN(speed.x) || speed.y == undefined || isNaN(speed.y))
  2829.             {
  2830.                speed.x = 0;
  2831.                speed.y = 0;
  2832.             }
  2833.             if(namesT != 0)
  2834.             {
  2835.                --namesT;
  2836.                names.visible = true;
  2837.                if(names.alpha < 1)
  2838.                {
  2839.                   names.alpha += 0.03;
  2840.                }
  2841.             }
  2842.             else if(names.alpha > 0)
  2843.             {
  2844.                names.alpha -= 0.03;
  2845.             }
  2846.             else
  2847.             {
  2848.                names.visible = false;
  2849.             }
  2850.             dir.d2.visible = !won[0];
  2851.             dir.d3.visible = !won[1];
  2852.             dir.d4.visible = !won[2];
  2853.             dir.d5.visible = !won[3];
  2854.             if(planets[0][0].currentFrame == 6)
  2855.             {
  2856.                dir.d1.visible = false;
  2857.             }
  2858.             winned = int(won[0]) + int(won[1]) + int(won[2]) + int(won[3]);
  2859.             if(planets[0][0].currentFrame != winned + 1 && planets[0][0].currentFrame != 6)
  2860.             {
  2861.                planets[0][0].gotoAndStop(winned + 1);
  2862.                planets[0][2] = earths[winned - 1];
  2863.             }
  2864.             talk.scaleX = cam.sx + 0.3;
  2865.             talk.scaleY = cam.sy + 0.3;
  2866.             dir.scaleX = cam.sx;
  2867.             dir.scaleY = cam.sy;
  2868.             bg.scaleX = cam.sy;
  2869.             bg.scaleY = cam.sy;
  2870.             cam.update();
  2871.          }
  2872.          catch(e:Error)
  2873.          {
  2874.          }
  2875.       }
  2876.       
  2877.       internal function frame4() : *
  2878.       {
  2879.          stop();
  2880.          linkAG.addEventListener(MouseEvent.CLICK,ag_btnclick,false,0,true);
  2881.          linkAG2.addEventListener(MouseEvent.CLICK,ag_btnclick2,false,0,true);
  2882.          linkGG.addEventListener(MouseEvent.CLICK,gg_btnclick,false,0,true);
  2883.          linkED.addEventListener(MouseEvent.CLICK,ed_btnclick,false,0,true);
  2884.          btn1.addEventListener(MouseEvent.CLICK,playBTN,false,0,true);
  2885.          btn3.addEventListener(MouseEvent.CLICK,downloadable,false,0,true);
  2886.       }
  2887.       
  2888.       public function mouseHandelerD(param1:MouseEvent) : *
  2889.       {
  2890.          if(!paus)
  2891.          {
  2892.             kM = true;
  2893.          }
  2894.       }
  2895.       
  2896.       public function lockControls() : *
  2897.       {
  2898.          kW = false;
  2899.          kS = false;
  2900.          kA = false;
  2901.          kD = false;
  2902.          kUp = false;
  2903.          kDown = false;
  2904.          kLeft = false;
  2905.          kRight = false;
  2906.          kM = false;
  2907.          kSpace = false;
  2908.       }
  2909.       
  2910.       public function mouseHandelerU(param1:MouseEvent) : *
  2911.       {
  2912.          if(!paus)
  2913.          {
  2914.             kM = false;
  2915.          }
  2916.       }
  2917.       
  2918.       public function gg_btnclick(param1:MouseEvent) : *
  2919.       {
  2920.          navigateToURL(new URLRequest("http://www.glaielgames.com"),"_blank");
  2921.       }
  2922.       
  2923.       public function credy() : *
  2924.       {
  2925.          framey = "credits";
  2926.          fadery.play();
  2927.       }
  2928.       
  2929.       public function downloadable(param1:MouseEvent) : *
  2930.       {
  2931.          navigateToURL(new URLRequest("http://www.armorgames.com/misc/downloads/aether.zip"),"_blank");
  2932.       }
  2933.       
  2934.       public function expl(param1:MouseEvent) : *
  2935.       {
  2936.          explode = true;
  2937.       }
  2938.       
  2939.       public function goBTN2(param1:Event) : *
  2940.       {
  2941.          cut.play();
  2942.       }
  2943.       
  2944.       public function calculatepcent(param1:ProgressEvent) : *
  2945.       {
  2946.          loadPerc = param1.bytesLoaded / param1.bytesTotal;
  2947.       }
  2948.       
  2949.       public function playBTN(param1:Event) : *
  2950.       {
  2951.          framey = "cutscene";
  2952.          fadery.play();
  2953.       }
  2954.       
  2955.       public function aliem() : *
  2956.       {
  2957.          var _loc1_:int = 0;
  2958.          var _loc2_:int = 0;
  2959.          var _loc3_:int = 0;
  2960.          var _loc4_:int = 0;
  2961.          var _loc5_:int = 0;
  2962.          var _loc6_:int = 0;
  2963.          var _loc7_:int = 0;
  2964.          var _loc8_:Vector = null;
  2965.          var _loc9_:Vector = null;
  2966.          var _loc10_:int = 0;
  2967.          var _loc11_:MovieClip = null;
  2968.          var _loc12_:* = undefined;
  2969.          var _loc13_:* = undefined;
  2970.          var _loc14_:Vector = null;
  2971.          var _loc15_:Number = NaN;
  2972.          aliens.push(new Array(new Hippo(),1,2,0,0.4,new Array("\nSometimes my stomach hurts...","\nI\'ll be happy when I\'m dead."),new Vector(100,-90)));
  2973.          aliens.push(new Array(new Bird(),1,100,0,3,new Array("\nIt\'s sad to be alone.","\nAt least no one can hurt me here."),new Vector(50,-50)));
  2974.          _loc1_ = 0;
  2975.          while(_loc1_ < 15)
  2976.          {
  2977.             aliens.push(new Array(new Bird(),1.1,2,0,0.8,new Array(""),new Vector(0,0)));
  2978.             _loc1_++;
  2979.          }
  2980.          aliens.push(new Array(new Boy1(),1,1,0,1,new Array("\nI\'m stuck \nhere because I\'m â”¬Ã¡bad.","I\'m going to blow this place up one day."),new Vector(70,-80)));
  2981.          aliens.push(new Array(new Boy2(),1.2,1,0,1,new Array("...\nWhy do you look like me?\n..."),new Vector(0,-170)));
  2982.          aliens.push(new Array(new Dead(),1.2,12,0,1,new Array("\nI\'m cool cause I\'m dead.","\n\nMy feet itch..."),new Vector(50,-70)));
  2983.          aliens.push(new Array(new Screamo2(),1,11,0,1,new Array("\n\nAAAAHHHHH!!","\n\nDon\'t Hurt Me!"),new Vector(70,-90)));
  2984.          _loc2_ = 0;
  2985.          while(_loc2_ < 4)
  2986.          {
  2987.             aliens.push(new Array(new Screamo1(),1.1,11,0,1.5,new Array(""),new Vector(60,-70)));
  2988.             _loc2_++;
  2989.          }
  2990.          aliens.push(new Array(new Slug(),1.3,4,0,0.2,new Array("I\'ll never amount to anything, they all think I\'m dumb.","\nOne day I\'ll be great and show them all!"),new Vector(140,-130)));
  2991.          aliens.push(new Array(new Sunfish(),2,3,new Vector(3,0),3,new Array("\nYou\'re nothing special.","\nLeave me alone."),new Vector(90,-70),planets[3][2],planets[3][3] - 100,0));
  2992.          _loc3_ = 0;
  2993.          while(_loc3_ < 70)
  2994.          {
  2995.             _loc7_ = int(aliens.push(new Array(new Wiggle(),2.1,4,new Vector(Math.random() * 4 - 2,Math.random() * 4 - 2),2,new Array(""),new Vector(0,0),planets[4][2] + 20,planets[4][2] + 200,0)));
  2996.             aliens[_loc7_ - 1][0].ani.gotoAndPlay(Math.floor(Math.random() * 16) + 1);
  2997.             _loc3_++;
  2998.          }
  2999.          _loc4_ = 0;
  3000.          while(_loc4_ < 25)
  3001.          {
  3002.             aliens.push(new Array(new Birdy(),2.2,0,new Vector(0,-5),6,new Array(""),new Vector(0,0),planets[0][2],planets[0][2] + 300,0));
  3003.             _loc4_++;
  3004.          }
  3005.          aliens.push(new Array(new Tube1(),3,14,0,0.4,new Array("\n\nI\'m glad I left.","\nI wonder if they think about me."),new Vector(70,-70)));
  3006.          aliens.push(new Array(new Tube2(),3.2,13,0,0.4,new Array("\nWe are glad he\'s gone."),new Vector(70,-70)));
  3007.          aliens.push(new Array(new Tube2(),3.1,13,0,0.4,new Array(""),new Vector(70,-70)));
  3008.          aliens.push(new Array(new Tube2(),3.1,13,0,0.4,new Array(""),new Vector(70,-70)));
  3009.          _loc5_ = int(aliens.push(new Array(new Runaway(),4,-1,0,0.4,new Array("\nI\'m so outta here!","\nWhere\'s the bathroom?"),new Vector(100,-80))) - 1);
  3010.          aliens[_loc5_][0].x = 0;
  3011.          aliens[_loc5_][0].y = 10000;
  3012.          _loc5_ = int(aliens.push(new Array(new Spaceman(),4,-1,0,0.4,new Array("\nYou really shouldn\'t be out here.","\nIt\'s not safe out here alone."),new Vector(100,-80))) - 1);
  3013.          aliens[_loc5_][0].x = 10000;
  3014.          aliens[_loc5_][0].y = -1000;
  3015.          _loc5_ = int(aliens.push(new Array(new Lost(),4,-1,0,0.4,new Array("\nAm I going to die?"),new Vector(60,-50))) - 1);
  3016.          aliens[_loc5_][0].x = -12000;
  3017.          aliens[_loc5_][0].y = 1000;
  3018.          _loc6_ = 0;
  3019.          while(_loc6_ < aliens.length)
  3020.          {
  3021.             container1.addChild(aliens[_loc6_][0]);
  3022.             if(aliens[_loc6_][1] != 4)
  3023.             {
  3024.                if(aliens[_loc6_][2] != 100)
  3025.                {
  3026.                   if(aliens[_loc6_][1] != 1.2)
  3027.                   {
  3028.                      (_loc8_ = new Vector(planets[aliens[_loc6_][2]][2],0)).rotate(Math.random() * 360);
  3029.                      aliens[_loc6_][0].x = planets[aliens[_loc6_][2]][0].x + _loc8_.x;
  3030.                      aliens[_loc6_][0].y = planets[aliens[_loc6_][2]][0].y + _loc8_.y;
  3031.                      aliens[_loc6_][0].rotation = Vector.angle2(new Vector(0,-1),_loc8_);
  3032.                   }
  3033.                   else
  3034.                   {
  3035.                      _loc8_ = new Vector(0,-planets[aliens[_loc6_][2]][2]);
  3036.                      aliens[_loc6_][0].x = planets[aliens[_loc6_][2]][0].x + _loc8_.x;
  3037.                      aliens[_loc6_][0].y = planets[aliens[_loc6_][2]][0].y + _loc8_.y;
  3038.                      aliens[_loc6_][0].rotation = Vector.angle2(new Vector(0,-1),_loc8_);
  3039.                   }
  3040.                }
  3041.                else
  3042.                {
  3043.                   (_loc8_ = new Vector(planets[2][3],0)).rotate(Math.random() * 360);
  3044.                   aliens[_loc6_][0].x = planets[2][0].x + _loc8_.x;
  3045.                   aliens[_loc6_][0].y = planets[2][0].y + _loc8_.y;
  3046.                   aliens[_loc6_][0].rotation = Vector.angle2(new Vector(0,-1),_loc8_);
  3047.                }
  3048.             }
  3049.             else
  3050.             {
  3051.                _loc9_ = new Vector(0,0);
  3052.                _loc10_ = 0;
  3053.                while(_loc10_ < 5)
  3054.                {
  3055.                   _loc11_ = planets[_loc10_][0];
  3056.                   _loc12_ = planets[_loc10_][1];
  3057.                   _loc13_ = planets[_loc10_][2];
  3058.                   _loc15_ = (_loc14_ = new Vector(_loc11_.x - aliens[_loc6_][0].x,_loc11_.y - aliens[_loc6_][0].y)).length;
  3059.                   _loc14_.length = _loc12_ / (_loc15_ * _loc15_);
  3060.                   _loc9_.x += _loc14_.x;
  3061.                   _loc9_.y += _loc14_.y;
  3062.                   _loc10_++;
  3063.                }
  3064.                aliens[_loc6_][0].rotation = Vector.angle2(new Vector(0,1),_loc9_);
  3065.             }
  3066.             _loc6_++;
  3067.          }
  3068.       }
  3069.       
  3070.       public function alien() : *
  3071.       {
  3072.          var _loc1_:int = 0;
  3073.          var _loc2_:Number = NaN;
  3074.          var _loc3_:MovieClip = null;
  3075.          var _loc4_:Number = NaN;
  3076.          var _loc5_:Vector = null;
  3077.          var _loc6_:Vector = null;
  3078.          var _loc7_:Vector = null;
  3079.          var _loc8_:Number = NaN;
  3080.          var _loc9_:Number = NaN;
  3081.          var _loc10_:Vector = null;
  3082.          _loc1_ = 0;
  3083.          while(_loc1_ < aliens.length)
  3084.          {
  3085.             if(aliens[_loc1_][2] != 100 && aliens[_loc1_][2] != -1)
  3086.             {
  3087.                aliens[_loc1_][0].visible = planets[aliens[_loc1_][2]][0].visible;
  3088.             }
  3089.             if(aliens[_loc1_][0].visible)
  3090.             {
  3091.                if(aliens[_loc1_][1] == 1 || aliens[_loc1_][1] == 1.1 || aliens[_loc1_][1] == 1.2 || aliens[_loc1_][1] == 1.3)
  3092.                {
  3093.                   if(Math.random() < 0.05)
  3094.                   {
  3095.                      aliens[_loc1_][3] = (Math.floor(Math.random() * 3) - 1) * aliens[_loc1_][4];
  3096.                   }
  3097.                   if(aliens[_loc1_][2] == 2 && aliens[_loc1_][0].y < planets[2][0].y && aliens[_loc1_][0].x - planets[2][0].x < 100 && aliens[_loc1_][0].x - planets[2][0].x >= 0)
  3098.                   {
  3099.                      aliens[_loc1_][3] = aliens[_loc1_][4];
  3100.                   }
  3101.                   if(aliens[_loc1_][2] == 2 && aliens[_loc1_][0].y < planets[2][0].y && aliens[_loc1_][0].x - planets[2][0].x > -100 && aliens[_loc1_][0].x - planets[2][0].x < 0)
  3102.                   {
  3103.                      aliens[_loc1_][3] = -aliens[_loc1_][4];
  3104.                   }
  3105.                   if(aliens[_loc1_][1] == 1.2)
  3106.                   {
  3107.                      aliens[_loc1_][3] = 0;
  3108.                   }
  3109.                   if(aliens[_loc1_][2] == 100)
  3110.                   {
  3111.                      _loc2_ = Number(planets[2][3]);
  3112.                      _loc3_ = planets[2][0];
  3113.                   }
  3114.                   else
  3115.                   {
  3116.                      _loc2_ = Number(planets[aliens[_loc1_][2]][2]);
  3117.                      _loc3_ = planets[aliens[_loc1_][2]][0];
  3118.                   }
  3119.                   _loc4_ = (aliens[_loc1_][0].x - bobber.x) * (aliens[_loc1_][0].x - bobber.x) + (aliens[_loc1_][0].y - bobber.y) * (aliens[_loc1_][0].y - bobber.y);
  3120.                   if(aliens[_loc1_][1] != 1.1)
  3121.                   {
  3122.                      if(_loc4_ < 100 * 100 || _loc4_ < 150 * 150 && aliens[_loc1_][1] == 1.3)
  3123.                      {
  3124.                         if(talph == 0)
  3125.                         {
  3126.                            if(aliens[_loc1_][0].currentFrame != 3 && aliens[_loc1_][0].currentFrame != 4)
  3127.                            {
  3128.                               if(aliens[_loc1_][1] == 1.3)
  3129.                               {
  3130.                                  _loc5_ = new Vector(aliens[_loc1_][0].y - bobber.y,-aliens[_loc1_][0].x + bobber.x);
  3131.                                  if(Vector.dot(_loc5_,Gravity) < 0)
  3132.                                  {
  3133.                                     aliens[_loc1_][0].gotoAndStop(4);
  3134.                                     talk.visible = true;
  3135.                                     talk.txt.text = aliens[_loc1_][5][0];
  3136.                                     talph = 1;
  3137.                                     talk.bubb.scaleX = 1;
  3138.                                  }
  3139.                                  else
  3140.                                  {
  3141.                                     aliens[_loc1_][0].gotoAndStop(3);
  3142.                                     talk.visible = true;
  3143.                                     talk.txt.text = aliens[_loc1_][5][1];
  3144.                                     talph = 1;
  3145.                                     talk.bubb.scaleX = -1;
  3146.                                  }
  3147.                                  _loc6_ = new Vector(talk.bubb.scaleX * -aliens[_loc1_][6].x * talk.scaleX,aliens[_loc1_][6].y * talk.scaleY);
  3148.                                  if(talk.bubb.scaleX == 1)
  3149.                                  {
  3150.                                     _loc6_.y = -90;
  3151.                                  }
  3152.                                  _loc6_.rotate(Vector.angle2(new Vector(0,-1),new Vector(0,-1).rotateNew(aliens[_loc1_][0].rotation)));
  3153.                                  talk.x = aliens[_loc1_][0].x + _loc6_.x;
  3154.                                  talk.y = aliens[_loc1_][0].y + _loc6_.y;
  3155.                                  talk.rotation = aliens[_loc1_][0].rotation;
  3156.                               }
  3157.                               else
  3158.                               {
  3159.                                  aliens[_loc1_][0].gotoAndStop(3);
  3160.                                  talk.visible = true;
  3161.                                  talk.txt.text = aliens[_loc1_][5][Math.floor(Math.random() * aliens[_loc1_][5].length)];
  3162.                                  talph = 1;
  3163.                               }
  3164.                            }
  3165.                         }
  3166.                         if(talph == 1 && (aliens[_loc1_][0].currentFrame == 3 || aliens[_loc1_][0].currentFrame == 4))
  3167.                         {
  3168.                            if(aliens[_loc1_][1] != 1.2 && aliens[_loc1_][1] != 1.3)
  3169.                            {
  3170.                               _loc5_ = new Vector(aliens[_loc1_][0].y - bobber.y,-aliens[_loc1_][0].x + bobber.x);
  3171.                               if(Vector.dot(_loc5_,Gravity) < 0)
  3172.                               {
  3173.                                  aliens[_loc1_][0].scaleX = 1;
  3174.                               }
  3175.                               else
  3176.                               {
  3177.                                  aliens[_loc1_][0].scaleX = -1;
  3178.                               }
  3179.                            }
  3180.                            if(aliens[_loc1_][1] != 1.3)
  3181.                            {
  3182.                               (_loc6_ = new Vector(aliens[_loc1_][0].scaleX * -aliens[_loc1_][6].x * talk.scaleX,aliens[_loc1_][6].y * talk.scaleY)).rotate(Vector.angle2(new Vector(0,-1),new Vector(0,-1).rotateNew(aliens[_loc1_][0].rotation)));
  3183.                               talk.x = aliens[_loc1_][0].x + _loc6_.x;
  3184.                               talk.y = aliens[_loc1_][0].y + _loc6_.y;
  3185.                               talk.rotation = aliens[_loc1_][0].rotation;
  3186.                               talk.bubb.scaleX = aliens[_loc1_][0].scaleX;
  3187.                            }
  3188.                         }
  3189.                      }
  3190.                      else if((aliens[_loc1_][0].currentFrame == 3 || aliens[_loc1_][0].currentFrame == 4) && (_loc4_ > 150 * 150 && aliens[_loc1_][1] != 1.3 || _loc4_ > 200 * 200 && aliens[_loc1_][1] == 1.3))
  3191.                      {
  3192.                         if(aliens[_loc1_][0].currentFrame == 3 || aliens[_loc1_][0].currentFrame == 4)
  3193.                         {
  3194.                            aliens[_loc1_][0].gotoAndStop(1);
  3195.                            talph = 0;
  3196.                         }
  3197.                      }
  3198.                   }
  3199.                   if(aliens[_loc1_][3] != 0 && aliens[_loc1_][0].currentFrame != 3 && aliens[_loc1_][0].currentFrame != 4)
  3200.                   {
  3201.                      (_loc7_ = new Vector(aliens[_loc1_][0].x - _loc3_.x,aliens[_loc1_][0].y - _loc3_.y)).rotate(aliens[_loc1_][3]);
  3202.                      _loc7_.length = _loc2_;
  3203.                      if(aliens[_loc1_][1] != 1.3)
  3204.                      {
  3205.                         if(aliens[_loc1_][3] > 0)
  3206.                         {
  3207.                            aliens[_loc1_][0].scaleX = -1;
  3208.                         }
  3209.                         else
  3210.                         {
  3211.                            aliens[_loc1_][0].scaleX = 1;
  3212.                         }
  3213.                      }
  3214.                      if(aliens[_loc1_][0].currentFrame == 1)
  3215.                      {
  3216.                         aliens[_loc1_][0].gotoAndStop(2);
  3217.                      }
  3218.                      aliens[_loc1_][0].x = _loc3_.x + _loc7_.x;
  3219.                      aliens[_loc1_][0].y = _loc3_.y + _loc7_.y;
  3220.                      aliens[_loc1_][0].rotation = Vector.angle2(new Vector(0,-1),_loc7_);
  3221.                   }
  3222.                   else if(aliens[_loc1_][0].currentFrame == 2)
  3223.                   {
  3224.                      aliens[_loc1_][0].gotoAndStop(1);
  3225.                   }
  3226.                   if(aliens[_loc1_][2] == 1 && gassed == 0)
  3227.                   {
  3228.                      container1.removeChild(aliens[_loc1_][0]);
  3229.                      aliens.splice(_loc1_,1);
  3230.                      _loc1_--;
  3231.                   }
  3232.                }
  3233.             }
  3234.             if(aliens[_loc1_][1] == 2.2)
  3235.             {
  3236.                aliens[_loc1_][7] = planets[0][2];
  3237.                if(planets[0][2] < 100)
  3238.                {
  3239.                   container1.removeChild(aliens[_loc1_][0]);
  3240.                   aliens.splice(_loc1_,1);
  3241.                   _loc1_--;
  3242.                }
  3243.             }
  3244.             if(aliens[_loc1_][1] == 2 || aliens[_loc1_][1] == 2.1 || aliens[_loc1_][1] == 2.2)
  3245.             {
  3246.                _loc8_ = Number(aliens[_loc1_][7]);
  3247.                _loc9_ = Number(aliens[_loc1_][8]);
  3248.                if(aliens[_loc1_][2] == 100)
  3249.                {
  3250.                   _loc3_ = planets[2][0];
  3251.                }
  3252.                else
  3253.                {
  3254.                   _loc3_ = planets[aliens[_loc1_][2]][0];
  3255.                }
  3256.                if((_loc10_ = new Vector(aliens[_loc1_][0].x - _loc3_.x,aliens[_loc1_][0].y - _loc3_.y)).length2 == 0)
  3257.                {
  3258.                   _loc10_.x = 0.1;
  3259.                }
  3260.                aliens[_loc1_][0].rotation = Vector.angle2(new Vector(0,-1),_loc10_);
  3261.                if(aliens[_loc1_][1] != 2.1)
  3262.                {
  3263.                   aliens[_loc1_][3].rotate(aliens[_loc1_][9]);
  3264.                   if(Math.random() < 0.05)
  3265.                   {
  3266.                      aliens[_loc1_][9] = Math.random() * 20 - 10;
  3267.                   }
  3268.                }
  3269.                if(_loc10_.length2 > _loc9_ * _loc9_)
  3270.                {
  3271.                   aliens[_loc1_][3].x -= _loc10_.x / _loc10_.length;
  3272.                   aliens[_loc1_][3].y -= _loc10_.y / _loc10_.length;
  3273.                }
  3274.                if(_loc10_.length2 < _loc8_ * _loc8_)
  3275.                {
  3276.                   aliens[_loc1_][3].x += _loc10_.x / _loc10_.length;
  3277.                   aliens[_loc1_][3].y += _loc10_.y / _loc10_.length;
  3278.                   if(aliens[_loc1_][1] == 2.2 && aliens[_loc1_][0].currentFrame == 1)
  3279.                   {
  3280.                      aliens[_loc1_][0].gotoAndStop(4);
  3281.                   }
  3282.                }
  3283.                if(aliens[_loc1_][1] != 2.1)
  3284.                {
  3285.                   if(Vector.dot(_loc10_.perpendicular(),aliens[_loc1_][3]) < 0)
  3286.                   {
  3287.                      aliens[_loc1_][0].scaleX = -1;
  3288.                   }
  3289.                   else
  3290.                   {
  3291.                      aliens[_loc1_][0].scaleX = 1;
  3292.                   }
  3293.                }
  3294.                if(aliens[_loc1_][3].length2 < 1)
  3295.                {
  3296.                   aliens[_loc1_][3].length = 1;
  3297.                }
  3298.                if(aliens[_loc1_][3].length2 > aliens[_loc1_][4] * aliens[_loc1_][4])
  3299.                {
  3300.                   aliens[_loc1_][3].length = aliens[_loc1_][4];
  3301.                }
  3302.                _loc4_ = (aliens[_loc1_][0].x - bobber.x) * (aliens[_loc1_][0].x - bobber.x) + (aliens[_loc1_][0].y - bobber.y) * (aliens[_loc1_][0].y - bobber.y);
  3303.                if(aliens[_loc1_][1] == 2.2 && (_loc4_ < 100 * 100 || Math.random() < 0.005 || _loc10_.length2 > (_loc8_ + 10) * (_loc8_ + 10)) && aliens[_loc1_][0].currentFrame == 4)
  3304.                {
  3305.                   aliens[_loc1_][0].gotoAndStop(1);
  3306.                }
  3307.                if(aliens[_loc1_][0].currentFrame != 4)
  3308.                {
  3309.                   aliens[_loc1_][0].x += aliens[_loc1_][3].x;
  3310.                   aliens[_loc1_][0].y += aliens[_loc1_][3].y;
  3311.                }
  3312.                if(aliens[_loc1_][1] != 2.1 && aliens[_loc1_][1] != 2.2)
  3313.                {
  3314.                   if(_loc4_ < 150 * 150)
  3315.                   {
  3316.                      if(talph == 0)
  3317.                      {
  3318.                         if(aliens[_loc1_][0].currentFrame != 2 && aliens[_loc1_][0].currentFrame != 3)
  3319.                         {
  3320.                            aliens[_loc1_][0].gotoAndStop(2);
  3321.                            talk.visible = true;
  3322.                            talk.txt.text = aliens[_loc1_][5][Math.floor(Math.random() * aliens[_loc1_][5].length)];
  3323.                            talph = 1;
  3324.                         }
  3325.                      }
  3326.                      if(talph == 1 && (aliens[_loc1_][0].currentFrame == 2 || aliens[_loc1_][0].currentFrame == 3))
  3327.                      {
  3328.                         (_loc6_ = new Vector(-aliens[_loc1_][0].scaleX * -aliens[_loc1_][6].x * talk.scaleX,aliens[_loc1_][6].y * talk.scaleY)).rotate(Vector.angle2(new Vector(0,-1),new Vector(0,-1).rotateNew(aliens[_loc1_][0].rotation)));
  3329.                         talk.x = aliens[_loc1_][0].x + _loc6_.x;
  3330.                         talk.y = aliens[_loc1_][0].y + _loc6_.y;
  3331.                         talk.rotation = aliens[_loc1_][0].rotation;
  3332.                         talk.bubb.scaleX = -aliens[_loc1_][0].scaleX;
  3333.                      }
  3334.                   }
  3335.                   else if((aliens[_loc1_][0].currentFrame == 2 || aliens[_loc1_][0].currentFrame == 3) && _loc4_ > 150 * 150)
  3336.                   {
  3337.                      if(aliens[_loc1_][0].currentFrame == 2 || aliens[_loc1_][0].currentFrame == 3)
  3338.                      {
  3339.                         aliens[_loc1_][0].gotoAndStop(1);
  3340.                         talph = 0;
  3341.                      }
  3342.                   }
  3343.                }
  3344.             }
  3345.             if(aliens[_loc1_][1] == 3 || aliens[_loc1_][1] == 3.1 || aliens[_loc1_][1] == 3.2)
  3346.             {
  3347.                _loc4_ = (aliens[_loc1_][0].x - bobber.x) * (aliens[_loc1_][0].x - bobber.x) + (aliens[_loc1_][0].y - bobber.y) * (aliens[_loc1_][0].y - bobber.y);
  3348.                if(aliens[_loc1_][1] == 3)
  3349.                {
  3350.                   if(_loc4_ < 150 * 150 && currentPlanet == aliens[_loc1_][2])
  3351.                   {
  3352.                      if(aliens[_loc1_][0].currentFrame == 1 && aliens[_loc1_][0].ani != null && aliens[_loc1_][0].ani.currentFrame >= 9)
  3353.                      {
  3354.                         aliens[_loc1_][0].gotoAndStop(2);
  3355.                      }
  3356.                   }
  3357.                   else if(aliens[_loc1_][0].currentFrame == 2 && aliens[_loc1_][0].ani != null && aliens[_loc1_][0].ani.currentFrame >= 9)
  3358.                   {
  3359.                      aliens[_loc1_][0].gotoAndStop(1);
  3360.                   }
  3361.                }
  3362.                else if(Math.random() < 0.03 && aliens[_loc1_][0].currentFrame != 3)
  3363.                {
  3364.                   if(aliens[_loc1_][0].currentFrame == 1 && aliens[_loc1_][0].ani != null && aliens[_loc1_][0].ani.currentFrame >= 9)
  3365.                   {
  3366.                      aliens[_loc1_][0].gotoAndStop(2);
  3367.                   }
  3368.                   else if(aliens[_loc1_][0].currentFrame == 2 && aliens[_loc1_][0].ani != null && aliens[_loc1_][0].ani.currentFrame >= 9)
  3369.                   {
  3370.                      aliens[_loc1_][0].gotoAndStop(1);
  3371.                   }
  3372.                }
  3373.                if(_loc4_ < 50 * 50 && aliens[_loc1_][0].currentFrame == 2)
  3374.                {
  3375.                   if(talph == 0 && aliens[_loc1_][1] != 3.1)
  3376.                   {
  3377.                      if(aliens[_loc1_][0].currentFrame == 2 && aliens[_loc1_][0].ani != null && aliens[_loc1_][0].ani.currentFrame >= 9)
  3378.                      {
  3379.                         aliens[_loc1_][0].gotoAndStop(3);
  3380.                         talk.visible = true;
  3381.                         talk.txt.text = aliens[_loc1_][5][Math.floor(Math.random() * aliens[_loc1_][5].length)];
  3382.                         talph = 1;
  3383.                         talk.bubb.scaleX = 1;
  3384.                         (_loc6_ = new Vector(aliens[_loc1_][0].scaleX * -aliens[_loc1_][6].x * talk.scaleX,aliens[_loc1_][6].y * talk.scaleY)).rotate(Vector.angle2(new Vector(0,-1),new Vector(0,-1).rotateNew(aliens[_loc1_][0].rotation)));
  3385.                         talk.x = aliens[_loc1_][0].x + _loc6_.x;
  3386.                         talk.y = aliens[_loc1_][0].y + _loc6_.y;
  3387.                         talk.rotation = aliens[_loc1_][0].rotation;
  3388.                         talk.bubb.scaleX = aliens[_loc1_][0].scaleX;
  3389.                      }
  3390.                   }
  3391.                }
  3392.                if(_loc4_ > 100 * 100 && aliens[_loc1_][0].currentFrame == 3)
  3393.                {
  3394.                   talph = 0;
  3395.                   aliens[_loc1_][0].gotoAndStop(1);
  3396.                }
  3397.             }
  3398.             if(aliens[_loc1_][1] == 4)
  3399.             {
  3400.                if((_loc4_ = (aliens[_loc1_][0].x - bobber.x) * (aliens[_loc1_][0].x - bobber.x) + (aliens[_loc1_][0].y - bobber.y) * (aliens[_loc1_][0].y - bobber.y)) < 150 * 150)
  3401.                {
  3402.                   if(talph == 0)
  3403.                   {
  3404.                      if(aliens[_loc1_][0].currentFrame == 1)
  3405.                      {
  3406.                         aliens[_loc1_][0].gotoAndStop(2);
  3407.                         talk.visible = true;
  3408.                         talk.txt.text = aliens[_loc1_][5][Math.floor(Math.random() * aliens[_loc1_][5].length)];
  3409.                         talph = 1;
  3410.                         talk.bubb.scaleX = 1;
  3411.                         (_loc6_ = new Vector(aliens[_loc1_][0].scaleX * -aliens[_loc1_][6].x * talk.scaleX,aliens[_loc1_][6].y * talk.scaleY)).rotate(Vector.angle2(new Vector(0,-1),new Vector(0,-1).rotateNew(aliens[_loc1_][0].rotation)));
  3412.                         talk.x = aliens[_loc1_][0].x + _loc6_.x;
  3413.                         talk.y = aliens[_loc1_][0].y + _loc6_.y;
  3414.                         talk.rotation = aliens[_loc1_][0].rotation;
  3415.                         talk.bubb.scaleX = aliens[_loc1_][0].scaleX;
  3416.                      }
  3417.                   }
  3418.                }
  3419.                if(_loc4_ > 200 * 200 && aliens[_loc1_][0].currentFrame == 2)
  3420.                {
  3421.                   talph = 0;
  3422.                   aliens[_loc1_][0].gotoAndStop(1);
  3423.                }
  3424.             }
  3425.             _loc1_++;
  3426.          }
  3427.          talk.alpha += (talph - (talk.alpha - (talph - 0.5))) / 10;
  3428.          if(talk.alpha < 0.01)
  3429.          {
  3430.             talk.visible = false;
  3431.          }
  3432.          else
  3433.          {
  3434.             talk.visible = true;
  3435.          }
  3436.       }
  3437.       
  3438.       public function backBTN2(param1:Event) : *
  3439.       {
  3440.          framey = "title";
  3441.          fadery.play();
  3442.       }
  3443.       
  3444.       public function shake(param1:Event) : *
  3445.       {
  3446.          var e:Event = param1;
  3447.          try
  3448.          {
  3449.             if(clouds[8][1] != -1)
  3450.             {
  3451.                clouds[8][0].gaser.poppy.gotoAndPlay(Math.floor(Math.random() * 5) + 1);
  3452.             }
  3453.             if(clouds[9][1] != -1)
  3454.             {
  3455.                clouds[9][0].gaser.poppy.gotoAndPlay(Math.floor(Math.random() * 5) + 1);
  3456.             }
  3457.             if(clouds[10][1] != -1)
  3458.             {
  3459.                clouds[10][0].gaser.poppy.gotoAndPlay(Math.floor(Math.random() * 5) + 1);
  3460.             }
  3461.             if(clouds[11][1] != -1)
  3462.             {
  3463.                clouds[11][0].gaser.poppy.gotoAndPlay(Math.floor(Math.random() * 5) + 1);
  3464.             }
  3465.             if(gemed && inside)
  3466.             {
  3467.                foregrounds[1].planet.gotoAndStop(30);
  3468.                planets[2][0].planet.gotoAndStop(30);
  3469.             }
  3470.          }
  3471.          catch(e:Error)
  3472.          {
  3473.          }
  3474.       }
  3475.       
  3476.       public function uexpl(param1:MouseEvent) : *
  3477.       {
  3478.          explode = false;
  3479.       }
  3480.    }
  3481. }
  3482.