home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / penguin-copter.swf / scripts / DefineSprite_24_main / frame_1 / DoAction.as
Encoding:
Text File  |  2005-09-29  |  1.4 KB  |  63 lines

  1. function loaded(lv)
  2. {
  3.    playBtn.setEnabled(true);
  4.    var j = Number(lv.nc);
  5.    tpd = lv.tpd;
  6.    var i = 1;
  7.    while(i <= j)
  8.    {
  9.       var hsc = this.attachMovie("textbox","n" + i,++dep);
  10.       hsc._x = -10;
  11.       hsc._y = -90 + i * 14;
  12.       hsc.text = lv["n" + i];
  13.       var hsc = this.attachMovie("textbox","l" + i,++dep);
  14.       hsc._x = 135;
  15.       hsc._y = -90 + i * 14;
  16.       hsc.text = Math.floor(1000 * Number(lv["l" + i]) / 120) / 1000;
  17.       i++;
  18.    }
  19. }
  20. playBtn.graphics.attachMovie("playGraphic","g",++playBtn.graphics.dep);
  21. playBtn.setEnabled(false);
  22. vsBtn.x = vsBtn.graphics.attachMovie("x","x",++vsBtn.graphics.dep);
  23. vsBtn.x._visible = false;
  24. vsBtn.clicked = function()
  25. {
  26.    this.checked = !this.checked;
  27.    this.x._visible = this.checked;
  28.    _root.vsBtnChecked = this.checked;
  29. };
  30. playBtn.clicked = function()
  31. {
  32.    if(vsBtn.checked)
  33.    {
  34.       if(tpd.length > 0)
  35.       {
  36.          _parent.ghosting = true;
  37.          _parent.gdbp = tpd;
  38.       }
  39.    }
  40.    else
  41.    {
  42.       _parent.ghosting = false;
  43.    }
  44.    _parent.startGame();
  45.    _parent.main.removeMovieClip();
  46. };
  47. if(_root.vsBtnChecked == undefined)
  48. {
  49.    _root.vsBtnChecked = true;
  50. }
  51. if(_root.vsBtnChecked)
  52. {
  53.    vsBtn.click();
  54. }
  55. vv = new LoadVars();
  56. vv.c = "t";
  57. pv = new LoadVars();
  58. pv.onLoad = function()
  59. {
  60.    loaded(this);
  61. };
  62. vv.sendAndLoad("http://" + _root.dm + "/copter/copter.php",pv);
  63.