hi
this one is killing me, i have a movieclip on the stage which holds other movieclips 1-12 (pictures of logs that make a bridge)
now the problem is i am trying to do a sequence game for kids, the character jumps on log2_mc and then log4_mc and then says whats the next in the sequence,
and i wish to check for log6_mc i can do this but after which i need to check for 8 and then 10
this is where the problems occur
Inside each log1_mc (for example) i have animations of what happens if the wrong log is selected, so if they choose wrong the log falls else it stays, after they correctly choose log6 i need to then listen for log8, if they choose log6 then the log will fall, you follow me?
anyway here is what i have so far, the problem is that none of the logs fall, i think this maybe to do with the eventlisteners, and i can choose them in any order, and they will not play the animations, please help this is doing my skull in
stop();
var correctA:Array = ["log6_mc", "log8_mc", "log10_mc"];
var incorrectA:Array = [];
var index:int=0
log_mc.buttonMode=true;
log_mc.addEventListener(MouseEvent.MOUSE_OVER, logove, true); //true makes children hear the listener which could be part of the problem
log_mc.addEventListener(MouseEvent.MOUSE_OUT, logou, true);
log_mc.addEventListener(MouseEvent.CLICK, logclick, true);
function logove(event:MouseEvent):void{
event.target.play();
}
function logou(event:MouseEvent):void{
event.target.gotoAndStop("logout");
}
function logclick(event:MouseEvent):void{
trace(event.target.name);
if(correctA[index]==event.target.name){
index++;
if(index==correctA.length){
// game/puzzle completed. do whatever
gotoAndPlay(2);
return;
}
trace("correct");
// correct log clicked. do whatever
for(var i:int=0;i<incorrectA.length;i++){
MovieClip(log_mc.getChildByName(incorrectA*)).mouseEnabled=true;
}
incorrectA.length=0;
MovieClip(event.target).mouseEnabled=false;
MovieClip(event.target).gotoAndPlay("rightlogclicked");
} else {
trace("incorrect");
MovieClip(event.target).gotoAndPlay("wronglogclicked");
incorrectA.push(event.target.name);
MovieClip(event.target).mouseEnabled=false;
}
trace("****");
}
hope you can put me out of my misery, i dont care how its done so long as it works (i mean it doesnt have to be an array if it doesnt need to be)
if you know of any good sequencing tutorials that could help please let me know
thanks in advance
fonz