Syntax error: expecting rightparen before not.
Another textbook problem!
The step word for word in my textbook is:
The following four lines of code placed above the goto statement for the function called by the home button so the animation does not play when the Home button is clicked.
if (animationInstance.parent != null)
{
animationinstance.parent.removeChild(animationInstance);
}
So.. I added this step to my code for the assignment and when I test it, I'm getting error:
Scene 1, Layer 'actions', Frame 1, Line 29 1084: Syntax error: expecting rightparen before not.
Here's my entire code for the frame:
import flash.events.MouseEvent;
stop();
var animationInstance:animationMC = new animationMC();
graphicsBtn.addEventListener(MouseEvent.CLICK, goto2);
function goto2(Event:MouseEvent)
{
gotoAndStop(2);
}
animationsBtn.addEventListener(MouseEvent.CLICK, goto3);
function goto3(Event:MouseEvent)
{
gotoAndStop(3);
}
formBtn.addEventListener(MouseEvent.CLICK, goto4);
function goto4(Event:MouseEvent)
{
gotoAndStop(4);
}
photoBtn.addEventListener(MouseEvent.CLICK, goto5);
function goto5(Event:MouseEvent)
{
gotoAndStop(5);
}
homeBtn.addEventListener(MouseEvent.CLICK, goto1);
function goto1(Event:MouseEvent)
{
if(animationInstance.parent ! = null)
{
animationInstance.parent.removeChild(animationInstance);
}
gotoAndStop(1);
}
Any help is appreciated!! ![]()
