Skip navigation
sachin_mak
Currently Being Moderated

How to add an object on mouse click?

May 23, 2012 1:56 AM

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

 

can anyone help me?

 
Replies
  • Currently Being Moderated
    May 23, 2012 3:53 AM   in reply to sachin_mak

    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

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points