home *** CD-ROM | disk | FTP | other *** search
/ Champak 132 (Alt) / Vol 132.iso / games / rong.swf / scripts / DefineSprite_307 / frame_1 / DoAction.as
Encoding:
Text File  |  2011-06-09  |  1.9 KB  |  73 lines

  1. function InitializeComponents()
  2. {
  3.    radio_5.setStyleProperty("textColor",13421772);
  4.    radio_10.setStyleProperty("textColor",13421772);
  5.    radio_15.setStyleProperty("textColor",13421772);
  6.    radio_20.setStyleProperty("textColor",13421772);
  7.    radio_speed_slow.setStyleProperty("textColor",13421772);
  8.    radio_speed_med.setStyleProperty("textColor",13421772);
  9.    radio_speed_fast.setStyleProperty("textColor",13421772);
  10.    radio_accel_slow.setStyleProperty("textColor",13421772);
  11.    radio_accel_med.setStyleProperty("textColor",13421772);
  12.    radio_accel_fast.setStyleProperty("textColor",13421772);
  13.    EnablePlayerComponents(2,true);
  14.    EnablePlayerComponents(3,true);
  15.    EnablePlayerComponents(4,false);
  16.    skill_player2.gotoAndPlay("expert");
  17.    skill_player3.gotoAndPlay("expert");
  18.    skill_player4.gotoAndPlay("expert");
  19. }
  20. function EnablePlayerComponents(ndxPlayer, enable)
  21. {
  22.    this["cbox_player" + ndxPlayer].setEnabled(enable);
  23.    if(!enable)
  24.    {
  25.       this["cbox_player" + ndxPlayer].setValue(false);
  26.    }
  27. }
  28. function GetCBoxPlayerNdx(cbox)
  29. {
  30.    if(cbox == cbox_player2)
  31.    {
  32.       return 2;
  33.    }
  34.    if(cbox == cbox_player3)
  35.    {
  36.       return 3;
  37.    }
  38.    if(cbox == cbox_player4)
  39.    {
  40.       return 4;
  41.    }
  42. }
  43. function onPlayerChecked(cbox)
  44. {
  45.    if(cbox.getValue())
  46.    {
  47.       EnablePlayerComponents(GetCBoxPlayerNdx(cbox),true);
  48.       if(cbox == cbox_player2)
  49.       {
  50.          EnablePlayerComponents(3,true);
  51.       }
  52.       else if(cbox == cbox_player3)
  53.       {
  54.          EnablePlayerComponents(4,true);
  55.       }
  56.    }
  57.    else
  58.    {
  59.       EnablePlayerComponents(GetCBoxNdx(cbox),true);
  60.       if(cbox == cbox_player2 || cbox == cbox_player3)
  61.       {
  62.          EnablePlayerComponents(4,false);
  63.       }
  64.       if(cbox == cbox_player2)
  65.       {
  66.          EnablePlayerComponents(3,false);
  67.       }
  68.    }
  69. }
  70. Mouse.show();
  71. InitializeComponents();
  72. this.stop();
  73.