5 Replies Latest reply on Oct 10, 2006 4:01 PM by VisionaryStudios

    Problems with custom classes

      I have downloaded some custom classes by Lee Brimelow (gotoAndLearn.com) and added a classpath per Lee's tutorial on custom clases.

      I have replicated the code in this tutorial but it will not compile.

      I use the following:

      import com.leebrimelow.utils.*;

      var s:Scale = new Scale(face, 1) ;
      The error occurs on this line. And the error is that the class could not be loaded.

      The same occurs following the tutorial on the DragSlideFade tutorial which requires downloading custom classes by Brendan Dawes. See:
      You'll find dragslidefade there.

      The download from Brendan Dawes includes HTML. FLA, and SWF files for the classes. Executing the SWF (that is downloaded) works properly; however, compiling the FLA file that is included produces the same compile error. I noticed that the Publish Settings call for Flash 7 and I'm using Flash 8.

      Is it possible that Flash 8 treats Classes and Imports differently than Flash 7 and that the code needs to change?
        • 1. Re: Problems with custom classes
          im not sure if this will help but I am creating a game with custom classes which are .as files and all I did was put #include "CustomeClass.as" in the fla timeline
          • 2. Re: Problems with custom classes

            I am not looking at Lee's tutorial but from your description it sounds like it was not clear where you need to put your files.

            The class you are trying to use #import on needs to reside in a folder named utils which is in a folder named leebrimelow which is inside a folder named com. Each word between the periods is a new folder. This to my understanding is a standard that was established somewhere along the way for organizational purposes.

            If you want to have the class at a different level you would just change the import syntax accordingly.

            If it is relative to your fla file you would just say [ import Scale.as ]

            The ending asterisk ' * ' is telling flash to import all class files within the utils folder.

            Let me know if that helps or not.
            • 3. Problems with custom classes
              gravideo Level 1
              The fales were placed exactly as you describe. Result: Compile Error

              Your method does not work for me. The error I got said that import could not be used as a directive (i.e., #iinclude) so then tried it with import "Scale.as" and still got the compile error. In that case the Scale.as file was placed in the same folder as the FLA file.

              • 4. Re: Problems with custom classes
                gravideo Level 1
                I haven't a clue as to how things got messed up but the solution was to reinstall Flash.
                • 5. Re: Problems with custom classes
                  VisionaryStudios Level 1
                  LOL! That would have been my next guess ;)