dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: stopping the count

  1. #1
    Junior Member
    Join Date
    Oct 2001
    Posts
    3
    hi i have created a button and a dynamic text block as a counter for everytime you press the button. in the button i have written n (release) {
    count+=10;
    }

    because i want the count to increase by 10 everytime the button is pressed. this doesnt actually work properly only the minus syntax works well: on (release) {
    count-=10;
    }
    why?

    And also once it reaches 100 i would like it to stop, and also doesnt go lower than 0. how can you make it do that?

  2. #2
    Member
    Join Date
    Oct 2001
    Posts
    44

    Post


    Here You have something...

    action for button:
    Code:
    on (release){
    if (counter<0){ // variable defined in _root (var counter=start_value)
     _root.count=0;   // count - dynamic text field var
    } else if (counter<100){
      counter+=10;
     _root.count=counter 
     } else if(counter>=100){
     counter=100;
     _root.count=counter;
      }
    }
    Try experiments with this a little bit...
    ZeroIQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center