A flash game loosely based on a scene from the season 1 episode "The Prank".
Unused Text#
some message here
Placeholder message.
Unused FPS Counter#
package com.fox
{
import flash.display.*;
import flash.events.*;
import flash.system.*;
import flash.text.*;
import flash.utils.*;
public class fpsbox extends TextField
{
protected var format:TextFormat;
protected var fpsarray:Array;
protected var targetfps:int = 0;
protected var frames:uint = 0;
public function fpsbox(... args)
{
args = null;
frames = 0;
format = new TextFormat();
fpsarray = new Array();
targetfps = 0;
args = new Timer(1000);
format.font = "Verdana";
format.color = 0;
format.size = 10;
this.autoSize = TextFieldAutoSize.LEFT;
this.defaultTextFormat = format;
this.text = "-- FPS ---- AV";
args.addEventListener(TimerEvent.TIMER, tick);
if (args[0] is Stage)
{
args[0].addEventListener(Event.ENTER_FRAME, fpsloop, false, 0, true);
targetfps = args[0].frameRate;
}
else
{
this.addEventListener(Event.ENTER_FRAME, fpsloop, false, 0, true);
}
args.start();
return;
}// end function
public function fpsloop(event:Event) : void
{
var _loc_3:* = frames + 1;
frames = _loc_3;
return;
}// end function
protected function tick(event:TimerEvent) : void
{
var _loc_2:* = 0;
fpsarray.push(frames);
if (fpsarray.length == 4)
{
_loc_2 = 1;
while (_loc_2 < fpsarray.length)
{
fpsarray[0] = fpsarray[0] + fpsarray[_loc_2];
_loc_2++;
}
fpsarray.splice(1, (fpsarray.length - 1));
fpsarray[0] = fpsarray[0] / 4;
}
this.text = frames + " FPS " + Math.round(fpsarray[0]) + " AV | RAM: " + int(System.totalMemory / 1000000 * 100) / 100 + "Mb";
frames = 0;
return;
}// end function
}
}
A piece of code for an unseen FPS counter.
References#
|
The Amazing World of Gumball series | |
|---|---|
|
Adobe Flash |
School House Rush • Blind Fooled • Dino Donkey Dash • Class Spirits • Hard Hat Hustle • Nightmare in Elmore • Battle Bowlers • Sky Streaker |
|
J2ME, Android |
|
|
See Also | |