2 Replies Latest reply on Jul 14, 2007 3:14 PM by zdvdla3

    Want to load MC to play over buttons

    zdvdla3
      I created a MC that I want to play on top of buttons when they are rolled over .
      I add the EL and the EH to them that part works fine. I would like however to call a new instance of a MC to play over them as they are rolled over.

      var pictLdr:Loader = new Loader();
      var pictURL:String = "egg.jpg"
      var pictURLReq:URLRequest = new URLRequest(pictURL);
      pictLdr.load(pictURLReq);
      this.addChild(pictLdr);

      this works for a .jpg

      how can I modify this for a movie clip?

      I tried
      var ballLdr:DisplayObject = ball_mc;

      this.addChild(ballLdr);

      I get this error

      1120: Access of undefined property ball_mc.

      Im testing with a simple anim to get it and have not had any success.
      I have spent hours and still have no clue...
      any help would be awesome..
      thanks
        • 1. Re: Want to load MC to play over buttons
          SymTsb Level 2
          define a class for the mc under it's properties in the library....let say myMCClass

          var _myMC = new myMCClass();
          addChild( _myMC );
          • 2. Re: Want to load MC to play over buttons
            zdvdla3 Level 1

            so how would i load a specific MovieClip without using new?
            this of course creates a new instance over and over again.
            I simply want the MovieClip to play (loop)...

            I created a simple ball animation called ball_mc. set the class to ballClass in the linkage props.

            this works but keeps creating new clips over and over...

            var myClip:ballClass = new ballClass();
            addChild(myClip);
            myClip.x = 250;
            myClip.y = 250;

            I want to add ball_mc only once and have it loop.
            I can't get how to set that. I tried:

            var myClip:ballClass = ball_mc();
            addChild(myClip);
            myClip.x = 250;
            myClip.y = 250;

            I get these errors..........

            1046: Type was not found or was not a compile-time constant: ballClass.
            1180: Call to a possibly undefined method ball_mc.

            I must not have a grip on a simple concept somewhere...