A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [CS3] class or interface could not be loaded

  1. #1
    Funky Fly Flasher poyla's Avatar
    Join Date
    Dec 2000
    Posts
    228

    Question [CS3] class or interface could not be loaded

    Hello.
    I have a project that has been handed to me where a bunch of .as files need to load up for it to work. All do except one. The path is correct and case sensitivity has been triple checked. IT does not give me the error on the import line though, it gives it to me on the variable line. This is the code with the problem:
    var menu = new Menu();

    the Description is simply:
    The class or interface 'com.vandalEyes.Menu' could not be loaded.

    Again, this file structure is right on. Any clues?
    I am an animator, not a programmer, but I know the basics (or I thought I did)
    Thanks in advance!
    -Poyla

  2. #2
    Developing For Dunkets mneil's Avatar
    Join Date
    Mar 2007
    Location
    Lincoln City
    Posts
    2,156
    hmmm.

    com.vandalEyes.Menu is the correct path you say?

    You've set a class path to the folder containing com in the publish settings or general as2 settings?

    Inside of the class it is declared
    class com.vandalEyes.Menu{//maybe it extends something
    //code
    }?

    There is a constructor function inside the class named Menu() ?

    Try datatyping it to Menu? var menu:Menu = new Menu();

    That's about all I could think of that might throw that error.
    http://code.mneilsworld.com/
    Text Effects | Bubbles | Dynamic Resize
    4 weeks , 20 papers ... thats 2 dollars .....Caassshhh!

  3. #3
    Funky Fly Flasher poyla's Avatar
    Join Date
    Dec 2000
    Posts
    228

    Yeah

    Yeah the class path is that com folder.

    I tried adding that Menu? before the var but nothing.

    This is the entire top section of the Menu.as, if it's any help.

    class com.vandalEyes.Menu {

    private var btns:Array;
    private var current:MovieClip;
    private var lastMc:MovieClip;

    public var onOver:Function;
    public var onOut:Function;
    public var onClick:Function;

    public function Menu() {

    btns = new Array();
    current = new MovieClip();
    lastMc = new MovieClip();
    }

    so confused!
    Thanks for trying though! Maybe the above will clear things up (hopefully)
    -Poyla

  4. #4
    Developing For Dunkets mneil's Avatar
    Join Date
    Mar 2007
    Location
    Lincoln City
    Posts
    2,156
    You have imported the class before the first call to Menu right?

    import com.vandalEyes.Menu;

    Also, try deleting public before the menu function call. So change

    public function Menu()
    to
    function Menu()

    In as2, well I believe AS3 even, the constructor cannot be anything but public. I know it's not causing the error, or I hope it isn't. It shouldn't and I write classes like that but just in case....

    Also, try commenting out some of the code that used the Menu class and see if you get any other errors. Try commenting out all calls to menu and see if it's another class you're importing that is causing the error. Do any of the other classes reference the Menu class?
    http://code.mneilsworld.com/
    Text Effects | Bubbles | Dynamic Resize
    4 weeks , 20 papers ... thats 2 dollars .....Caassshhh!

  5. #5
    Funky Fly Flasher poyla's Avatar
    Join Date
    Dec 2000
    Posts
    228

    Thumbs up Figures

    I asked the design company to send me the very latest .as files they had and they were a but more recent than the ones I had so I knew it would work and they did! Thanks for the help, without this conversation I never would have thought about the .as files themselves.
    (I feel a bit silly but for this animator, a code solution is a code solution!!! Problem solved!)
    Thanks for the time!
    -Poyla

  6. #6
    Developing For Dunkets mneil's Avatar
    Join Date
    Mar 2007
    Location
    Lincoln City
    Posts
    2,156
    no problem! at first I just figured you were doing something wrong but after the first line of questioning came back as none of the above I started to think that maybe the problem was elsewhere. Anyway, glad you got it fixed!
    http://code.mneilsworld.com/
    Text Effects | Bubbles | Dynamic Resize
    4 weeks , 20 papers ... thats 2 dollars .....Caassshhh!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center