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?
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.