16 Replies Latest reply on Feb 6, 2007 10:10 AM by Peter Lorent

    A member attribute was used incorrectly

    Graham_Butcher
      I want to load an image inside a class. This is my class:

      class B
      {
      private mclListener:Object;
      private image_mcl:MovieClipLoader;

      function B() {
      createEmptyMovieClip("image_mc", getNextHighestDepth());
      mclListener = new Object();
      mclListener.onLoadInit = function(target_mc:MovieClip) {
      image_mc._width = 100;
      };
      image_mcl = new MovieClipLoader();
      image_mcl.addListener(mclListener);
      }

      public function loadit() {
      image_mcl.loadClip("pic.jpg", image_mc);
      }
      }


      This is my fla:
      var theB:B = new B();
      theB.loadit();

      I get the following errors:
      B.as: Line 3: A member attribute was used incorrectly.
      public mclListener:Object;
      B.as: Line 4: Attribute used outside class.
      public image_mcl:MovieClipLoader;

      What do these mean?
      How do I load image inside a class?