Hi, please help, it seems simple, but it doesn't seem to be working I have 2 as3 files as classes "mainclass.as3 (this is the document class)" and GamePlay.as3
the GamePlay class works flawlessly on it's own, but when i try to create the var to access it ... var gp:GamePlay=new GamePlay(); ... i get the following error. can someone post an example on how this should work?
I have looked at tutorial etc, but i cant get it to work i am currently getting the following error.
Error: Error #2136: The SWF file file:///C|/LAPTOP/Games/mygame/mygame.swf contains invalid data.
at mainclass/begin()
at MethodInfo-139()
Please help
Actionscript Code:
package{
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.events.MouseEvent;
import GamePlay;
public class mainclass extends MovieClip{
public function mainclass():void{
gotoAndStop(1, "Main Menu");
ply_btn.addEventListener(MouseEvent.MOUSE_UP, myBtnHandler1);
function myBtnHandler1(event:MouseEvent):void {
gotoAndStop(1, "Game");
begin();
};
}
public function begin(){
var gp:GamePlay=new GamePlay();
gp.startGame();
}
}
}