Hello, I was going to make a level select frame in my game, and to unlock the different level, you need to complete the previous level. I've done this, but I also want an effect on my button. So if level1 completed=true, it goes red, but if it's false, it goes gray. For a movieclip, I would have used
onClipEvent (enterFrame) {
if (level1 == true)
{
this.lvl1btn.gotoAndStop(2);
}
}
But that's only for movieclips, so do I have to make a pressable movieclip, or is there another way?
If you want a button that will stay in different states you need to use a movieclip as a button.
Just a tidbit else...
if(level1 == true)
can be reduced to
if(level1)
conditinals work based on evaluating whether what is in the parentheses is true or false, so for Boolean values you don't need to use == true/false
North America
Europe, Middle East and Africa
Asia Pacific