1
votes

Im currently getting the following error:

"ReferenceError: Error #1065: Variable TweenLite is not defined."

I might think its because tweenlite isnt imported correctly, so some path issue - but tried a few things, and still the same.

Basically I have my main.fla, where I import a class:

path: main.fla / classes / com / myfolder / contact / ContactForm.as

AS: import classes.com.myfolder.contact.ContactForm;

In this package I try and import the tweenlite librabry with the following:

package classes.com.myfolder.contact
{
import com.greensock.TweenLite;
import com.greensock.easing.Quad;
....
}

path to tweenlite: main.fla / classes / com / greensock

Any ideas ?

2
Could you show us the code where you try to use TweenLite? - Kodiak

2 Answers

2
votes

You have two options.

  1. Set your class path to the include the 'classes' directory.
  2. Get rid of the classes directory and have the 'com' directory at the same level as main.fla.

I would go with #2 as it's convention to name packages after URLs, plus if someone else uses your code (or you switch computers) you won't have to set the class path all over again.

Your new layout would look like this:

main.fla
com
  greensock
  myfolder
    contact
0
votes

you doing it wrong! :)

if in your main src directory is classes/Class.as.

then it's package name will be: package classes.

for classes/content/Main.as.

you will be having: package classes.content

since TweenLite has a root package com, the root directory of the packages needs to be com in your main src directory:

src |- classes |- com

The compiler imports the clases from the main src directory, and the class package needs to be the same as the directory it is in.

if you will not prefer to work like this then you will be needing to change all packages names inside the Tweenlite from package com.greensock to classes.com.greensock. which i think is crazy.... :)

you really need to refigure your project structure.