A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Timers

  1. #1
    Junior Member
    Join Date
    Apr 2002
    Posts
    20
    How do i make a timer for a game so when it gets to zero it will change scenes?

  2. #2
    Junior Member
    Join Date
    Apr 2002
    Posts
    21

    getTimer

    use "getTimer"

  3. #3
    Pillow Daddy m_andrews808's Avatar
    Join Date
    May 2001
    Location
    London England
    Posts
    924
    Where the damn titties??

  4. #4
    Gross Pecululatarian Ed Mack's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    2,954
    Could you please use sensible words? Don't want ot get these forums looking like those other horrid forums, ***********.



    Note to dismayed users: Previously, this thread had the title "Titties and Weed: help w/ flash"
    [Edited by Ed_Mack on 04-09-2002 at 12:51 PM]

  5. #5
    Junior Member
    Join Date
    Apr 2002
    Posts
    21
    Actions/Objects/Data/getTime

  6. #6
    SaphuA mosterdfles_flash's Avatar
    Join Date
    Jan 2002
    Location
    Tha Couch
    Posts
    935

    Hmmm...

    I use the n00b way:

    make a MC with 12 frames (depends on youre movie speed)
    put on the 12th frame a key frame with this script.

    _root.timer-=1;

    now on the maintimeline make a dynamic textfield with the value you want the player to have the time...

    now use this script on a MC or something:

    if(_root.timer==0){
    gotoAndStop("YouLosePunk");
    }

  7. #7
    Gross Pecululatarian Ed Mack's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    2,954
    This is quite easy:

    onClipEvent(load){
    start = getTimer();

    secs = 5; // The delay
    }
    onClipEvent(enterFrame){
    now = getTimer();
    passed = now - start;
    if(passed/1000 > secs){
    // Do somthing
    }
    }

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