home *** CD-ROM | disk | FTP | other *** search
/ Champak 48 / cdrom_image.iso / Games / alex_trax.swf / scripts / frame_22 / DoAction.as
Encoding:
Text File  |  2007-10-01  |  1.2 KB  |  34 lines

  1. function mapRedraw()
  2. {
  3.    _root.displayTitle = _global.lib.lvls[_root.mapId].title;
  4.    _root.displayScoreLevel = _root.scores[_root.mapId] <= 0 ? "---" : com.neodelight.std.XString.numberFormat(_root.scores[_root.mapId]);
  5.    var _loc3_ = 0;
  6.    while(_loc3_ < 6)
  7.    {
  8.       _root.map["lvl" + _loc3_].gotoAndStop(_root.mapId != _loc3_ ? (_global.game.maxLevel >= _loc3_ ? 2 : 1) : 3);
  9.       _loc3_ = _loc3_ + 1;
  10.    }
  11. }
  12. function startLevel(id)
  13. {
  14.    _global.dir = "";
  15.    _global.game.actLevel = _root.mapId = id;
  16.    _global.snd.playEvent("sndClick",1);
  17.    _global.snd.channelsById.music.stop();
  18.    _global.snd.playLoop("sndAthmo" + _global.lib.lvls[id].skin,0,undefined,"athmo");
  19.    _global.snd.fadeChannel("athmo",0.3,60);
  20.    _global.snd.playLoop("sndDrive",0,undefined,"drive");
  21.    _root.gotoAndPlay("game");
  22. }
  23. map.level0pop._visible = freshGame;
  24. freshGame = false;
  25. displayScore = com.neodelight.std.XString.numberFormat(score);
  26. mapId = com.neodelight.std.XMath.toNumber(_global.game.actLevel);
  27. if(!shared.data.maps[mapId])
  28. {
  29.    shared.data.maps[mapId] = [];
  30.    shared.data.maps[mapId][0] = shared.data.maps[mapId][1] = shared.data.maps[mapId][2] = 0;
  31. }
  32. mapRedraw();
  33. stop();
  34.