如果使用TextField作为Grid单元格,在以下前提下测试,帧频降到了15帧/秒。
所以为了提高帧频,需要另外想辙。
package {
import flash.events.Event;
import flash.text.TextField;
import iAS.MyApp;
public class aaa extends MyApp
{
private var len:int;
private var now:Date;
private var tf1:TextField ;
override protected function createChildren():void
{
var tf:TextField ;
var x1:int=0,y1:int=0;
for(var i:int=0 ;i<24 ;i++)
{
x1=0;
for(var j:int=0;j<24;j++)
{
tf = new TextField();
tf.border=true;
tf.width = 60;
tf.height =30;
tf.x=x1;
tf.y=y1;
tf.text=i.toString();
addChild(tf);
x1+=60;
}
y1+=30;
}
this.addEventListener(Event.ENTER_FRAME,onEnter);
}
private function onEnter(e:Event):void
{
now = new Date();
len = this.numChildren;
for(var i:int=0;i<len;i++)
{
tf1 = this.getChildAt(i) as TextField;
tf1.text = now.seconds.toString();
}
}
}
}