home *** CD-ROM | disk | FTP | other *** search
/ Champak 120 / Vol 120.iso / games / how_to_m.swf / scripts / DefineSprite_471 / frame_1 / DoAction.as
Encoding:
Text File  |  2010-11-09  |  10.6 KB  |  508 lines

  1. function time()
  2. {
  3.    iduu++;
  4.    bowlTwo._alpha -= 25;
  5.    muffinPlate._alpha += 25;
  6.    finalMix.mix._alpha -= 25;
  7.    mixBucket._visible = false;
  8.    seedMix._visible = false;
  9.    stickBary._visible = false;
  10.    yogurtMix._visible = false;
  11.    bary00._visible = false;
  12.    seed00._visible = false;
  13.    eggMix._visible = false;
  14.    if(iduu == 4)
  15.    {
  16.       ins14._visible = true;
  17.       clearInterval(id);
  18.       dpts++;
  19.       LemonSprey();
  20.    }
  21. }
  22. function CloseDoor()
  23. {
  24.    delete oven.doorOpen.onPress;
  25.    oven.doorOpen.onPress = function()
  26.    {
  27.       delete plate.onPress;
  28.       oven.gotoAndPlay(16);
  29.       onEnterFrame = function()
  30.       {
  31.          if(oven._currentframe == 19)
  32.          {
  33.             delete onEnterFrame;
  34.             TunnerOven();
  35.          }
  36.       };
  37.    };
  38. }
  39. function TunnerOven()
  40. {
  41.    oven.tunnerOven.onPress = function()
  42.    {
  43.       ins16._visible = false;
  44.       tCount++;
  45.       if(tCount <= 3)
  46.       {
  47.          oven.tunnerOven._rotation += 30;
  48.       }
  49.       else
  50.       {
  51.          delete oven.tunnerOven.onPress;
  52.       }
  53.       if(tCount >= 3)
  54.       {
  55.          oven.gotoAndPlay(21);
  56.       }
  57.    };
  58. }
  59. stop();
  60. spoonPwdr._visible = false;
  61. spoonSoda._visible = false;
  62. spoonSlt._visible = false;
  63. bowlMix._visible = false;
  64. bowlTwo._visible = false;
  65. butterPlate._visible = false;
  66. eggMix._visible = false;
  67. seed00._visible = false;
  68. seedMix._visible = false;
  69. yogurtMix._visible = false;
  70. bary00._visible = false;
  71. stickBary._visible = false;
  72. mixBucket._visible = false;
  73. finalMix._visible = false;
  74. muffinPlate._visible = false;
  75. muffinPlate._alpha = 0;
  76. var dpts = 10;
  77. var i = 2;
  78. while(i <= 22)
  79. {
  80.    eval("ins" + i)._visible = false;
  81.    i++;
  82. }
  83. flour.onPress = function()
  84. {
  85.    ins1._visible = false;
  86.    this.swapDepths(dpts);
  87.    Mouse.hide();
  88.    this.startDrag();
  89. };
  90. flour.onRelease = function()
  91. {
  92.    if(bowl.hitTest(this))
  93.    {
  94.       stopDrag();
  95.       Mouse.show();
  96.       this.gotoAndStop(2);
  97.       this._x = 444.7;
  98.       this._y = 242;
  99.       dpts++;
  100.    }
  101. };
  102. _global.BakingBowder = function()
  103. {
  104.    bakingBowder.onPress = function()
  105.    {
  106.       ins2._visible = false;
  107.       this.swapDepths(dpts);
  108.       Mouse.hide();
  109.       this.startDrag();
  110.    };
  111.    bakingBowder.onRelease = function()
  112.    {
  113.       if(bowl.hitTest(this))
  114.       {
  115.          stopDrag();
  116.          bakingBowder.gotoAndPlay(2);
  117.          Mouse.show();
  118.          this._x = 381.8;
  119.          this._y = 268;
  120.          dpts++;
  121.       }
  122.    };
  123. };
  124. _global.BakingSoda = function()
  125. {
  126.    bakingSoda.onPress = function()
  127.    {
  128.       ins3._visible = false;
  129.       this.swapDepths(dpts);
  130.       Mouse.hide();
  131.       this.startDrag();
  132.    };
  133.    bakingSoda.onRelease = function()
  134.    {
  135.       if(bowl.hitTest(this))
  136.       {
  137.          stopDrag();
  138.          bakingSoda.gotoAndPlay(2);
  139.          Mouse.show();
  140.          this._x = 381.8;
  141.          this._y = 275;
  142.          dpts++;
  143.       }
  144.    };
  145. };
  146. _global.Salt = function()
  147. {
  148.    salt.onPress = function()
  149.    {
  150.       ins4._visible = false;
  151.       this.swapDepths(dpts);
  152.       Mouse.hide();
  153.       this.startDrag();
  154.    };
  155.    salt.onRelease = function()
  156.    {
  157.       if(bowl.hitTest(this))
  158.       {
  159.          stopDrag();
  160.          salt.gotoAndPlay(2);
  161.          Mouse.show();
  162.          this._x = 381.8;
  163.          this._y = 268;
  164.          dpts++;
  165.       }
  166.    };
  167. };
  168. _global.BowlMix = function()
  169. {
  170.    bowlMix.onPress = function()
  171.    {
  172.       ins5._visible = false;
  173.       this.swapDepths(dpts);
  174.       Mouse.hide();
  175.       this.startDrag();
  176.    };
  177.    bowlMix.onRelease = function()
  178.    {
  179.       if(bowlHit.hitTest(this))
  180.       {
  181.          ins6._visible = true;
  182.          stopDrag();
  183.          Mouse.show();
  184.          this._x = 492;
  185.          this._y = 260;
  186.          dpts++;
  187.          bowlTwo._visible = true;
  188.          delete bowlMix.onPress;
  189.          delete bowlMix.onRelease;
  190.          Sugar();
  191.       }
  192.    };
  193. };
  194. Sugar = function()
  195. {
  196.    sugar.onPress = function()
  197.    {
  198.       ins6._visible = false;
  199.       this.swapDepths(dpts);
  200.       Mouse.hide();
  201.       this.startDrag();
  202.    };
  203.    sugar.onRelease = function()
  204.    {
  205.       if(bowl.hitTest(this))
  206.       {
  207.          ins7._visible = true;
  208.          stopDrag();
  209.          Mouse.show();
  210.          this.gotoAndStop(2);
  211.          this._x = 407;
  212.          this._y = 247;
  213.          dpts++;
  214.       }
  215.    };
  216. };
  217. _global.Butter = function()
  218. {
  219.    butter.onPress = function()
  220.    {
  221.       ins7._visible = false;
  222.       this.swapDepths(dpts);
  223.       Mouse.hide();
  224.       this.startDrag();
  225.    };
  226.    butter.onRelease = function()
  227.    {
  228.       if(bowlTwo.hitTest(this))
  229.       {
  230.          ins8._visible = true;
  231.          stopDrag();
  232.          Mouse.show();
  233.          this.gotoAndPlay(2);
  234.          this._x = 11.8;
  235.          this._y = 13.8;
  236.          dpts++;
  237.       }
  238.    };
  239. };
  240. var eggCnt = 0;
  241. _global.Egg = function()
  242. {
  243.    var i = 0;
  244.    while(i < 3)
  245.    {
  246.       eval("egg" + i).onPress = function()
  247.       {
  248.          ins8._visible = false;
  249.          this.swapDepths(dpts);
  250.          Mouse.hide();
  251.          this.startDrag();
  252.       };
  253.       eval("egg" + i).onRelease = function()
  254.       {
  255.          if(bowlTwo.hitTest(this))
  256.          {
  257.             eggCnt++;
  258.             stopDrag();
  259.             Mouse.show();
  260.             this.gotoAndPlay(2);
  261.             this._x = 367.8;
  262.             this._y = 239.3;
  263.             if(eggCnt == 2 && eval("egg" + i)._currentframe == eval("egg" + i)._totalframes)
  264.             {
  265.                ins9._visible = true;
  266.                eggMix._visible = true;
  267.                EggMix();
  268.             }
  269.             dpts++;
  270.          }
  271.       };
  272.       i++;
  273.    }
  274. };
  275. EggMix = function()
  276. {
  277.    eggMix.onPress = function()
  278.    {
  279.       ins9._visible = false;
  280.       var i = 0;
  281.       while(i < 3)
  282.       {
  283.          eval("egg" + i)._alpha -= 25;
  284.          i++;
  285.       }
  286.       sugar._alpha -= 25;
  287.       butter._alpha -= 25;
  288.       eggMix.spoonIn.nextFrame();
  289.       eggMix.eggIn.nextFrame();
  290.       if(eggMix.spoonIn._currentframe == eggMix.spoonIn._totalframes)
  291.       {
  292.          delete eggMix.onPress;
  293.          delete eggMix.onRelease;
  294.          ins10._visible = true;
  295.          EllowSeed();
  296.       }
  297.    };
  298. };
  299. EllowSeed = function()
  300. {
  301.    ellowSeed.onPress = function()
  302.    {
  303.       ins10._visible = false;
  304.       this.swapDepths(dpts);
  305.       Mouse.hide();
  306.       this.startDrag();
  307.    };
  308.    ellowSeed.onRelease = function()
  309.    {
  310.       if(bowlTwo.hitTest(this))
  311.       {
  312.          ins19._visible = true;
  313.          stopDrag();
  314.          Mouse.show();
  315.          this._visible = false;
  316.          seed00._visible = true;
  317.          seedMix._visible = true;
  318.          dpts++;
  319.          EllowMix();
  320.       }
  321.    };
  322. };
  323. EllowMix = function()
  324. {
  325.    sMix.onPress = function()
  326.    {
  327.       ins19._visible = false;
  328.       seed00._alpha -= 25;
  329.       seedMix.stick.nextFrame();
  330.       seedMix.mix.nextFrame();
  331.       if(seedMix.stick._currentframe == seedMix.stick._totalframes)
  332.       {
  333.          delete sMix.onPress;
  334.          delete seedMix.onPress;
  335.          ins11._visible = true;
  336.          Yogurt();
  337.       }
  338.    };
  339. };
  340. Yogurt = function()
  341. {
  342.    yogBot.onPress = function()
  343.    {
  344.       ins20._visible = true;
  345.       ins11._visible = false;
  346.       yogBot.yogGreem._visible = false;
  347.       yogurtMix._visible = true;
  348.       delete yogBot.onPress;
  349.    };
  350.    yogMix.onRelease = function()
  351.    {
  352.       ins20._visible = false;
  353.       yogurtMix.stick.nextFrame();
  354.       yogurtMix.mix.nextFrame();
  355.       if(yogurtMix.stick._currentframe == yogurtMix.stick._totalframes)
  356.       {
  357.          delete yogMix.onRelease;
  358.          ins12._visible = true;
  359.          Bary();
  360.       }
  361.    };
  362. };
  363. Bary = function()
  364. {
  365.    bary.onPress = function()
  366.    {
  367.       ins12._visible = false;
  368.       this.swapDepths(dpts);
  369.       Mouse.hide();
  370.       this.startDrag();
  371.    };
  372.    bary.onRelease = function()
  373.    {
  374.       if(bowlTwo.hitTest(this))
  375.       {
  376.          ins21._visible = true;
  377.          stopDrag();
  378.          Mouse.show();
  379.          this._visible = false;
  380.          bary00._visible = true;
  381.          stickBary._visible = true;
  382.          delete bary.onPress;
  383.          delete bary.onRelease;
  384.          BaryMix();
  385.       }
  386.       dpts++;
  387.    };
  388. };
  389. BaryMix = function()
  390. {
  391.    bMix.onPress = function()
  392.    {
  393.       ins21._visible = false;
  394.       stickBary.nextFrame();
  395.       bary00._alpha -= 10;
  396.       if(stickBary._currentframe == stickBary._totalframes)
  397.       {
  398.          delete bMix.onPress;
  399.          ins13._visible = true;
  400.          TwoBowlMix();
  401.       }
  402.    };
  403. };
  404. TwoBowlMix = function()
  405. {
  406.    bowlMix.onPress = function()
  407.    {
  408.       ins13._visible = false;
  409.       this.swapDepths(dpts);
  410.       Mouse.hide();
  411.       this.startDrag();
  412.    };
  413.    bowlMix.onRelease = function()
  414.    {
  415.       if(bowlTwo.hitTest(this))
  416.       {
  417.          dpts++;
  418.          stopDrag();
  419.          this._visible = false;
  420.          Mouse.show();
  421.          mixBucket._visible = true;
  422.          mixBucket.swapDepths(dpts);
  423.          mixBucket.gotoAndPlay(2);
  424.          if(mixBucket._currentframe == mixBucket._totalframes)
  425.          {
  426.             delete bowlMix.onPress;
  427.             delete bowlMix.onRelease;
  428.          }
  429.       }
  430.       dpts++;
  431.    };
  432. };
  433. var iduu = 0;
  434. _global.FinalMix = function()
  435. {
  436.    finalMix.swapDepths(dpts);
  437.    finalMix.onPress = function()
  438.    {
  439.       ins22._visible = false;
  440.       finalMix.stick.nextFrame();
  441.       finalMix.mix.nextFrame();
  442.       if(finalMix.stick._currentframe == finalMix.stick._totalframes)
  443.       {
  444.          delete finalMix.onPress;
  445.          muffinPlate._visible = true;
  446.          id = setInterval(time,500);
  447.       }
  448.    };
  449. };
  450. LemonSprey = function()
  451. {
  452.    sprey.onPress = function()
  453.    {
  454.       ins14._visible = false;
  455.       this.swapDepths(dpts);
  456.       this.startDrag();
  457.    };
  458.    sprey.onRelease = function()
  459.    {
  460.       if(muffinPlate.hitTest(this))
  461.       {
  462.          stopDrag();
  463.          sprey.gotoAndPlay(2);
  464.          this._x = 293;
  465.          this._y = 217;
  466.       }
  467.       dpts++;
  468.    };
  469. };
  470. var hit = 0;
  471. _global.MuffinPlateMove = function()
  472. {
  473.    function aa()
  474.    {
  475.       oven.gotoAndStop(15);
  476.       muffinPlate._visible = false;
  477.       stopDrag();
  478.       delete muffinPlate.onPress;
  479.       CloseDoor();
  480.    }
  481.    muffinPlate.onPress = function()
  482.    {
  483.       ins15._visible = false;
  484.       Mouse.hide();
  485.       if(oven._currentframe == 14 && oven.hitTest(this))
  486.       {
  487.          aa();
  488.       }
  489.       this.swapDepths(depths++);
  490.       muffinPlate.startDrag();
  491.       updateAfterEvent();
  492.       muffinPlate.onMouseMove = function()
  493.       {
  494.          Mouse.show();
  495.          if(oven.hitTest(this))
  496.          {
  497.             hit += 1;
  498.             if(hit == 1)
  499.             {
  500.                oven.gotoAndPlay(2);
  501.             }
  502.          }
  503.       };
  504.    };
  505.    var _loc2_ = 0;
  506. };
  507. var tCount = 0;
  508.