dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: screen saver sort of thing

  1. #1
    Junior Member
    Join Date
    Nov 2002
    Location
    NYC
    Posts
    27

    screen saver sort of thing

    is there a way to tell a movie to go a place after a period of time
    of mouse idle, sort of like a screen saver thing.. ok well thank you in advance if this is possible

  2. #2
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    You could probably wrap this up in a class to make it pretty, but this will do the job.

    Code:
    _level0.start = getTimer();
    _level0.lastx = 0;
    _level0.lasty = 0;
    _level0.idletime = 5000; // desired idle time in seconds * 1000
    
    _root.onEnterFrame = function() {
    
    	if (_root._xmouse != _level0.lastx) {
    		_level0.lastx = _root._xmouse;
    		_level0.start = getTimer();
    	}
    
    	if (_root._ymouse != _level0.lasty) {
    		_level0.lasty = _root._ymouse;
    		_level0.start = getTimer();
    	}
    	
    	if (getTimer() - _level0.start > _level0.idletime) {
    		trace("mouse has been idle for " + idletime);
    		_level0.start = getTimer(); // reset idle timer
    	}
    
    }

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