I am have problems with the removeMovieClip() function;
I have tried several methods to get the function to work. see below
newThis.removeMovieClip();
newThis.unloadMovie();
unloadMovie(newThis);
newThis.unloadMovie;
removeMovieClip(newThis._parent["bullet_mc"+nStoredLocation]);
none of them seemed even remotely effective.
I created the movieclip dynamically so the removeMovieClip function should work.
Below is the code for my Movie Clip
[COLOR=darkolivegreen]//seperates this movieclip from the parent from which it is duplicated from (now bRequestRotation)[/COLOR]
[COLOR=darkolivegreen]//var bBulletActive:Boolean = new Boolean(false);[/COLOR]
[COLOR=darkolivegreen]//dynamically changes the bullet velocity.(not in use)[/COLOR]
[COLOR=darkolivegreen]//var nBulletVelocity:Number = new Number(5);[/COLOR]
[COLOR=darkolivegreen]//a number that is set by the parent mc.[/COLOR]
var nBulletAngle:Number;
[COLOR=darkolivegreen]//starting value for the timer[/COLOR]
var nTimer:Number = new Number(0);
[COLOR=darkolivegreen]//timer function based on 12fps about a sec.[/COLOR]
var nTimerMax:Number = new Number(15);
var newThis = this;
[COLOR=darkolivegreen]//stores the movieclips number which is also the clip's depth[/COLOR]
var nStoredLocation;
[COLOR=darkolivegreen]//boolean which is activated by a parent movieclip[/COLOR]
var bRequestRotation;
function fRequestRotation()
{
[COLOR=darkolivegreen]//trace("fRequestRotation Running")[/COLOR]
[COLOR=darkolivegreen]//trace("Bullet: "+ newThis);[/COLOR]
if(bRequestRotation == true)
{
[COLOR=darkolivegreen] //mathematical function run for the duration(AKA, the bullets movement)[/COLOR]
if(nTimer<nTimerMax)
{ [COLOR=darkolivegreen]//converts degrees to radians which is handled by flash[/COLOR]
nBulletRadian =(nBulletAngle/180)*Math.PI;
[COLOR=darkolivegreen]//calculates the speed[/COLOR]
dy=(15*Math.sin(nBulletRadian));
dx=(15*Math.cos(nBulletRadian));
[COLOR=darkolivegreen]//pointer to this clip; moves it horizontally and vertically[/COLOR]
newThis._x+=dx;
newThis._y+=dy;
[COLOR=darkolivegreen] //["bullet_mc"+nStoredLocation][/COLOR]
[COLOR=darkolivegreen] //trace("dx: "+dx +" Loaction X: "+this._x);[/COLOR]
[COLOR=darkolivegreen] //trace("dy: "+dy+" Loaction Y: "+this._y);[/COLOR]
[COLOR=darkolivegreen] //progresses the timer variable[/COLOR]
nTimer++;
}
if(nTimer>nTimerMax)
{
[COLOR=darkolivegreen] //removes this interval[/COLOR]
clearInterval(iRequestRotation);
[COLOR=darkolivegreen] //removes movieclip[/COLOR]
newThis.removeMovieClip();
newThis.unloadMovie();
unloadMovie(newThis);
newThis.unloadMovie;
[COLOR=darkolivegreen] //trace("Location: "+newThis._parent["bullet_mc"+nStoredLocation])[/COLOR]
removeMovieClip(newThis._parent["bullet_mc"+nStoredLocation]);
[COLOR=darkolivegreen] //setTimeout an undocument Function calls the function once after a time delay[/COLOR]
[COLOR=darkolivegreen] //setTimeout(fUnloader,1000);[/COLOR]
trace("Movie Unloaded");
}
trace(newThis);
}
}
//sets an interval that is activated on startup
var iRequestRotation = setInterval(fRequestRotation, 1000 / 12);
i’ve tried everything i can think of any help at all would be greatly appreciated.