home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 165 / XENIATGM165.ISO / cddata / upframe.cxt / 00003_topMenu3.swf / scripts / frame_138 / DoAction.as < prev   
Encoding:
Text File  |  2003-03-06  |  1.9 KB  |  89 lines

  1. function calldesc(descr)
  2. {
  3.    if(descr != _root.desc)
  4.    {
  5.       _root.desc = descr;
  6.       getURL("event: calldescr " + _root.desc,"");
  7.       trace(_root.desc);
  8.    }
  9. }
  10. function posiziona(id)
  11. {
  12.    var i = 1;
  13.    while(i < 5)
  14.    {
  15.       if(i != id)
  16.       {
  17.          this["b" + i].onEnterFrame = function()
  18.          {
  19.             this.ds = (90 - this._xscale) / 3;
  20.             this._xscale = this._yscale += this.ds;
  21.             if(Math.abs(this.ds) < 0.01)
  22.             {
  23.                this._xscale = this._yscale = 90;
  24.                delete this.onEnterFrame;
  25.             }
  26.          };
  27.       }
  28.       else
  29.       {
  30.          this["b" + i].onEnterFrame = function()
  31.          {
  32.             this.ds = (120 - this._xscale) / 3;
  33.             this._xscale = this._yscale += this.ds;
  34.             if(Math.abs(this.ds) < 0.01)
  35.             {
  36.                this._xscale = this._yscale = 120;
  37.                delete this.onEnterFrame;
  38.             }
  39.          };
  40.       }
  41.       i++;
  42.    }
  43. }
  44. function riposiziona()
  45. {
  46.    var i = 1;
  47.    while(i < 5)
  48.    {
  49.       this["b" + i].onEnterFrame = function()
  50.       {
  51.          this.ds = (100 - this._xscale) / 3;
  52.          this._xscale = this._yscale += this.ds;
  53.          if(Math.abs(this.ds) < 0.01)
  54.          {
  55.             this._xscale = this._yscale = 100;
  56.             delete this.onEnterFrame;
  57.          }
  58.       };
  59.       i++;
  60.    }
  61. }
  62. stop();
  63. s1 = new Sound();
  64. s1.attachSound("snd_1");
  65. s2 = new Sound();
  66. s2.attachSound("snd_2");
  67. desc = 0;
  68. var i = 1;
  69. while(i < 5)
  70. {
  71.    this["b" + i].id = i;
  72.    this["b" + i].onRollOver = function()
  73.    {
  74.       posiziona(this.id);
  75.       this.gotoAndPlay(2);
  76.       s1.start(0,0);
  77.    };
  78.    this["b" + i].onRollOut = this["b" + i].onReleaseOutside = function()
  79.    {
  80.       riposiziona();
  81.       this.gotoAndPlay(22);
  82.    };
  83.    this["b" + i].onRelease = function()
  84.    {
  85.       linka(this.id);
  86.    };
  87.    i++;
  88. }
  89.