home *** CD-ROM | disk | FTP | other *** search
/ The Great Adventure of Natural Gas / start / start.swf / scripts / frame_2 / DoAction_2.as next >
Encoding:
Text File  |  2007-01-01  |  3.3 KB  |  124 lines

  1. stop();
  2. fscommand("fullscreen","true");
  3. fscommand("showmenu","false");
  4. MovieClip.prototype.bounceScale = function(targetx, targety, accel, convert)
  5. {
  6.    var _loc1_ = this;
  7.    _loc1_.xpos = 1;
  8.    _loc1_.ypos = 1;
  9.    _loc1_.onEnterFrame = function()
  10.    {
  11.       var _loc1_ = this;
  12.       if(_loc1_.xpos < 2 && Math.abs(_loc1_._xscale - targetx) < 5)
  13.       {
  14.          _loc1_._xscale = targetx;
  15.          _loc1_._yscale = targety;
  16.          _loc1_.fonction();
  17.          delete _loc1_.onEnterFrame;
  18.       }
  19.       else
  20.       {
  21.          _loc1_.xpos = _loc1_.xpos * accel + (targetx - _loc1_._xscale) * convert;
  22.          _loc1_.ypos = _loc1_.ypos * accel + (targety - _loc1_._yscale) * convert;
  23.          _loc1_._xscale += _loc1_.ypos;
  24.          _loc1_._yscale += _loc1_.xpos;
  25.       }
  26.    };
  27. };
  28. MovieClip.prototype.transAlpha = function(fin, accel)
  29. {
  30.    var _loc1_ = this;
  31.    _loc1_.createEmptyMovieClip("mcAlpha",8426);
  32.    var o = _loc1_;
  33.    _loc1_.mcAlpha.onEnterFrame = function()
  34.    {
  35.       var _loc1_ = fin - o._alpha;
  36.       if(Math.abs(_loc1_) <= 2)
  37.       {
  38.          o._alpha = fin;
  39.          this.removeMovieClip();
  40.          this.fonction();
  41.       }
  42.       else
  43.       {
  44.          o._alpha = Math.round(o._alpha + _loc1_ / accel) + 1;
  45.       }
  46.    };
  47. };
  48. MovieClip.prototype.softGo = function(tgtx, tgty, accel)
  49. {
  50.    var _loc1_ = this;
  51.    _loc1_.targetx = tgtx;
  52.    _loc1_.targety = tgty;
  53.    _loc1_.accel = accel;
  54.    _loc1_.onEnterFrame = function()
  55.    {
  56.       var _loc1_ = this;
  57.       _loc1_._x += (_loc1_.targetx - _loc1_._x) / _loc1_.accel;
  58.       _loc1_._y += (_loc1_.targety - _loc1_._y) / _loc1_.accel;
  59.       if(Math.abs(_loc1_._x - _loc1_.targetx) + Math.abs(_loc1_._y - _loc1_.targety) < 2)
  60.       {
  61.          _loc1_._x = _loc1_.targetx;
  62.          _loc1_._y = _loc1_.targety;
  63.          delete _loc1_.onEnterFrame;
  64.       }
  65.    };
  66. };
  67. MovieClip.prototype.flashSoluce = function(f)
  68. {
  69.    var _loc1_ = this;
  70.    playSound("sonflash",60);
  71.    if(f != null)
  72.    {
  73.       _loc1_.fonction = f;
  74.    }
  75.    _loc1_.flashcoul = new Color(_loc1_);
  76.    _loc1_.valeurFlash = 200;
  77.    _loc1_.onEnterFrame = function()
  78.    {
  79.       var _loc1_ = this;
  80.       var _loc2_ = new Object();
  81.       _loc2_.rb = _loc1_.valeurFlash;
  82.       _loc2_.gb = _loc1_.valeurFlash;
  83.       _loc2_.bb = _loc1_.valeurFlash;
  84.       _loc1_.flashcoul.setTransform(_loc2_);
  85.       _loc1_.valeurFlash -= 40;
  86.       if(_loc1_.valeurFlash <= 100)
  87.       {
  88.          _loc1_.fonction();
  89.          _loc1_.fonction = null;
  90.       }
  91.       if(_loc1_.valeurFlash <= 0)
  92.       {
  93.          _loc2_ = new Object();
  94.          _loc2_.rb = 0;
  95.          _loc2_.gb = 0;
  96.          _loc2_.bb = 0;
  97.          _loc1_.flashcoul.setTransform(_loc2_);
  98.          delete _loc1_.onEnterFrame;
  99.       }
  100.    };
  101. };
  102. MovieClip.prototype.softGoTo = function(tgtx, tgty, a)
  103. {
  104.    var _loc1_ = this;
  105.    _loc1_.targetx = tgtx;
  106.    _loc1_.targety = tgty;
  107.    _loc1_.accel = a;
  108.    _loc1_.onEnterFrame = function()
  109.    {
  110.       var _loc1_ = this;
  111.       if(Math.abs(_loc1_._x - _loc1_.targetx) + Math.abs(_loc1_._y - _loc1_.targety) < 3)
  112.       {
  113.          _loc1_._x = _loc1_.targetx;
  114.          _loc1_._y = _loc1_.targety;
  115.          delete _loc1_.onEnterFrame;
  116.       }
  117.       else
  118.       {
  119.          _loc1_._x += (_loc1_.targetx - _loc1_._x) * _loc1_.accel;
  120.          _loc1_._y += (_loc1_.targety - _loc1_._y) * _loc1_.accel;
  121.       }
  122.    };
  123. };
  124.