Replay button

  • Ami
  • Newbie
  • Newbie
  • Ami
  • Posts: 6
  • Loc: Malaysia

Post 3+ Months Ago

hi all, wat should i write for the as to recount the number of btn have been clicked??cos this is used in a replay btn. i have btn for user to click n count how many time the btn have been clicked n show out the match image, so now another btn (replay)to let the user to see again the image so what should i write in the replay btn's as to let the count of the times of btn have been clicked start . cos what i done now it can't start to count again it just plus the number i have clicked for the btn.

Let's say if the image just only have 3 so tat when i finish clicked 3 times all the image ady showed n now i click the replay btn but wat i get is wrong cos in the output box it still counting the number i have been click for the btn so it show 4,5,....... it can't start count again.

i use 2 type of btn 1 is finger btn n the other 1 is number btn.

at finger btn
Code: [ Select ]
on (rollOver) {
  Mouse.hide();
  startDrag("track", true);
}
on (rollOut) {
  Mouse.show();
  stopDrag();
  setProperty("track", _x, "850");
  setProperty("track", _y, "650");
}
on (release) {
  count++;
  trace(count);
  if (count == 0) {
     tellTarget ("1") {
         gotoAndPlay(1);
     }
     
  }
  if (count == 1) {
     unloadMovie("1");
     tellTarget ("1a") {
         gotoAndPlay(2);
     }
     b1.onRelease = function() {
         (count == 1);
     };
  }
  if (count == 2) {
     gotoAndPlay(11);
     unloadMovie("1a");
     tellTarget ("1b") {
         gotoAndPlay(2);
     }
     b2.onRelease = function() {
         (count == 2);
     };
  }
  if (count == 3) {
     gotoAndStop(13);
     unloadMovie("1b");
     tellTarget ("1c") {
         gotoAndPlay(2);
     }
     b3.onRelease = function() {
         (count == 3);
     };
  }
}

  1. on (rollOver) {
  2.   Mouse.hide();
  3.   startDrag("track", true);
  4. }
  5. on (rollOut) {
  6.   Mouse.show();
  7.   stopDrag();
  8.   setProperty("track", _x, "850");
  9.   setProperty("track", _y, "650");
  10. }
  11. on (release) {
  12.   count++;
  13.   trace(count);
  14.   if (count == 0) {
  15.      tellTarget ("1") {
  16.          gotoAndPlay(1);
  17.      }
  18.      
  19.   }
  20.   if (count == 1) {
  21.      unloadMovie("1");
  22.      tellTarget ("1a") {
  23.          gotoAndPlay(2);
  24.      }
  25.      b1.onRelease = function() {
  26.          (count == 1);
  27.      };
  28.   }
  29.   if (count == 2) {
  30.      gotoAndPlay(11);
  31.      unloadMovie("1a");
  32.      tellTarget ("1b") {
  33.          gotoAndPlay(2);
  34.      }
  35.      b2.onRelease = function() {
  36.          (count == 2);
  37.      };
  38.   }
  39.   if (count == 3) {
  40.      gotoAndStop(13);
  41.      unloadMovie("1b");
  42.      tellTarget ("1c") {
  43.          gotoAndPlay(2);
  44.      }
  45.      b3.onRelease = function() {
  46.          (count == 3);
  47.      };
  48.   }
  49. }


at number btn(here i put the last btn)
Code: [ Select ]
on (release) {
  gotoAndStop(13);
  count++;
  trace(count);
  count == 3;
  unloadMovie("1b");
  tellTarget ("1c") {
     gotoAndPlay(2);
  }
}
  1. on (release) {
  2.   gotoAndStop(13);
  3.   count++;
  4.   trace(count);
  5.   count == 3;
  6.   unloadMovie("1b");
  7.   tellTarget ("1c") {
  8.      gotoAndPlay(2);
  9.   }
  10. }


now facing problem at the replay btn there tat i need it to go back to the first frame of the movieclip n it can let the count be recount again .i had try out a code tat it can recount start from 1 but it didnt show out the answer when i click the finger or number btn.

this is the code i put at the replay btn.
Code: [ Select ]
on (release) {

unloadMovie("1c");
count++;
trace(count);

if (count >= 3 ) {
    count = 0;
    }
delete(count);
  gotoAndStop(1);
}

  1. on (release) {
  2. unloadMovie("1c");
  3. count++;
  4. trace(count);
  5. if (count >= 3 ) {
  6.     count = 0;
  7.     }
  8. delete(count);
  9.   gotoAndStop(1);
  10. }


i don't know whether it is correct or not.who knows please tell me .
thanks
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 12 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
 
cron
 

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