# \[CS3/AS2.0\] Duplicate on Click?

**URL:** https://forum.kirupa.com/t/cs3-as2-0-duplicate-on-click/276212
**Category:** flash
**Created:** [November 24, 2008, 3:52pm UTC](https://forum.kirupa.com/t/cs3-as2-0-duplicate-on-click/276212 "2008-11-24T15:52:30Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![smallsparrow](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@smallsparrow](https://forum.kirupa.com/u/smallsparrow)
#### Post date: [November 24, 2008, 3:52pm UTC](https://forum.kirupa.com/t/cs3-as2-0-duplicate-on-click/276212/1 "2008-11-24T15:52:30Z")

</div>

Hi,

I am a newbie to ActionScript , and I am looking for some help in creating a slimple “painting” action.

What I am looking to do is:

**1.** Click a button to activate (mcButton).

**2.** Only be able to “dot” when its over a certain area(mcCanvas).

**3.** When you click on the area (mcCanvas), then it places new instances of the dots(mcDots) on the canvas where your pointer is. (new instances on every click)

**4.** Click the button (mcButton) again to deactivate.

I am first trying to create the action with out needing the area (mcCanvas)

**This is what I have so far:**

```auto
startDots = new Object();
startDots.onPress = function() {
    var d:Number = this._parent.getNextHighestDepth();
    var dup:MovieClip = mcDots.duplicateMovieClip("dup_"+d, d);
    attachMovie.dup();
    dup._x = _xmouse;
    dup._y = _ymouse;

};

mcButton.onPress = function(){
    
    Mouse.addListener(startDots);

    
}

```

Am I on the right track?

Any advice you could give would be great!  
thanks!
