A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Timeout to restart

Hybrid View

  1. #1
    Junior Member
    Join Date
    Jul 2000
    Posts
    17
    Is there anyway I can create a timeout in actionscript that if a user doesn't interact with a flash piece for a given amount of time, that it will time out and restart.

    Thanks in advance.

  2. #2
    Hack
    Join Date
    Mar 2000
    Location
    Madison, WI
    Posts
    1,753
    The only way I would know how to do that is through the GetTimer command.

    What you would have to do is have every interactive element in your movie set a variable that notes the time of the interaction. Something like this:

    On (Press, Release, Release Outside, Rollover, Rollout, Dragover, Dragout)
    Set Variable: "/:clicktime" = GetTimer/1000
    End On

    Then, you'll need your main timeline (or some other MC) loop so it can constantly check /:clicktime and see how long it's been, like this:

    Set Variable: "now" = GetTimer/1000
    If (now > /:clicktime + 300)
    [Do the timeout thing]
    End If

    That particular script will timeout after 300 seconds of no interaction.

  3. #3
    juggernart me2222's Avatar
    Join Date
    Jun 2000
    Posts
    1,322
    Well, this one is not exactly what you want, but its another way:
    At the beginning of the movie start dragging (with lockcenter) an empty mc that stores its x and y position (which are the mousex and mousey) in variables.
    Then in the maintimeline check every x seconds if the mouse has moved.

    I could send you a little .fla that I just hacked down.
    Send me an email if you want it

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