This content has been marked as final. Show 3 replies
Because there is no need. you don't need to reference the drive letter.
Here's the basic jist of what they are saying....
Single Class File...
If you create your own custom class and want to use it in your flash file, save it into the same directory as the fla file and call the classes constructor. By default flash will look inside the folder where the fla resides in for the class files if it cannot find it inside the default directory.
Multiple Class Files - 1 Project (often referred to as packages)
Use your qualified domain name but backwards.....
my domain is www.sd-dezign.com so if I was going to include a package of utility class files in my document I would do the following
Create a folder in the same folder with my fla name it com and inside that a folder called sddezign and inside that utils and all my as files would be in there...the folder structure might look like this....
To call the constructor for each class, I have two options. The first which is by far the easiest looks like this
In whatever frame you need to call that class constructor
var myBox:Box = new Box();
The second method requires more typing and can get tedious
var myBox = new com.sddezign.utils.Box();
Hope this helps you a bit better.
But what is this com directory. Is that a actual directory or is people just using that for an example. Do i have to put my classes inside this com directory and then put it in any sub directory within the com directory? What if I wanted to save my class file in C:/mydocuments/myfiles/myfla/script.as . would it be mydocuments.myfiles.myfla.script.as ???
com is an actual directory. the use of com/yourwebsitename is a convention to prevent name collisions in case you download someone else's class files and they happen to create a class with the same name as one of your classes or one of your other downloaded classes. because your websitename.com is unique com/websitename should be unique to everyone.
so, you don't have to follow convention. you could put your class file anywhere on your computer or network and, as long as the path is specified, flash will find it.