setInterval()每隔固定的时间调用某个函数

用法 1:下面的示例每隔 1000 毫秒(1 秒)调用一个匿名函数。 

1
setInterval( function(){ trace("interval called"); }, 1000 );

使用此函数时,需要注意在 SWF 文件中使用的内存。例如,从 SWF 文件中删除影片剪辑时,不会删除在其中运行的任何 setInterval() 函数。 使用完 setInterval() 函数后,请始终使用 clearInterval() 函数将其删除

 






posted @ 2013-01-03 14:41  thero  阅读(263)  评论(0编辑  收藏  举报