Hi, I have created a scripted animation that works by having two identical movie clips animating (from left to right), one on top of the other. The clip is made up of 4 images connected lenghtways, The top movie is underneath a mask and moves at a slightly different rate creating a cool masking effect like:
http://www.actionscripts.org/tutoria...um/index.shtml

Right, the problem is that my client wants a pause in between each transition, i tried this using setInterval but the problem is this, the first loop through works fine, all intervals are used and everything looks good... BUT... on the next loop through the intervals are ignored.

This is the code on the two clips:

(clip1 - top masked clip)
code:

// ON the movieclip
onClipEvent (load) {
//SET INITIAL TARGET
_root.xposi = -442;
}
onClipEvent (enterFrame) {
// FUNCTIONS TO RESET PAUSE VALUES - CALLED BY SETINTERVAL
function pause1() {
_global.pause1 = false;
}
function pause2() {
_global.pause2 = false;
}
function pause3() {
_global.pause3 = false;
}
_global.checker = this._x;

//HAS CLIP MOVED TO POSITION AND IS OTHER CLIP IN POSITION
if (Math.ceil(_global.checker) == -441 && (_global.ready1 == true)) {
//RESET READY TO FALSE
_global.ready1 = false;
var id1;
//SETINTERVAL TO PAUSE CLIP - SETINTERVAL RETURNS PAUSE AS FALSE AFTER INTERVAL
id1 = setInterval(pause1, 3000);
if (_global.pause1 == false) {
_root.xposi = -884;
clearInterval(id1);
}
}
//HAS CLIP MOVED TO POSITION AND IS OTHER CLIP IN POSITION
if (Math.ceil(_global.checker) == -883 && (_global.ready2 == true)) {
//RESET READY TO FALSE
_global.ready2 = false;
var id2;
//SETINTERVAL TO PAUSE CLIP - SETINTERVAL RETURNS PAUSE AS FALSE AFTER INTERVAL
id2 = setInterval(pause2, 3000);
if (_global.pause2 == false) {
_root.xposi = -1326;
clearInterval(id2);
}
}
//HAS CLIP MOVED TO POSITION AND IS OTHER CLIP IN POSITION
if (Math.ceil(_global.checker) == -1325) {
var id3;
//SETINTERVAL TO PAUSE CLIP - SETINTERVAL RETURNS PAUSE AS FALSE AFTER INTERVAL
id3 = setInterval(pause3, 3000);
if (_global.pause3 == false) {
_root.gotoAndPlay(2);
clearInterval(id3);
}
}
//MOVE THE CLIP TO TARGET
this._x += (_root.xposi-this._x)/5;
}




(clip2 - bottom clip)
code:

// ON the movieclip
onClipEvent (load) {
_root.xposn = -442;
}
onClipEvent (enterFrame) {
//WHERE IS THE CLIP?
_global.checka = this._x;

//ARE WE AT THE TARGET YET?
if (Math.ceil(_global.checka) == -441) {

//WE ARE AT TARGET
_global.ready1 = true;

//HAS PAUSE FINISHED
if (_global.pause1 == false) {
//SET NEW TARGET
_root.xposn = -884;
//RESET PAUSE
_global.pause1 = true;
}
}
if (Math.ceil(_global.checka) == -883) {
_global.ready2 = true;
if (_global.pause2 == false) {
_root.xposn = -1326;
_global.pause2 = true;
}
}
if (Math.ceil(_global.checka) == -1325) {
if (_global.pause3 == false) {
_root.gotoAndPlay(2);
_global.pause3 = true;
}
}
//AND MOVE
this._x += (_root.xposn-this._x)/6;
}




frame 2 includes :

code:

_global.checka = 0;
_global.checker = 0;
_root.xposi = 0;
_root.xposn = 0;
_global.ready1 = false;
_global.ready2 = false;
_global.ready3 = false;



I really cannot work this out, please help.

Thanks.