# Close, but not quite

**URL:** https://forum.kirupa.com/t/close-but-not-quite/249528
**Category:** flash
**Created:** [January 19, 2008, 7:09pm UTC](https://forum.kirupa.com/t/close-but-not-quite/249528 "2008-01-19T19:09:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tazboy](https://avatars.discourse-cdn.com/v4/letter/t/3d9bf3/32.png) [@tazboy](https://forum.kirupa.com/u/tazboy)
#### Post date: [January 19, 2008, 7:09pm UTC](https://forum.kirupa.com/t/close-but-not-quite/249528/1 "2008-01-19T19:09:26Z")

</div>

I’m trying to unload a movieclip when it’s pressed and load another one in its place. For some reason the loaded movieclip is always being loaded at row 7 column 10. Why is that?

```auto
var columns:Number = 10;
var rows:Number = 7;

for (i=0; i<rows; i++) {
    for (j=0; j<columns; j++) {
        var seat:MovieClip = this.attachMovie("seat_mc", "seat"+i+"_"+j+"_mc", this.getNextHighestDepth());
        seat._x = 0+j*60;
        seat._y = 200+i*60;
        seat.onRelease = function() {
            trace(i+" "+j); **// traces 7 10 ???? It doesn't matter what button I press.**
            unloadMovie(this);
            var emptySeat:MovieClip = this._parent.attachMovie("seatFilled_mc", "seatFilled"+i+"_"+j+"_mc", this._parent.getNextHighestDepth());
            emptySeat._x = 0+j*60;
            emptySeat._y = 200+i*60;
        }
    }
}

```

Thanks for any ideas.
