How to Use Tween in an ActionScript Project (Flex Builder 2)

From moockbog.org: http://www.moock.org/blog/archives/000197.html

To use the Tween class in an ActionScript Project in Flex Builder 2 you must include all dependent class libraries in the application's library path. Specifically, you must include the Flex framework's framework.swc and the appropriate version of framework_rb.swc, depending on the current language.

The framework_rb.swc library is necessary because Tween references UIComponent, which references framework_rb.swc.

Here's how to gain access to the Tween class:

First, follow these steps to add framework.swc to the Library path:

1) In the Navigator, select the project's root folder. 2) Select Project > Properties.

3) Select ActionScript Build Path > Library path.

4) Select Add SWC...

5) In the Add SWC dialog, enter: ${FRAMEWORKS}/libs/framework.swc

6) Hit OK. Hit OK.

Next, follow these steps to add framework_rb.swc's for folder to the Library path:

1) In the Navigator, select the project's root folder.

2) Select Project > Properties.

3) Select ActionScript Build Path > Library path.

4) Select Add SWC Folder...

5) In the Add SWC dialog, enter: ${FRAMEWORKS}/locale/{locale}

6) Hit OK. Hit OK.

Bingo. Tween at will.

If you forget to add framework_rb.swc to your Library path, you'll see this error: "Unable to resolve a class for ResourceBundle". Which is just the compiler's way of telling you that it can't find one of the dependencies for the Tween class.

Warning: the preceding technique works, but it also yanks in approximately 100kb of dependent code.

Comments
Comments are not allowed for this entry.
BloggArt  |  Portfolio  |  Contact          BloggArt is running BlogCFC version 5.5.