0 Replies Latest reply on Aug 24, 2007 1:00 PM by IwannaFlashU

    My own movie clip class?


      I have made a 3-d model in Flash of an office, where one can walk around hallways, etc. The initial version was made doing everything "inside of the fla". Now I am trying to accomplish the same thing using a class structure.

      I have made a class called Room. What I want this class to do is, I send it the names of external swf files, one for the floor, ceiling, left, right and back walls and it is supposed to return the "room". This code works IF I create empty movie clips (which are then populated with the external files) that are tied to the _root.

      Now, the way my application works, each room is a hallway segment. Each hallway segment's "backwall" has the next segment loaded into it, at a quarter of the size (so you can see all the way down and it's created dynamically). Because of this I obviously can't tie my empty movie clips to the _root because the second will replace the first and so on.

      I'm obviously misunderstanding something here, but I thought that when I write:

      class Room extends MovieClip {

      that I now have at my disposal, the MovieClip object referenced by the name "Room". That "Room" IS now a MovieClip. If that's the case, when I trace this._name which returns a MovieClips instance name, it should return my Room's name given in the fla file - ie myRoom1=new Room(); should return "myRoom1" in a trace. Instead it returns undefined.

      Inside of my class, I create an empty movie clip for each part (3 walls, ceiling and floor) and I need those to be referenced to the Room that is instantiated by myRoom1=new Room();

      How do I do this????