Symbol 1 MovieClip Frame 1
nCharacterCount = 1;
nFrameCount = 3;
nInterval = 10;
bDirection = 1;
function fun() {
if (!bDirection) {
nIndex = nCharacterCount + 4;
if (this["c" + nIndex]._alpha < -10) {
gotoAndPlay (1);
}
} else {
nIndex = nCharacterCount + (((nCharactercount - 1) * 4) + 4);
if (this["c" + nIndex]._alpha < -10) {
gotoAndPlay (1);
}
}
i = 1;
while (nCharacterCount >= i) {
if (nIsRun[i - 1] < 0) {
CentralizeGhost(i);
}
nIsRun[i - 1]--;
i++;
}
}
function CentralizeGhost(i) {
n = 1;
while (4 >= n) {
nIndex = nCharacterCount + (((i - 1) * 4) + n);
this["c" + nIndex]._visible = true;
rotation = 45;
if (n == 1) {
rotation = 306;
} else if (n == 2) {
rotation = 342;
} else if (n == 3) {
rotation = 18;
} else if (n == 4) {
rotation = 54;
}
this["c" + nIndex]._x = (Math.cos((Math.PI / 180) * rotation) * nRadiusArray[nIndex]) + nCentreArrayX[i];
this["c" + nIndex]._y = (Math.sin((Math.PI / 180) * rotation) * nRadiusArray[nIndex]) + nCentreArrayY[i];
if (this["c" + i]._x < this["c" + nIndex]._x) {
this["c" + nIndex]._alpha = this["c" + nIndex]._alpha + 5;
} else {
this["c" + i]._visible = true;
this["c" + nIndex]._alpha = this["c" + nIndex]._alpha - 5;
}
nRadiusArray[nIndex] = nRadiusArray[nIndex] - 5;
(n++);// not popped
}
}
function again() {
gotoAndPlay (2);
}
nCentreArrayX = new Array(nCharacterCount);
nCentreArrayY = new Array(nCharacterCount);
nRadiusArray = new Array(nCharacterCount * 4);
nIsRun = new Array(nCharacterCount);
i = 1;
while (nCharacterCount >= i) {
nCentreArrayX[i] = this["c" + i]._x;
nCentreArrayY[i] = this["c" + i]._y;
n = 1;
while (4 >= n) {
nIndex = nCharacterCount + (((i - 1) * 4) + n);
this["c" + i].duplicateMovieClip("c" + nIndex, nIndex);
this["c" + nIndex]._visible = false;
this["c" + nIndex]._alpha = 0;
nRadiusArray[nIndex] = 50;
n++;
}
i++;
}
i = 1;
while (nCharacterCount >= i) {
this["c" + i]._alpha = 100;
this["c" + i]._visible = false;
if (!bDirection) {
if (i != 1) {
nIsRun[nCharacterCount - i] = nIsRun[nCharacterCount - (i - 1)];
nIsRun[nCharacterCount - i] = nIsRun[nCharacterCount - i] + nInterval;
} else {
nIsRun[nCharacterCount - 1] = 0;
}
} else if (i != 1) {
nIsRun[i - 1] = nIsRun[i - 2];
nIsRun[i - 1] = nIsRun[i - 1] + nInterval;
} else {
nIsRun[0] = 0;
}
i++;
}
fun();
Symbol 1 MovieClip Frame 2
fun();
Symbol 1 MovieClip Frame 3
again();