home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Diversos / particles.swf / scripts / __Packages / tloader.as < prev   
Encoding:
Text File  |  2007-03-20  |  5.4 KB  |  148 lines

  1. class tloader
  2. {
  3.    var scrittamc;
  4.    var myformat;
  5.    var tsm;
  6.    var i;
  7.    var deltamult = 1;
  8.    var olddeltatime = getTimer();
  9.    var screenw = 450;
  10.    var screenh = 450;
  11.    var dotmult = 0;
  12.    var numdots = 0;
  13.    var phase = 0;
  14.    var scrittealpha = 100;
  15.    function tloader()
  16.    {
  17.    }
  18.    function init()
  19.    {
  20.       this.scrittamc = new Array();
  21.       this.myformat = new TextFormat();
  22.       this.myformat.font = "verdana11";
  23.       this.myformat.bold = false;
  24.       var _loc4_ = new flash.filters.DropShadowFilter(2,135,0,1,4,4,0.7,1,false,false,false);
  25.       this.tsm = _root.createEmptyMovieClip("tsm",1500);
  26.       this.tsm.testo = "RAGDOLLSOFT.COM";
  27.       this.tsm.scritte = new Array();
  28.       this.i = 0;
  29.       while(this.i < this.tsm.testo.length)
  30.       {
  31.          this.tsm.scritte[this.i] = this.tsm.createEmptyMovieClip("scritta" + this.i,this.i);
  32.          this.tsm.scritte[this.i].createTextField("scritta",0,0,0,0,0);
  33.          this.tsm.scritte[this.i].scritta.textColor = 0;
  34.          this.tsm.scritte[this.i].scritta.setNewTextFormat(this.myformat);
  35.          this.tsm.scritte[this.i].scritta.text = this.tsm.testo.substr(this.i,1);
  36.          this.tsm.scritte[this.i]._xscale = 130;
  37.          this.tsm.scritte[this.i]._yscale = 130;
  38.          this.tsm.scritte[this.i].scritta.autoSize = true;
  39.          this.tsm.scritte[this.i].scritta.selectable = false;
  40.          this.tsm.scritte[this.i].scritta.embedFonts = true;
  41.          this.tsm.scritte[this.i]._visible = true;
  42.          var _loc3_ = this.tsm.scritte[this.i].filters;
  43.          _loc3_.push(_loc4_);
  44.          this.tsm.scritte[this.i].filters = _loc3_;
  45.          this.tsm.scritte[this.i].x = this.i * 13.5;
  46.          this.tsm.scritte[this.i].y = -20;
  47.          this.tsm.scritte[this.i].yv = 0;
  48.          this.tsm.scritte[this.i].delay = this.i * 6;
  49.          this.i = this.i + 1;
  50.       }
  51.       this.tsm._x = this.screenw / 2 - this.tsm._width / 2;
  52.       this.i = 0;
  53.       while(this.i < 2)
  54.       {
  55.          this.scrittamc[this.i] = _root.createEmptyMovieClip("scritteloader" + this.i,11100 + this.i);
  56.          this.scrittamc[this.i].createTextField("scritta",0,0,0,0,0);
  57.          this.scrittamc[this.i].scritta.textColor = 0;
  58.          this.scrittamc[this.i].scritta.setTextFormat(this.myformat);
  59.          this.scrittamc[this.i]._xscale = 100;
  60.          this.scrittamc[this.i]._yscale = 100;
  61.          this.scrittamc[this.i].scritta.autoSize = true;
  62.          this.scrittamc[this.i].scritta.selectable = false;
  63.          this.scrittamc[this.i].scritta.embedFonts = true;
  64.          this.scrittamc[this.i]._visible = false;
  65.          _loc3_ = this.scrittamc[this.i].filters;
  66.          _loc3_.push(_loc4_);
  67.          this.scrittamc[this.i].filters = _loc3_;
  68.          this.i = this.i + 1;
  69.       }
  70.       this.scrittamc[1].scritta.text = "LOADING...";
  71.       this.scrittamc[1].scritta.setTextFormat(this.myformat);
  72.       this.scrittamc[1]._xscale = 130;
  73.       this.scrittamc[1]._yscale = 130;
  74.       this.scrittamc[1]._x = this.screenw / 2 - this.scrittamc[1]._width / 2;
  75.       this.tsm.onRelease = function()
  76.       {
  77.          getUrl("http://www.ragdollsoft.com", "blank");
  78.       };
  79.    }
  80.    function loop()
  81.    {
  82.       var _loc4_ = getTimer() - this.olddeltatime;
  83.       this.deltamult = Math.min(_loc4_,40) / 28.571428571428573;
  84.       this.tsm._x = this.screenw / 2 - this.tsm._width / 2;
  85.       this.i = 0;
  86.       while(this.i < this.tsm.testo.length)
  87.       {
  88.          this.tsm.scritte[this.i].delay -= 1;
  89.          this.tsm.scritte[this.i].delay = Math.max(-1,this.tsm.scritte[this.i].delay);
  90.          if(this.tsm.scritte[this.i].delay < 0)
  91.          {
  92.             this.tsm.scritte[this.i].yv += 0.02;
  93.             this.tsm.scritte[this.i].y += this.tsm.scritte[this.i].yv * this.deltamult;
  94.          }
  95.          if(this.tsm.scritte[this.i].y > 120)
  96.          {
  97.             this.tsm.scritte[this.i].y = 119.999;
  98.             this.tsm.scritte[this.i].yv *= -0.9;
  99.          }
  100.          this.tsm.scritte[this.i]._y = this.tsm.scritte[this.i].y;
  101.          this.tsm.scritte[this.i]._x = this.tsm.scritte[this.i].x;
  102.          this.i = this.i + 1;
  103.       }
  104.       var _loc3_ = _root.getBytesLoaded() / _root.getBytesTotal() * 100;
  105.       this.scrittamc[0].scritta.text = Math.floor(_loc3_) + "%";
  106.       this.scrittamc[0].scritta.setTextFormat(this.myformat);
  107.       this.scrittamc[0]._xscale = 110;
  108.       this.scrittamc[0]._yscale = 110;
  109.       this.scrittamc[0]._x = this.screenw / 2 - this.scrittamc[0]._width / 2;
  110.       this.scrittamc[0]._y = 230;
  111.       this.scrittamc[0]._visible = true;
  112.       this.scrittamc[0]._alpha = this.scrittealpha;
  113.       this.scrittamc[1]._alpha = this.scrittealpha;
  114.       this.tsm._alpha = this.scrittealpha;
  115.       this.scrittamc[1].scritta.text = "LOADING";
  116.       this.i = 0;
  117.       while(this.i < this.numdots)
  118.       {
  119.          this.scrittamc[1].scritta.text += ".";
  120.          this.i = this.i + 1;
  121.       }
  122.       this.scrittamc[1].scritta.setTextFormat(this.myformat);
  123.       this.scrittamc[1]._y = 190;
  124.       this.scrittamc[1]._visible = true;
  125.       if(_loc3_ > this.dotmult * 3)
  126.       {
  127.          this.dotmult += 1;
  128.          this.numdots += 1;
  129.          if(this.numdots > 3)
  130.          {
  131.             this.numdots = 0;
  132.          }
  133.       }
  134.       if(_loc3_ == 100)
  135.       {
  136.          this.phase = 1;
  137.       }
  138.       if(this.phase == 1)
  139.       {
  140.          this.scrittealpha -= 2;
  141.          if(this.scrittealpha < 0)
  142.          {
  143.             _root.gotoAndPlay("mainmenu");
  144.          }
  145.       }
  146.    }
  147. }
  148.