Error 1010 and Navigational Button issues
I am simply trying to make some buttons that navigate my scenes but I can not seem to figure out how to get them to work. My buttons were working perfectly until a recent Adobe Animate update and now I can't seem to get them to work even in a later version of the program.
The error is telling me that my second line of code is incorrect and is giving me Error 1010. I believe that it is referring to event listener or the click to go to scene section but I have no idea how to define those things.
stop();
Object(root).StartButton.addEventListener(MouseEvent.CLICK, fl_ClickToGoToNextScene_2);
function fl_ClickToGoToNextScene_2(event:MouseEvent):void
{
MovieClip(this.root).nextScene();
}
I also noticed that after a recent update, my scene number in my code exceeded the amount of scenes I actually had and I am sure that that will be a problem down the road.
Here is the rest of my code. I only have about 11 scenes and the the numbers do not line up with the scenes that I want them to go to.
stop();
Object(root).AsgardB.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_2);
function fl_ClickToGoToScene_2(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Asgard");
}
Object(root).valueOfMidgardB.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_3);
function fl_ClickToGoToScene_3(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Midgard");
}
Object(root).VanaheimB.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_4);
function fl_ClickToGoToScene_4(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Vanaheim");
}
Object(root).AlfheimB.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_5);
function fl_ClickToGoToScene_5(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Alfheim");
}
Object(root).HelheimB.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_6);
function fl_ClickToGoToScene_6(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Helheim");
}
Object(root).MuspelheimB.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_7);
function fl_ClickToGoToScene_7(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Muspelheim");
}
Object(root).NiflheimB.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_8);
function fl_ClickToGoToScene_8(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Niflheim");
}
Object(root).JotunheimB.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_9);
function fl_ClickToGoToScene_9(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Jotunheim");
}
Object(root).NidavellirB.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_10);
function fl_ClickToGoToScene_10(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Nidavellir");
}
I am sure that it is obvious but I don't really know a lot about coding or anything. I am aware that this is not the most efficient way to do what I am trying to do. I just thought that I would try. I did not think it would be this hard to make simple navigational buttons but I suppose I was wrong!
I'm pretty stuck so any help would be appreciated.
Thanks in advance!