Advertisement
dcomicboy

FPS Meter

Sep 4th, 2013
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // MovieClip Prototype (Textfield Componentversion):  
  2. MovieClip.prototype.fpsmeter = function ()  
  3. {  
  4.     this.count = 0;  
  5.     this.onEnterFrame = function ()  
  6.     {  
  7.         this.count++;  
  8.     };  
  9.     show = function ()  
  10.     {  
  11.         this.display_txt.text = this.count;  
  12.         this.count = 0;  
  13.     };  
  14.     setInterval (this, "show", 1000);  
  15. };  
  16. ASSetPropFlags (MovieClip.prototype, "fpsmeter", 1);  
  17.  
  18.  
  19.  
  20. // MovieClip Prototype (Trace Version):  
  21. MovieClip.prototype.fpsmeter = function ()  
  22. {  
  23.     this.count = 0;  
  24.     this.onEnterFrame = function ()  
  25.     {  
  26.         this.count++;  
  27.     };  
  28.     show = function ()  
  29.     {  
  30.         trace(this.count);          
  31.         this.count = 0;  
  32.     };  
  33.     setInterval (this, "show", 1000);  
  34. };  
  35. ASSetPropFlags (MovieClip.prototype, "fpsmeter", 1);  
  36.  
  37. //use
  38. this.fpsmeter();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement