A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Time Out

  1. #1
    Senior Member
    Join Date
    Oct 2000
    Location
    indianapolis
    Posts
    144

    Time Out

    is there a way to get a movie to perform an action after a vertain amount of time of no activity. basically what i would like to do is if a user is on a certain part of my swf and they do not move the mouse for x amount of time, i want the actionscript to the send them to a new page.html

    hope this makes sense?

    thanks for your help.

  2. #2
    Senior Member Dricciotti's Avatar
    Join Date
    Aug 2002
    Posts
    2,988
    Keep track of each time the mouse moves and then compare that with the current time in the movie. You could have something like this:
    code:
    lastMouseMove = getTimer();
    _root.onMouseMove = function()
    {
    lastMouseMove = getTimer();
    }
    _root.onEnterFrame = function()
    {
    if(getTimer() - lastMouseMove > 5*1000)
    {
    // check if mouse hasnt moved in 5 seconds
    trace("Expire!");
    delete _root.onEnterFrame;
    }
    }


  3. #3
    Senior Member
    Join Date
    Oct 2000
    Location
    indianapolis
    Posts
    144
    Thanks!

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