PDA

View Full Version : Basic "click on the country" game


weegi_c
04-10-2007, 06:10 PM
Hi guys,

I'm making a basic click the correct country game, and I have all my buttons for each country ready.
See I could do this the lame way and just have the correct country button going to a 'correct' message, and make all the other country buttons either with no actionscript at all or make them go to an 'incorrect' message, but is there a better way of doing this in actionscript, possibly using variables?

Thanks

Lou - sucks at Flash!

dvlnblk
04-10-2007, 07:29 PM
you mean something like this:

var correctAns:String = "us";
//
usBtn.onRelease = function():Void{
if (currectAns == "us"){
trace("correct answer"):
}else{
trace("incorrect answer");
}
}
//
brazilBtn.onRelease = function():Void{
if (currectAns == "brazil"){
trace("correct answer"):
}else{
trace("incorrect answer");
}
}

weegi_c
04-10-2007, 07:39 PM
Yeah something like that!
Now would that script be put in the frames or the buttons?

dvlnblk
04-10-2007, 07:45 PM
LOL...Cool. That code would go in a layer (named as or actions) above where the physical button resides. The button is also a movieClip and not a button component.