Many of my tutorials use the tweenLite or tweenMax plug-ins for tweening effects. A common question I get asked all the time is, how to do you install tweenLite or tweenMax? Below is a quick tutorial on how to set up tweenLite or tweenMax.
1. Go to blog.greensock.com and download the tweenLite or tweenMax zip file. Unzip the file and place the ‘gs’ folder inside the same folder as your Fla file. This means Flash will be able to find the class files from the ‘gs’ folder when you publish your swf file.
You can also set up classpath which means you can place the ‘gs’ folder anywhere on your hard drive, but you need to make sure Flash has a reference to the folder. Go to Edit > Preferences > Actionscript > Actionscript 3.0 settings and then select the ‘add new path’ button and browse to the location of your class files then click ok.
2.Before tweenLite or tweenMax will work you need to import the class files. This is so that Flash knows where to look for the files. The most common import statements are show below.
(The following code will only work depending on the version of tweenLite/tweenMax you are using. If you are using version 11 then look at the 'update' section)
//Imports the tweenLite class
//Imports all the classes in the gs folder.
The tweenLite and tweenMax plug-ins come with two demo files that show exactly which statements you need to import for each property, so be sure to keep these files for reference.
The new version 11 of tweenLite uses a different import statment. The base package 'gs' has changed to 'com.greensock' to comply with the industry standard. So you will now have to write the following.
//Imports all the classes in the greensock folder.