TypeError: Error #1006 - Removing MovieClip from the stage
I have a movie clip that is called to the stage and once the movieclip is finished it calls a function that removes it from the stage. The code works but I get an error message about 4 seconds after the movie clip ends.
Here’s the error message:
TypeError: Error #1006: exitWordMicroscopic is not a function.
at ASvocabulary_microscopic/frame110()[ASvocabulary_microscopic::frame110:1]
Here’s the stage code:
//************************Removes the movieclip from the stage and enables the button.*************************
function exitWordMicroscopic():void
{
bnt_vocab_microscopic.mouseEnabled = true;
removeChild(word_Microscopic);
}
//******************************Stage buttons**************************************
stage.addEventListener(MouseEvent.MOUSE_DOWN, goButtonsHomeRead_1);
function goButtonsHomeRead_1(event:MouseEvent):void
{
//Vocabulary buttons
if (event.target == bnt_vocab_microscopic)
{
bnt_vocab_microscopic.mouseEnabled = false;
SoundMixer.stopAll();
addChild(word_Microscopic);
word_Microscopic.x = 47;
word_Microscopic.y = 120;
}
}
Here’s the code inside the movie clip. This is what the error message is referring to:
//****************** Calls function to remove itself from the stage****************************
Object(parent).exitWordMicroscopic();
What am I doing wrong?
