home *** CD-ROM | disk | FTP | other *** search
/ 3D Games (Spidla) / 3dhry2.iso / InterBingo 1.0 / InterBingoSetup.exe / BingoInstaller.swf / scripts / frame_1 / DoAction_2.as next >
Encoding:
Text File  |  2002-07-25  |  6.7 KB  |  295 lines

  1. function LoadComponents()
  2. {
  3.    ComponentList[0] = RESOURCEFILE + "^10";
  4.    var CompInfo;
  5.    trace("LOADING COMPONENTS");
  6.    i = 0;
  7.    while(i < TOTAL_COMP)
  8.    {
  9.       LoadStatus[i] = false;
  10.       CompInfo = ComponentList[i].split("^");
  11.       LoadComponent(CompInfo[0] + ".swf",CompInfo[1]);
  12.       i++;
  13.    }
  14. }
  15. function LoadComponent(c, lev)
  16. {
  17.    trace("Load Component:" + c);
  18.    eval("Loader_" + LoaderIndex).GetMovie(c,lev);
  19.    LoaderIndex++;
  20. }
  21. function LoadDone(wname)
  22. {
  23.    trace("Done:" + wname);
  24.    var ind = wname.split("_");
  25.    ind = ind[1];
  26.    removeMovieClip("Loader_" + ind);
  27.    LoadStatus[ind] = true;
  28.    var AllDone = true;
  29.    i = 0;
  30.    while(i < TOTAL_COMP)
  31.    {
  32.       if(LoadStatus[i] == false)
  33.       {
  34.          AllDone = false;
  35.          i = TOTAL_COMP + 1;
  36.       }
  37.       i++;
  38.    }
  39.    if(AllDone)
  40.    {
  41.       ComponentsLoaded();
  42.    }
  43. }
  44. function ComponentsLoaded()
  45. {
  46.    trace("ALL MOVIES LOADED!");
  47.    Initialize();
  48. }
  49. function Initialize()
  50. {
  51.    KeyBlock.SetScreenWatch(0);
  52.    Splash = eval(ResLevel + ".SplashMovie");
  53.    Splash.play();
  54. }
  55. function SplashScreenComplete()
  56. {
  57.    Splash.gotoAndStop();
  58.    Splash._visible = false;
  59.    fscommand("event","intro finished");
  60.    eval(ResLevel).gotoAndStop("BLANK");
  61. }
  62. function SetUpAgreement()
  63. {
  64.    KeyBlock.SetScreenWatch(1);
  65.    fscommand("newscreen","license agreement");
  66.    eval(ResLevel).gotoAndStop("AGREEMENT");
  67.    eval(ResLevel + ".Accept").Label = "Accept";
  68.    eval(ResLevel + ".Decline").Label = "Decline";
  69.    eval(ResLevel + ".Decline").gotoAndStop("ACTIVE");
  70.    ScrollBox = eval(_root.ResLevel + ".Agreement");
  71.    ScrollBox.Text = LICENSEAGREEMENT;
  72. }
  73. function ActivateAccept()
  74. {
  75.    eval(ResLevel + ".Accept").gotoAndStop("ACTIVE");
  76. }
  77. function SetButtonState()
  78. {
  79.    if(ButtonState == 0)
  80.    {
  81.       ButtonState = "DISABLED";
  82.       if(int(KeyBlock.ScreenWatch) == 4)
  83.       {
  84.          ButtonState = "SDISABLED";
  85.       }
  86.    }
  87.    if(ButtonState == 1)
  88.    {
  89.       ButtonState = "ACTIVE";
  90.       if(int(KeyBlock.ScreenWatch) == 4)
  91.       {
  92.          ButtonState = "SACTIVE";
  93.       }
  94.    }
  95.    eval(ResLevel + "." + TargetButton).gotoAndStop(ButtonState);
  96. }
  97. function SetUpInstallPath(skip)
  98. {
  99.    KeyBlock.SetScreenWatch(3);
  100.    if(!skip)
  101.    {
  102.       fscommand("newscreen","install path");
  103.    }
  104.    eval(ResLevel).gotoAndStop("BLANK");
  105.    eval(ResLevel).gotoAndStop("INSTALLPATH");
  106.    eval(ResLevel + ".Change").Label = "Browse";
  107.    eval(ResLevel + ".Change").gotoAndStop("ACTIVE");
  108.    eval(ResLevel + ".Install").Label = "Install";
  109.    eval(ResLevel + ".Install").gotoAndStop("ACTIVE");
  110. }
  111. function SetUpRegister()
  112. {
  113.    KeyBlock.SetScreenWatch(4);
  114.    eval(ResLevel).gotoAndStop("REGISTRATION");
  115.    fscommand("newscreen","registration");
  116.    eval(ResLevel + ".Tutorial").gotoAndStop("SACTIVE");
  117.    eval(ResLevel + ".Tutorial").Label = "Online Bingo Tutorial";
  118.    eval(ResLevel + ".Register").gotoAndStop("SDISABLED");
  119.    eval(ResLevel + ".Register").Label = "Register \'PLAY FOR REAL\'";
  120.    if(int(REGDONE) == 0)
  121.    {
  122.       ButtonActivator.DelayActivateButton(eval(ResLevel + ".Register"));
  123.    }
  124.    ProgressBar.TrackProgress();
  125. }
  126. function SetUpAccount()
  127. {
  128.    fscommand("newscreen","account info");
  129.    eval(ResLevel).gotoAndStop("ACCOUNTINFO");
  130. }
  131. function SetUpFinish()
  132. {
  133.    KeyBlock.SetScreenWatch(5);
  134.    ProgressBar.StopTracking();
  135.    fscommand("newscreen","finish");
  136.    eval(ResLevel).gotoAndStop("FINISHED");
  137.    eval(ResLevel + ".Launch").Label = "Play Now";
  138.    eval(ResLevel + ".Launch").gotoAndStop("ACTIVE");
  139. }
  140. function ButtonHit(btn)
  141. {
  142.    trace(btn._name + " pressed");
  143.    if(btn._name eq "Decline")
  144.    {
  145.       fscommand("button","decline");
  146.    }
  147.    if(btn._name eq "Accept")
  148.    {
  149.       fscommand("button","accept");
  150.    }
  151.    if(btn._name eq "Change")
  152.    {
  153.       fscommand("button","changepath");
  154.    }
  155.    if(btn._name eq "Install")
  156.    {
  157.       fscommand("button","install");
  158.    }
  159.    if(btn._name eq "Register")
  160.    {
  161.       fscommand("button","register");
  162.    }
  163.    if(btn._name eq "Launch")
  164.    {
  165.       fscommand("button","launch");
  166.    }
  167.    if(btn._name eq "Tutorial")
  168.    {
  169.       getURL(HelpPath,"");
  170.    }
  171. }
  172. function UncheckComponents()
  173. {
  174.    trace("Unchecking Components");
  175.    i = 0;
  176.    while(i < 3)
  177.    {
  178.       eval(ResLevel + ".Component_" + i).Checked = false;
  179.       eval(ResLevel + ".Component_" + i).Check.gotoAndStop(3);
  180.       eval(ResLevel + ".Component_" + i).State = "0";
  181.       SelectedComponents[0] = 0;
  182.       i++;
  183.    }
  184. }
  185. function ComponentHit(cmp)
  186. {
  187.    trace(cmp._name + " Hit:" + cmp.State);
  188.    compnum = cmp._name.split("_");
  189.    SelectedComponents[compnum[1]] = cmp.State;
  190.    if(int(compnum[1]) == 3)
  191.    {
  192.       if(int(cmp.State) == 1)
  193.       {
  194.          UncheckComponents();
  195.       }
  196.       else
  197.       {
  198.          SetUpPackage();
  199.       }
  200.    }
  201.    else if(int(SelectedComponents[3]) == 1)
  202.    {
  203.       UncheckComponents();
  204.    }
  205.    foundone = false;
  206.    i = 0;
  207.    while(i < SelectedComponents.length)
  208.    {
  209.       if(int(SelectedComponents[i]) == 1)
  210.       {
  211.          foundone = true;
  212.       }
  213.       i++;
  214.    }
  215.    if(foundone)
  216.    {
  217.       eval(ResLevel + ".Select").gotoAndStop("ACTIVE");
  218.    }
  219.    else
  220.    {
  221.       eval(ResLevel + ".Select").gotoAndStop("DISABLED");
  222.    }
  223. }
  224. function ConfirmQuit()
  225. {
  226.    MsgBox = eval(ResLevel + ".MsgBox");
  227.    MsgBox.gotoAndStop("CONFIRM");
  228.    MsgBox.Text = "This will exit the installation. Do you want to continue?";
  229.    ConfirmFor = "Quit";
  230.    MsgBox._x = 0 + MsgBox._width / 1.3;
  231.    MsgBox._y = 0 + MsgBox._height;
  232. }
  233. function Confirm(conf)
  234. {
  235.    eval(ResLevel + ".MsgBox")._x = -500;
  236.    if(int(ErrorAction) == 0)
  237.    {
  238.       if(!conf)
  239.       {
  240.          trace("Quit");
  241.          fscommand("button","quit");
  242.       }
  243.       else
  244.       {
  245.          trace("Continue");
  246.          fscommand("button","continue");
  247.       }
  248.    }
  249.    else if(int(ErrorAction) == 1)
  250.    {
  251.       if(conf)
  252.       {
  253.          trace("Quit");
  254.          fscommand("button","quit");
  255.       }
  256.       else
  257.       {
  258.          trace("Continue");
  259.          fscommand("button","continue");
  260.       }
  261.    }
  262. }
  263. function AlertOK()
  264. {
  265.    eval(ResLevel + ".MsgBox")._x = -500;
  266.    if(int(ErrorAction) == 1)
  267.    {
  268.       fscommand("button","quit");
  269.    }
  270.    if(int(ErrorAction) == 2)
  271.    {
  272.       fscommand("button","OK");
  273.    }
  274. }
  275. function SetUpInstallScreen()
  276. {
  277.    eval(ResLevel).gotoAndStop("INSTALLING");
  278. }
  279. var SelectedComponents = new Array();
  280. SelectedComponents[0] = 0;
  281. SelectedComponents[1] = 0;
  282. SelectedComponents[2] = 0;
  283. SelectedComponents[3] = 0;
  284. var LoaderIndex = 0;
  285. var LoadStatus = new Array();
  286. var ComponentList = new Array();
  287. var ResLevel = "_level10";
  288. TOTAL_COMP = 1;
  289. i = 0;
  290. while(i < TOTAL_COMP)
  291. {
  292.    duplicateMovieClip(WatcherOrigin,"Loader_" + i,16384 + (i + 1));
  293.    i++;
  294. }
  295.