# Capturing second mouse click

**URL:** https://forum.kirupa.com/t/capturing-second-mouse-click/329494
**Category:** flash
**Created:** [September 5, 2012, 9:26pm UTC](https://forum.kirupa.com/t/capturing-second-mouse-click/329494 "2012-09-05T21:26:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![hunsnowboarder](https://avatars.discourse-cdn.com/v4/letter/h/7ea924/32.png) [@hunsnowboarder](https://forum.kirupa.com/u/hunsnowboarder)
#### Post date: [September 5, 2012, 9:26pm UTC](https://forum.kirupa.com/t/capturing-second-mouse-click/329494/1 "2012-09-05T21:26:05Z")

</div>

Hi there Everyone! I am new here (this is my first post) and I have just started to learn actionscript. I hope with your help I will be able to develop myself! 🙂  
I am trying to make an application where I would like to store the first and the second mouse click. Here is my code:

```auto

function onClick(e:MouseEvent):void{
            if(!firstClick && !secondClick) {
                firstClick = true;
                firstClicked =e.target as MovieClip;
                e.target.gotoAndStop(e.target.name);
                clickCheck();
                
            } else if (firstClick && !secondClick) {
                secondClick=true;
                firstClicked =e.target as MovieClip;
                e.target.gotoAndStop(e.target.name);
                clickCheck();
            } else if (firstClick && secondClick) {
                //turn the pages to their back, reset clicks
                firstClicked.gotoAndStop(numCard/2+1);
                clickCheck();
            }
            
        }
    
        function clickCheck():void{
            trace(firstClicked, secondClicked);
            //trace(secondClick);
            //trace(e.target.name);
        }

```

The problem is probably obvious to you all… within the mouseevent the e.target changes on the second click, so it will change the firstClick data as well… I am aware of the problem but I do not really know, how to overcome it, how to solve it…  
Please try to help mi if you can.  
Thank you in advance!  
I am using: AS3 + Flash CS5
