hi,
i am a newcomer to actionscript and am having difficulty getting to grips with package naming.
i dont really understand the dt notation of naming. i know each dot represents a subdirectory but arent .fla files and .as files supposed to be kept in the same folder?
any help would be appreciated.
thanks
You could have an as3 library, that has the following file/folder structure:
as3lib(folder)
-com(folder)
–senocular(folder)
—utils(folder)
----KeyObject.as
–sitoon(folder)
—loader(folder)
----BitmapLoader.as
—physics(folder)
----DynamicPoint.as
----DynamicSphere.as
----StaticPoint.as
----StaticSphere.as
This describes that there is a package from “senocular.com” and “sitoon.com”. In the “DynamicPoint” class you would have the package “com.sitoon.physics.DynamicPoint”, if you use the “as3lib” as an external library.
To use an external library in flash CS3:
File > Publish Settings > Settings(the one right to AS version) > Plus button(to add a new classpath), then choose the as3lib path (in this case)
When you then have to use the DynamicPoint class:
import com.sitoon.physics.DynamicPoint;
It’s a way to stop collisions with existing classes that may be named the same. For example, if you had two HitTest classes which used different ways to do things (maybe appropriate for different purposes) then by putting them in a “unique” folder structure you can keep them apart.
It also helps you to organise your bits and pieces by whatever structure you like - rather than having hundreds of classes in the one folder you may put some in a utilities folder, others in a display folder, and so on.