Buttons to other scenes
Hi.
I'm new to actionscript 3.
Main (scene 1)
stop();
import flash.events.*;
import flash.display.*;
1_btn.addEventListener(MouseEvent.CLICK, go1);
2_btn.addEventListener(MouseEvent.CLICK, go2);
3_btn.addEventListener(MouseEvent.CLICK, go3);
4_btn.addEventListener(MouseEvent.CLICK, go4);
5_btn.addEventListener(MouseEvent.CLICK, go5);
6_btn.addEventListener(MouseEvent.CLICK, go6);
7_btn.addEventListener(MouseEvent.CLICK, go7);
8_btn.addEventListener(MouseEvent.CLICK, go8);
9_btn.addEventListener(MouseEvent.CLICK, go9);
10_btn.addEventListener(MouseEvent.CLICK, go10);
function go1(evt:MouseEvent):void {
gotoAndStop(1, "1");
}
function go2(evt:MouseEvent):void {
gotoAndPlay(1, "2");
}
function go3(evt:MouseEvent):void {
gotoAndPlay(1, "3");
}
function go4(evt:MouseEvent):void {
gotoAndPlay(1, "4");
}
function go5(evt:MouseEvent):void {
gotoAndPlay(1, "5");
}
function go6(evt:MouseEvent):void {
gotoAndPlay(1, "6");
}
function go7(evt:MouseEvent):void {
gotoAndPlay(1, "7");
}
function go8(evt:MouseEvent):void {
gotoAndPlay(1, "8");
}
function go9(evt:MouseEvent):void {
gotoAndPlay(1, "9");
}
function go10(evt:MouseEvent):void {
gotoAndPlay(1, "10");
}
Now from any of the 10 scenes:
stop();
//Tried with and without the following 2 lines
import flash.events.*;
import flash.display.*;
main_btn.addEventListener(MouseEvent.CLICK, goM);
function goM(evt:MouseEvent):void {
gotoAndStop(1, "Main");
}
When I test error 1120 happens
Does anyone know what I do wrong? And how can I fix it? I want that you can go to every scene from main menu and from every scene back to main menu.