A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Issue with points

  1. #1
    Junior Member
    Join Date
    May 2011
    Posts
    7

    Question Issue with points

    I have a function that when a timer hits 10 sec to add 10,000 points to score, but when I play the movie keeps adding points over and over again. How can I stop this?
    Thanks in Advance

    Here is the code:
    PHP Code:
    onClipEvent (enterFrame) {
    if(
    _root.count_down==1001) {
            
    _root.count_down--;
            
    _root.score += 10000;
    }


  2. #2
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    this will happen because when count_down hits 1001
    you subtract one from it
    Code:
    _root.count_down--
    then add 10000 to the score.
    if count_down is being incremented somewhere else (which it must be). then it will keep getting to 1001 and adding 10000 to the score.

    why do you subtract one from count_down?
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

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