MX - ghost problems after animation

Hi

The code below creates a grid fade effect when put on a blank key frame of the main timeline and when a MC is given an identifier of ‘cube’ in the linkage section of the ‘create new symbol’ dialog box.

what i can’t work out is how to get rid of the ‘ghost’ of the animation once it has completed its effect, in fact is it at all possible to get rid of the ghost??

AS Code__________________________________________

gridy = 30;
gridx = 30;
num = 0;

for (i=0; i<6; i++) {
for(j=0; j<2; j++) {
c = attachMovie(“cube”, “cube”+num, num);
c._x = 350+(i25);
c._y = 80+(j
25);

            c.angle = i*-2 + j*1.5;
            c.onEnterFrame = alphaEffect;
            num++;
            
    }

}

function alphaEffect() {
if ( this.angle < 1.5*Math.PI ) this._alpha = Math.sin(this.angle += 0.1)*90+1;
else this.onEnterFrame=null;
}


any help on this would be much appreciated.

wilma

Hoi

here this should work nicely:cowboy:


function alphaEffect() {
	if (this.angle<1.5*Math.PI) {
		this._alpha = Math.sin(this.angle += 0.1)*90+1;
	} else {
		this.removeMovieClip();// add this
		this.onEnterFrame = null;
	}
}

:wink:

thanks very much for that, works perfec!

cheers

wilma:thumb: