Where to insert setInterval

[COLOR=#333333][FONT=Verdana]Hi,[/FONT][/COLOR]

[COLOR=#333333][FONT=Verdana]I’m trying to have this gallery run by itself but eventhough it works, it doesn’t load the pictures in the thumbnails when the trace gives me a right variable. Besides, I get more values than expected from it.[/FONT][/COLOR]

[COLOR=#333333][FONT=Verdana]The images are on boxes attached dynamically and the onPress handler works perfectly tracing one value at a time:

[/FONT][/COLOR]
this.onPress = function():Void { temp = id; this.id = _parent.box1.id; _parent.box1.id = temp; _parent.box1.targetBox.attachMovie("image - "+temp, "image - "+temp, getNextHighestDepth()); this.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; _parent.box1.swapDepths(this);}[COLOR=#333333][FONT=Verdana]
[/FONT][/COLOR][COLOR=#333333][FONT=Verdana]but if I changge the code to:

[/FONT][/COLOR]
function swapImages():Void { id–; temp = id; trace("temp = "+temp); id = _parent.box1.id; trace("id = "+id); _parent.box1.id = temp; _parent.box1.targetBox.attachMovie("image - "+temp, "image - "+temp, getNextHighestDepth()); this.targetBox.attachMovie("image - "+id, "image - "+id, getNextHighestDepth()); _parent.box1.swapDepths(this); _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(id == 0){ clearInterval(interval_id); trace(“Interval cleared”); } } var interval_id:Number = setInterval(swapImages, 2000);[COLOR=#333333][FONT=Verdana]

[/FONT][/COLOR][COLOR=#333333][FONT=Verdana]it will work but only on the main image tracing the values of all the clips.[/FONT][/COLOR]

[COLOR=#333333][FONT=Verdana]Any ideas of how to face this? If you open up the attached fla, comment the first part of the code and uncomment the end part of it.[/FONT][/COLOR]