-
Namespaces and packages
Trying to migrate to AS 3.0 here, but are facing a tough time at kick-off:
I have a base fla file located in a folder named "game".
The "game" folder is in a folder named "northcreek" which again is in a folder named "no". For no other reason than that I read somewhere that this was smart.
Anyway, I have in my (document) class under publish settings this:
no.northcreek.game.Engine
Both my "game.fla" and my "Engine.as" reside in the "game" folder, but I fail to reference my as-class from my fla file.
What do I do wrong? It works if I simply remove all namespace names, and only type namespace, but I am trying to do it the right way here...
-
By default, the classpath includes the directory with the fla. This means that the package folders should start there. You can edit the classpath to include the directory at the top of your package structure, or you can move your fla there.
-
Senior Member
I creat an .as file and name it Main then in the fla iput the path to Main in my classpath. Then to import another as file into Main i use import ASdirectory.file0 where file0 is the name of the actionscript file without the extension and asdirectory is the directory were file0 lives
-
Sorry for being a newbie here, but when you're refering to classpath, would that be what comes after "package"? Like (on top):
package no.northcreek.game {
...
}
-
No, the classpath is a setting in Flash (or flex or whatever compiler you use) which tells the compiler where to start looking for .as files. It is represented as a ";" separated list of absolute or relative paths on the file system. By default it is something like "." which means "package diectory structure should start relative to fla location"
-
Thanks.
It says "Source Path" under Advanced Actionscript 3.0 settings, but I assume that this is the same thing?
-
Senior Member
open the .fla and click on a grey empty spot on the stage then open the properties panel and look for the place to set the class path. in order to get the class path setting in the properites panel don't have any object selected on the stage and open the properties panel (cntrl-f3)
-
...which is essentially the same as manouvring through "Publish settings" on the file menu...
-
Senior Member
i suppose it is i've never done it that way.....but as most things in flash there are multiple ways to do things.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|