Skip navigation
Currently Being Moderated

Changing frames on a button

Apr 22, 2012 9:01 AM

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)





But that's only for movieclips, so do I have to make a pressable movieclip, or is there another way?

  • Currently Being Moderated
    Apr 22, 2012 11:54 AM   in reply to kkiilleerr1997

    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 




    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

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points