4 Replies Latest reply on Aug 17, 2007 8:48 AM by C-Rock

    3.0 question...

    C-Rock Level 2
      I have a main document class. Then I have another class that represents the "tools" available for a map section. This class is in a sub folder and they both load fine. I want to know how to access methods from two different packages. My classes are all public.

      Also if the mapTools.as class file is in the same package as the moveMap.as class file. The mapTools imports the moveMap, how can I access methods between those two?


      Thanks
        • 1. Re: 3.0 question...
          Gorka Ludlow Level 1
          You create an instance of each class and then simply call the methods from the instance (just like any other OO language).


          Cheers,
          Gorka
          www.AquiGorka.com
          • 2. Re: 3.0 question...
            C-Rock Level 2
            I guess what I"m saying is I have a structure like this:

            mapTools
            |
            moveMap

            I can access the moveMap class fine from mapTools. I can't access mapTools from moveMap.

            I can work down, but not back up. moveMap needs to call a method from the mapTools class.

            What am I missing?
            • 3. Re: 3.0 question...
              SymTsb Level 2
              Just use the fully qualified directory path from the top level down. Since Flash will always look in the same library locations (relative to the main fla/swf file), using

              import com.mysite.mapTools.*;

              from inside your moveMap file will give it access to functions inside the mapTools class once you have instantiated the mapTools class. I have used this numerous times for my AS3 projects and as of yet, I haven't run into any snags.
              • 4. Re: 3.0 question...
                C-Rock Level 2
                Well here is my deal. I'm loading the tools class with a movie clip export in the library. It loads fine. The movie clip is called "mapSection". I wish to use all the buttons in the mapSection in a separte class. There are move buttons in the mapSection to move the map. If I place the listeners in the main class loaded (mapTools) then the listeners work fine. However I will have tons of these for the various tools. So I want to separate the move button listeners to a separte class called moveMap. The mapTools loads the move map but the functions don't work unless they are in the main class...




                Thanks for your help,
                Carey