main.as
package{
import flash.display.*;
import flash.events.Event;
public class main extends MovieClip{
public function main(){
changeState(null,"menu");
}
public function changeState( CurrentState, NextState){
if(CurrentState != null){
removeChild(CurrentState);
}
if(NextState == "menu"){
var mm:mainMenu = new mainMenu(changeState);
addChild(mm);
}
else if(NextState == "game"){
var g:CollapsingBlocks = new CollapsingBlocks(changeState);
addChild(g);
}
else if(NextState == "exit"){
}
}
}
}
maniMenu.as
package{
import flash.display.*;
import flash.events.MouseEvent;
import flash.events.Event;
public class mainMenu extends MovieClip{
var theCallBackFunction:Function;
public function mainMenu(callBack){
var btnPlay:mmPlay = new mmPlay();
btnPlay.addEventListener(MouseEvent.MOUSE_DOWN, btnP_Button);
btnPlay.x=width/2=btnPlay.width/2;
btnPlay.y=height/2=btnPlay.height/2;
addChild(btnPlay);
var btnExit:mmExit = new mmExit();
btnExit.addEventListener(MouseEvent.MOUSE_DOWN, btnE_Button);
btnExit.x=width/2=btnExit.width/2;
btnExit.y=height/2=btnExit.height/2;
btnExit.y + btnExit.height + 4;
addChild(btnExit);
theCallBackFunction = callBack;
}
public function btnP_button(e:MouseEvent){
theCallBackFunction (this, "game");
return;
}
public function btnE_button(e:MouseEvent){
theCallBackFunction (this, "exit");
return;
}
}
}
CollapsingBlock.as
..
public function startCollapsingBlocks(callBack) {
..
How to solve this problem? (error 1136), I'm using Flash CS6 version. File of the game is called CollapsingBlocks.fla, main function called startCollapsingBlocks, I'm trying to make here simple Flash game Menu, with 2 buttons (Play and EXIT).