1 Reply Latest reply on Apr 20, 2006 6:00 PM by injpix

    Importing a Class

    MediaMisfit
      So what I'm trying to do is import a class in action script. Right now I'm using
      import actionscriptbible.drawing.DrawingUtilities;

      Any it's saything that it can't import to the variable for some reason.
      My global classes folder I'm assuming is in the /flash/en/firststart/classes directory

      My error is this.
      **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 15: The class or interface 'DrawingUtilities' could not be loaded.
      var duDrawer rawingUtilities;

      **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 20: The class or interface 'DrawingUtilities' could not be loaded.
      duDrawer = new DrawingUtilities(mMask);

      Total ActionScript Errors: 2 Reported Errors: 2

      Basically my variable are choking because the class isn't working.
      Any help would be appreciated. I'm working with Flash 8 Pro.
        • 1. Re: Importing a Class
          injpix Level 3
          You have the class located correctly, but it is the way you are calling it that is incorrect. You have;

          duDrawer = new DrawingUtilities(mMask);

          This will give you errors as you know. Try the line of code below and get rid of the “import” line and the variable declaration that you have.
          .

          duDrawer = actionscriptbible.drawing.DrawingUtilities(mMask);

          I don’t know exactly how this works yet. But if you have the class in the FLA’s subdirectories then use “import” at the top of the class.