home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Puzzle / Clusterz / Clusterz.swf / scripts / ENGINE / CORE / OSystem.as < prev    next >
Encoding:
Text File  |  2008-09-12  |  1.6 KB  |  57 lines

  1. package ENGINE.CORE
  2. {
  3.    import flash.display.Sprite;
  4.    import flash.events.Event;
  5.    import flash.system.System;
  6.    import flash.text.TextField;
  7.    import flash.text.TextFieldAutoSize;
  8.    import flash.utils.getTimer;
  9.    
  10.    public class OSystem extends Sprite
  11.    {
  12.       
  13.       public static var iUserText1:String = "";
  14.       
  15.       public static var iUserText:String = "";
  16.       
  17.       public static var iUserText2:String = "";
  18.        
  19.       
  20.       private var iLastTime:int;
  21.       
  22.       private var iCount:int;
  23.       
  24.       private var iText:TextField;
  25.       
  26.       private var iSTimer:String;
  27.       
  28.       public function OSystem()
  29.       {
  30.          super();
  31.          this.iText = new TextField();
  32.          this.iText.autoSize = TextFieldAutoSize.LEFT;
  33.          this.iText.mouseEnabled = false;
  34.          this.addChild(this.iText);
  35.          this.addEventListener(Event.ENTER_FRAME,OnEnterFrame);
  36.          this.iLastTime = getTimer();
  37.          this.iSTimer = "";
  38.       }
  39.       
  40.       public function OnEnterFrame(param1:Event) : void
  41.       {
  42.          var _loc2_:uint = 0;
  43.          var _loc3_:int = 0;
  44.          _loc2_ = System.totalMemory;
  45.          _loc3_ = getTimer() - this.iLastTime;
  46.          ++this.iCount;
  47.          if(_loc3_ >= 1000)
  48.          {
  49.             this.iSTimer = String(Math.round(_loc3_ / this.iCount * 100) / 100);
  50.             this.iLastTime = getTimer();
  51.             this.iCount = 0;
  52.          }
  53.          iText.text = _loc2_.toString() + " " + this.iSTimer + " " + OGlobal.prStage.frameRate + " | " + OSystem.iUserText + " " + OSystem.iUserText1 + " " + OSystem.iUserText2;
  54.       }
  55.    }
  56. }
  57.