Send data from Flash to php every 3 second [closed]
So, I have learned how to actually send data from Flash, but how do I in ActionScript send data every 3 second?
Use a Timer
object that repeats every 3 seconds:
// 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
}
Class doc here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/utils/Timer.html
精彩评论