home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Classicos / smashout.swf / scripts / frame_1 / DoAction.as
Encoding:
Text File  |  2005-11-09  |  1.9 KB  |  90 lines

  1. function onEnterFrame()
  2. {
  3.    if(_currentframe > 1 && getBytesLoaded() == getBytesTotal())
  4.    {
  5.       initSplash();
  6.       delete onEnterFrame;
  7.    }
  8.    else
  9.    {
  10.       var _loc1_ = Math.floor(getBytesLoaded() / getBytesTotal() * 100);
  11.       splash_mc.progress_mc.percent_txt.text = _loc1_;
  12.    }
  13. }
  14. function initSplash()
  15. {
  16.    gotoAndStop("splash");
  17.    splash_mc.gotoAndStop(2);
  18.    var controller = this;
  19.    splash_mc.start_mc.start_btn.onRelease = function()
  20.    {
  21.       controller.choosePlayer();
  22.    };
  23.    splash_mc.start_mc.help_btn.onRelease = function()
  24.    {
  25.       controller.helpSplash();
  26.    };
  27.    startLevel = 0;
  28.    if(canChooseLevel)
  29.    {
  30.       levelChooser._visible = true;
  31.    }
  32.    else
  33.    {
  34.       levelChooser._visible = false;
  35.    }
  36. }
  37. function choosePlayer()
  38. {
  39.    gotoAndStop("choosePlayer");
  40. }
  41. function startGame()
  42. {
  43.    if(canChooseLevel)
  44.    {
  45.       initSplash();
  46.    }
  47.    else
  48.    {
  49.       choosePlayer();
  50.    }
  51. }
  52. function helpSplash()
  53. {
  54.    dialog = attachMovie("DialogHelp","dialog",16000);
  55.    dialog.addEventListener("closeModal",this);
  56.    dialog.backgroundAlpha = 100;
  57. }
  58. function closeModal(eventObj)
  59. {
  60.    var _loc1_ = eventObj.name;
  61.    if(_loc1_ == "help")
  62.    {
  63.       startGame();
  64.       return undefined;
  65.    }
  66. }
  67. Stage.align = "TL";
  68. Stage.scaleMode = "noscale";
  69. if(!__inited)
  70. {
  71.    var canChooseLevel = _level0.chooseLevel != null && (_level0.chooseLevel > 0 || _level0.chooseLevel.toLowerCase() == "true");
  72.    var startLevel = 0;
  73.    fsd = _level0.fsd == null ? "fsd.swf" : _level0.fsd;
  74.    fsdWidth = 400;
  75.    fsdHeight = 250;
  76.    _level0.eventID = "dc_kpso_9232";
  77.    _level0.subject = "Kim Possible - Super Villain Smash Out";
  78.    _level0.fsdPlayAgain = function()
  79.    {
  80.       fsdContainer.removeMovieClip();
  81.       startGame();
  82.    };
  83.    var cache = new LoadVars();
  84.    cache.onData = cache.onLoad = function()
  85.    {
  86.       delete cache;
  87.    };
  88.    cache.load(fsd);
  89. }
  90.