Caurina Tweener Reference

링크주소 :


Using Tweener classes

So, in Tweener’s case, after installing the Tweener classes (by unzipping the download .zip file on your .FLA’s folder, or copying the files over), you would probably have a list of files as such:

Where “myWebsiteProject.fla” is your hypothetical .FLA file, considering you’re working with the Flash IDE.

The way folders are structured matter for a class. For example, on Tweener’s complete class name is caurina.transitions.Tweener; that’s why the file (and all other class files) have to be on folder /caurina/transitions.

The caurina name is meant to be something unique, neutral; from a technical standpoint, it doesn’t matter much, so it’s just part of Tweener’s package path.

If (and only if) you’re using some unusual folder for your class files – something other than the project folder, for example – you have to make sure the correct class directory is listed on the document’s classpath – the list of folders Flash will look for when it tries to add a class to the project when compiling. On the Flash IDE, you can access the document’s classpath list by using the “File” > “Publish Settings” menu, then clicking on the “Settings…” button next to the Actionscript version combo box. On the window that opens, make sure the class directory you’ve chosen is listed.

You can also change your global classpath settings on Flash preferences.

After you have a class installed, and it is acessible from your project, you can use it when writing Actionscript code. You can use classes by just referring to them, using their complete class path and name. There’s no need to refer to the specific folder where your classes are copied (other than the complete class name with classpath). For example, to call a Tweener method, you would do this:

This is a bit too long, however. Fortunatelly, Flash lets you import classes and reuse them. Like this:

On the surface, this works a bit like #include, but it’s more of a declaration that you’re gonna use the Class than anything. It doesn’t actually include the contents of the class file every time you do an import. Instead, it includes the used class files on the first frame of your movie (or whichever frame you have chosen to be the class frame).

Also, remember that, if you’re writing your code on the timeline (as opposed to in a new class), you have to repeat the import line on every new frame or MovieClip scope you intend to call Tweener.

(주)리화이트 대표 / CEO & Founder

Next ArticleStarUML (무료 UML 프로그램)