Actionscript Classpath Problem

Out of context: Reply #3

  • Started
  • Last post
  • 29 Responses
  • juskin0

    also, your using packages, since you have no package name, everything is at that root level, so I dont think the classes prefix is necessary, especially since your explicitly importing everthing in the classes folder. your classpaths are importing everything for you automatically, and since your last classpath is already importing gs, either get rid of that, or you should import each class individually. I would get rid of the last classpath and also get rid of classes.gs.*; and just use :

    import gs.*;

    here is a the explanation which is more important than just fixing the problem.....
    with classpaths when you navigate to a directory on your drive, that is your root level of where you begin your import statements.
    so, your classes directory, if you had a single class called greenButton IN your classes directory, the way you would import that would simply be:
    import greenButton;

    if you had the gs folder IN your classes directory the way you import that would be:

    import gs.nameOfClass;

    and of course to import ALL of the classes you would use:
    import gs.*;

    now lets say there is a folder INSIDE of your gs folder, the way to import that would be:

    import gs.nameOfFolder.nameOfClass;

    or to import all of the classes in the subfolder:
    import gs.nameOfFolder.*;

    hope this helps...

    • That completely helps. I never found this explanation elsewhere. Still getting errors though.CyBrain

View thread