---
title: "解决AS3代码控制动画的时间误差"
author: "cuixuxucui"
date: "2010-11-01T12:12:00Z"
tags: []
categories: ["编程语言"]
slug: "as3"
draft: false
lastmod: "2011-06-10T17:09:30Z"
id: 799396
url: "https://smartblack.iteye.com/blog/799396"
---

```

```

 

一、参考[Clocklike类、Timeline类的介绍和区别，以及扩展讲解](http://www.xiaos8.com/article.asp?id=432):

[FireAS的代码](http://code.google.com/p/fireas/source/browse/trunk/FireASCode/fireas/library/time/?r=9)

二、针对enterFrame修正的方式：

framePeriod = int(1000 / stage.frameRate);

private function enterFrameHandler(event:Event):void

{

tickPosition = int((getTimer() % 1000) / framePeriod);

if (tickLastPosition != tickPosition)

{

tickLastPosition = tickPosition;

//todo

}

}

参考自[AS3块传输技术](http://www.adobe.com/cn/devnet/flex/articles/actionscript_blitting_print.html)