AS3 Custom Tween API v0.9.3

After numerous requests I finally found the time to update my AS3 Custom Tween API to version 0.9.3.

In case you are not familiar with the Tween API it is a simple API which enables any object on the display list to have a tween effect applied to a property of the object. You can view the the original Tween API post here.

Version 0.9.3 has had the following additions implemented:

  1. Tween Interval has been increased to 30fps as oppossed to the original 12fps. The original 12fps would run slow unless the framerate of the swf was increased.
  2. A callback function can now be passed in as an optional parameter. The callback function will be invoked once the tween effect has completed.
  3. An optional callback argument of arbitrary length can also be passed in as a parameter of the callback function.
  4. An additional Tween.stop(); method has been added which will allow a Tween instance to be stopped at anytime while the tween effect is executing.
  5. TweenTarget parameter’s type has been changed from DisplayObjectContainer to DisplayObject. Originally I had wrote the Tween API as a simple, application specific API that I thought other developers could use. I have now updated the API so that it is generic and can be applied to any object on the display list.

Download source and view ASDoc.

Keep in mind that this is an unstable beta release, that is, I have not thoroughly tested the API as of this release but it does however meet the requirements that I have been requested. Once testing is completed and all bug fixes are complete I will make one last major build before a final version 1.0 release. So if you happen to find any bugs please feel free to let me know.

{ 5 comments to read ... please submit one more! }

  1. When using your Tween API in Flex it gives me a runtime error if I choose not to define a callback for the tween.

    TypeError: Error #1006: value is not a function.
    at com.ericfeminella.effects::Tween/::onTweenTimerHandler()
    at flash.utils::Timer/flash.utils:Timer::_timerDispatch()
    at flash.utils::Timer/flash.utils:Timer::tick()

    It would be nice to be able to set the callback to null if you don’t need one. Any ideas how to fix this?

  2. I will update the Tween API to allow the callback parameter to be optional. In the interim, you can simply pass in “new Function” and you will not get an Error.

  3. Hmm. It still seems to give me an error even if I pass in “new Function.”

  4. Could you send me your code so that I can debug the error. I have applied effects using the Tween API without specifying a calback handler and haven’t run into any problems.

    Thanks,
    Eric

  5. I have up dated the compiled source which is available at: http://code.ericfeminella.com/apis/TweenAPI.zip You should not have any othernull callback reference issues.

{ 0 Pingbacks/Trackbacks }