Hello everyone:)I have been programming a while in Actionscript 3 now. But most of the time I haven't been doing so big projects. So I have just had 1 folder with the Fla, and Main Class and some other classes for different objects. But yesterday I found out i need some more structure when the projects getting bigger. so what I would like to to is have the main folder with fla, and a folder in that folder again with classes or somthing. But I can't figure it out. Have searched around the web and yeah tryed alot. So Now I found out I need help to solve this problem:)!Hope someon can help me out with this one, becuase it should be pretty easy, but I can figure it out right now.

I checked out the tutorial and it diddn't answer what I am struggeling with. Ill try to explain it:Let's say I have a Folder on my Dekstop called Flash. In that folder my Fla and my Main Class Document. And what I want is to have a folder in a new folder agiain called somthing like Animal. and we say that Animal.as is linked to a movieclip. But that dosent work less it is in the same folder as the Fla and Main Class Document. And why ? I watched the tutorial and everything about importing and so one. But is it reall that hard to have an class that belongs a MovieClip in another folder than the Main Document Class? Hope you understand my question now:) If not Ill try another explanation laters.

If you want to store a class named Animal inside a folder named Animal (I would change one of the names to not be the same), then you create the Animal folder, and then in your class file you define the path to it as part of the package definition...

package Animal// this Animal refers to the folder name, not the class

{

import flash.display.MovieClip;

public class Animal extends MovieClip { // this Animal is the class file name

In your Main document class you need to import that Animal class using...

Thank's Ned:)I get that part with declaring and importing. but Let's say in My animal class in the constructer function I have trace("Somthing bla bla"); but when compiling and running it's dosent work. or I don't get any errors. but I just don't get why it doesn't run that trace function or if i make a Mouse click eventlistener to that Movieclip, and the Movieclip is on the stage nothing happends.

Ive done exactly what you said, but still Im having problems, I can't understand that is so hard to manage this. hmm. Because I have allways been using Classes when Im programmering just I have had them in same folder and then it's no problem at all. Flash aint showing any errors or anything, but nothing is happening. Like I have Animal.as linked to a MovieClip and Im having a trace function in the Animal.as MovieClip. I did make a var in the Main.as and still nothing happens. this kind og confuse me. Do you have any idea why ?

I will try to make it even clearer, I have a folder called Flash. In the folder called Flash I have MainFLA.fla and MainAS.as and a folder called Classes in Classes I have my Animal.as.

Here is Animal.as code:

package Classes{

import flash.display.MovieClip;

public class Animal extends MovieClip{

public function Animal():void {

// constructor code

trace("HEI");

this.x = 200;

this.x = 200;

}

}

}

Here is the MainAS.as code:

package {

import Classes.Animal;

import flash.display.MovieClip;

public class MainAs extends MovieClip {

public var animal1:Animal = new Animal();

public function MainAs() {

// constructor code

addChild(animal1);

}

}

}

Yes I addChild(animal1); and that works, but the x and y will not work. it's like the Animal class in the Classes folder don't respond. If i make everything in same folder everything works. Im just confused how to handle when it's not in the same folder. Maybe It's is somthing missing ? btw thank's alot for the help so far