所以,我已经学会了如何从Flash实际发送数据,但是我如何在ActionScript中每隔3秒发送一次数据呢?
答案 0 :(得分:2)
使用每3秒重复一次的Timer
对象:
// 3000 is 3 seconds in milliseconds, 0 means the timer
// will repeat until the end of time
var myTimer:Timer = new Timer( 3000, 0 );
myTimer.addEventListener( TimerEvent.TIMER, this._onTimer );
myTimer.start();
private function _onTimer( e:TimerEvent ):void
{
// call your php function here
}
此处的课程文档:http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/utils/Timer.html