# Can't quite see what I'm doing

**URL:** <https://forum.kirupa.com/t/cant-quite-see-what-im-doing/331343>\
**Category:** flash\
**Created:** [July 10, 2013, 9:23pm UTC](https://forum.kirupa.com/t/cant-quite-see-what-im-doing/331343 "2013-07-10T21:23:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![capdetrons](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@capdetrons](https://forum.kirupa.com/u/capdetrons)\
**Post date:** [July 10, 2013, 9:23pm UTC](https://forum.kirupa.com/t/cant-quite-see-what-im-doing/331343/1 "2013-07-10T21:23:00Z")

</div>

```auto
hi,

I need to restore the original values of the boxes ids on the mouseDown event to resume the image swap on button press. I can't understand the traced values. Only the first time, setInterval calls the swapImages function which is what the variables should be like from a start.

I'd appreciatte an orientation as to how to approach this

```

stop();

\_parent.loading\_function(id);

var count:Number = 1;

function swapIds():Void {  
trace(“this boxes’s ID is equal to…” + id);  
count++;

```
    if(count == 5){
        id = 4;
    } else if (count == 4){
        id = 3;
    } else if(count == 3){
        id = 2;
    } else if(count == 2){
        id = 1;
    } else if(count == 1){
        id = 5;
    }
    
    _parent.box1.targetBox.attachMovie("image - "+count, "image - "+count, getNextHighestDepth());
    _parent["box"+count].targetBox.attachMovie("image - "+id, "image - "+id, getNextHighestDepth());
    
    _parent.box1.boxMask._width = _parent.box1.targetBox._width;
    _parent.box1.boxMask._height = _parent.box1.targetBox._height;
    _parent.box1.boxOutline._width = _parent.box1.targetBox._width;
    _parent.box1.boxOutline._height = _parent.box1.targetBox._height;
    
if(count == 5){
    clearInterval(interval_id);
}

var mouseListener:Object = new Object();
mouseListener.onMouseDown = function () {
    clearInterval(interval_id);
    Mouse.removeListener(mouseListener);
    delete count;
    };
    
Mouse.addListener(mouseListener);

```

}

var interval\_id:Number = setInterval(swapIds, 1000);

```auto

```
