I have a scene with a few objects as movieclips which can be clicked one at a time. What happens is that I'm able to click every object and on click the scene switches to the next frame.
How do I change that?
Basically I have a key and a door, both movieclips. You can collect the key, it disappears and after that you are able to click the door to open it. What actually happens is you are both able to click the key and the door. When you click the key, it's working as intended, but when you click the door, the key still disappears. This is much more annoying with more than 2 objects.
code for the key:
addEventListener(MouseEvent.CLICK, CollectKey);
function CollectKey(event: MouseEvent): void
{
this.visible = false;
// door
MovieClip(root).door.addEventListener(MouseEvent.CLICK, MovieClip(root).FinishGame);
}
code for the door:
stop();
function FinishGame(event: MouseEvent): void
{
if(MovieClip(root).currentFrame == 4)
{
nextFrame();
}
}
http://www.wuala.com/sollniss/stuff/Untitled-2.swf/
http://www.wuala.com/sollniss/stuff/Untitled-2.fla/