Weird Click Problem

Hey all,

I was wondering if you guys could help me with a perticular problem I’m having with my flash game.

My game is built using a flash file which has four frames; each frame is for a part of the game.

Intro
Main Game
Rules
Endgame

On the Main Game frame I have a MovieClip on the top corner of the screen which is the main game created by actionscript. I’ve used this setup multiple times and its always worked fine.

My problem is, that the constructor of the MovieClip (the game) has a

stage.addEventListener(MouseEvent.CLICK, goStep);

So when the user clicks on the stage, it will call the goStep function.

However, the intro frame of my game requires a user to click a button which takes them to the main game. The main game is registering this as a click and automatically calls the goStep() function. What should happen is the user clicks the button, gets taken to the main game, it calls the constructor and waits for the next mouse click.

I apologize if this sounds confusing and would appreciate any help at all on the matter. I’ve tried changing the MouseEvent.Click to just a keyboard event and that works fine- but I really need it for mouse clicks. Thanks all :slight_smile:

You could also test within goStep for a global status value e.g MainGame:Boolean

e.g
if(MainGame)
{
//process normal game activity else do nothing
}

Can you redefine the click event on the Intro frame to something that does nothing, then define it again on the game frame?

So like, have an event listener on the intro frame which is exactly as the one in actionscript movieclip? I tried this but it failed to overwrite my current one.

I’m about to try the global status variable thing.

Yeah, that’s probably a better solution than mine. :slight_smile: