1 Reply Latest reply on May 23, 2012 3:53 AM by prodigalmaster

    How to add an object on mouse click?

    sachin_mak

      i am trying to add an object on user's mouse click...but not getting how?

       

      can anyone help me?

        • 1. Re: How to add an object on mouse click?
          prodigalmaster Level 2

          You could create the movieclip object and put it in the library with a linkage name, e.g. mcExample and then on the main _root. timeline add something like:

           

          this.onMouseDown = function(){

          mcExample = this.attachMovie("mcExample", "mcExample", 1);

          }

          This attaches the movieclip from the library onto the stage when the left mouse button is pressed. You can then manipulate the movieclip like any other using its identifier: mcExample. If you want to change the name of the attached movieclip then change the second parameter of attachMovie