Count number of buttons clicked

  • Mrc1n4
  • Novice
  • Novice
  • Mrc1n4
  • Posts: 26
  • Loc: Slovenia

Post 3+ Months Ago

Hello!

I have 10 buttons, and when 5 of them are clicked (not any 5, but the ones I want-maby by setting their id?), next scene should start playing.



Thank you...
  • classified
  • Expert
  • Expert
  • User avatar
  • Posts: 540
  • Loc: Bahrain

Post 3+ Months Ago

Code: [ Select ]
i=0
function increment() {
    i++
    trace(i);
    if (i ==5) {
        gotoAndPlay("sceneName");
    }
}
b1.onPress = increment;
b2.onPress = increment;
  1. i=0
  2. function increment() {
  3.     i++
  4.     trace(i);
  5.     if (i ==5) {
  6.         gotoAndPlay("sceneName");
  7.     }
  8. }
  9. b1.onPress = increment;
  10. b2.onPress = increment;
  • Mrc1n4
  • Novice
  • Novice
  • Mrc1n4
  • Posts: 26
  • Loc: Slovenia

Post 3+ Months Ago

oh thanx, works perfectly :)
  • Mrc1n4
  • Novice
  • Novice
  • Mrc1n4
  • Posts: 26
  • Loc: Slovenia

Post 3+ Months Ago

Hey, I need something else... I have 10 buttons, and when a combination of two btns (lets say b2 and b7) is clicked, play something... :)

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 7 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.