Hi all,
I’m currently working on a game based on the avoider game series written by Micheal James Williams.
It has taught me to make use of multiple scripts. The game is almost to my liking except for one thing. I’m trying to include a character selection in the menu screen.
My plan on how to do this was to include a button in the start screen, that sends out a global variable that will later be used in the avatar MC to select either frame one or two, depending on which was chosen. But I’m allready stuck at reading out the variable.
I’m currently working with a test set up that just provides the variable, and combines a function to it. But for some reason it’s not working.
Avatar.as is linked to my avatar movieclip, this movieclip contains two frames, one labeled frame1 and the other labeled frame2.
I’ve got the following code in my Avatar.as.
public var button = "2nd";
And at the bottom.
public function frameChange() :void {
if (button == "2nd"){
trace("Var read");
this.gotoAndStop("frame2");
}
}
I get no errors, and no trace that the var has been read.
Any help would be greatly appreciated.