views:

166

answers:

2

Im having problems with classpaths. I have used them before with "import" but I'm not able to link a class directly to symbol in the library.

I have a class c:/myfolder/src/myclass.as . In prefernces > AS3 settings, I have c:/myfolder/ as default classpath. I click linkage on the symbol and enter src.myclass . When I click the checkmark, it says 'class not found'. I am able to do: *import src.myclass; and attach the class to an instance on th stage. That works fine, but thats not what I need to do.

A: 

It's weird to use src as a package. Typically you'd set your preferences to c:/myfolder/src then put your top level package in there, but...

Check and make sure your file MyClass looks like this:

package src {
  public class MyClass {
     ...
  }
}

If it doesn't then you need to make sure your package matches the directories under your source directory (c:/myfolders).

Also you probably need to include the fully qualified package on the embed tag.

chubbard
This is the first I have heard that I need to do anything with the package in the embed code. I assume you mean the embed code in my flash develop project. Can you post a link or more info on that?
Armitage
A: 

I found the answer. In preferences > AS3 settings the folder "c:\myfolder\" was below ".\". Once I moved it above, it saw the definition normally.

Armitage