Hey everyone so I have a Movie clip named mTriangle
and It's added to the stage like so:
mTriangle = new mcTriangle();
stage.addChild(mTriangle);
mTriangle.x = (stage.stageWidth / 2);
mTriangle.y = (stage.stageHeight / 2);
Now inside this Movie Clip I have a sound that plays on certain frames in the tween. The sound isn't referenced to anything it's just their and only plays on certain frames.
Now in my endGameFunction(); I remove the MovieClip like so:
mTriangle.destroyTriangle();
the destroyTriangle function is located in my mTriangle class like so:
public function destroyTriangle():void
{
if (this.parent)
{
parent.removeChild(this);
trace("REMOVED");
}
}
Now it removes the MovieClip just fine but the sound still plays afterwards. I don't know how to end the sound as well. I tried to add **mTriangle = null;**
for GC but still nothing and I end up getting an error of null reference. Does anyone have any suggestions? I would add the sound through code inside the mTriangle class but i don't know exactly how since i want the sound to play on, for instance frame 5, 9, 10;