Reputation: 2787
Originally my classes(.as) and project (.fla) were stored in the same directory. But I would like to refactor them. I've created a subdirectory "classes", and moved my classes into this subdirectory but I've got error.
All my classes are stored in one package.
How can I "include" or "import" my classes from a subdirectory of my project?
Upvotes: 3
Views: 7754
Reputation: 623
The problem is probably the .as files in the new folders. AS3 namespaces map to your filesystem. This means a class named Bar
in the folder foo
needs to be in the foo
namespace.
Bar.as
package {
foo/Bar.as
package foo {
widget.as
package {
import foo.Bar;
Which will look like this on your filesystem:
| Bar.as
- foo
| Bar.as
| widget.as
Upvotes: 6
Reputation: 5978
Two solutions:
nameofthesubdirectory
Upvotes: 1