ActionScript 3 Tween Classes

I was reading the book ActionScript 3 cookbook from O’Reilly (very good book by the way) and I wanted to get my hands dirty. I have never coded in ActionScript 3 before and where i work we still use Flash 8 because it’s what most people have. So there I was wanting to do basic stuff, regular animation using the tween classes from Flash, but at first I couldn’t find them. Searched a bit and found all sort of post saying they didn’t exist anymore, or that you had to use classes from Flex in order to use them. I finally found them after some time. So let me spare you that effort. Here are the tweening classes from flash CS3.

1
2
import fl.transitions.Tween;
import fl.transitions.easing.*;

and they still work the same way using this syntax:

1
var myTween:Tween = new Tween(myObject, "x", Elastic.easeOut, 0, 300, 3, true);

The only difference is with the “x” where it used to be “_x” because ActionScript 3 dropped the underscore before key properties.

, ,

  1. #1 by taffy - July 5th, 2011 at 01:41

    Thanks a lot, Most easy to follow and useful tutorial on AS 3 basics out there! Thanks for sharing your source codes.

(will not be published)
Subscribe to comments feed
  1. No trackbacks yet.