PDA

View Full Version : minor problem


Flo
01-26-2001, 12:00 AM
This is the final script for a game ive created, the point of it is to click on body parts and match them to who you think they belong to. This last script is supposed to send the user if they clicked on the right parts to a celebration (scene2) it dont work though, any help would be great
on (press) {
torso == "sam";
}
on (press) {
if (girl =="sam" && eyes =="sam" &&
legs =="sam" && torso =="sam") {
gotoAndPlay ("scene2, 1");
}
}
---I have a variable set on each image----
on (press) {
girl == "eve";
}

Jesse
01-26-2001, 01:05 AM
I hope all these actions aren't on the same button. You can only have one
on (press){
}

one each button. ALl command to occur on press should go within that command.

I'm not exactly sure what the problem is here, but can I suggest one thing. Rather than checking if everything equals "sam" or everything equals "eve", why not just check that everything is the same, btu not equla to nothing. Like this:

on (press) {
if (girl==eyes==legs==torso && girl !="") {
gotoAndPlay ("scene2, 1");
}
}

This says:
"if all these things are equal and 'girl' has a value (is not equal to nothing), then ..."
because if theya re all equal and 'girl' has a value, all the others must have a value also.

I hopet his helps

Cheers

Jesse