Screen Saver

Hello Peoples!!
What I wanted to do was make like a flash presentation that a person could use but if the mouse was left alone for a while then it would load another flash movie presentation. Kind of like a screen saver. Does anyone know how I can achive this?:thumb:
I was thinking about 1 minute rest time before the other movie will load. Am I asking too much or can anyone help me? Or direct me to a tutorial on this?

Thanks,
Roxy Gurl:bu:

Should be simple.

Have a little thing that starts a timer when the mouse stops moving. When the timer reaches a value, go to a frame or scene with your ‘screensaver’ stuff.

Lets say your screensaver mc is on frame 10:[AS]mouseListener = new Object();
mySeconds = 2;//how many seconds of inactivity
function startTimer() {
initial = getTimer()/1000;
}
function screenSaver() {
this.onEnterFrame = null;
this.gotoAndStop(10);
}
this.onEnterFrame = function() {
elapsedTime = Math.floor(getTimer()/1000-initial);
(elapsedTime == mySeconds) ? screenSaver() : trace(elapsedTime);
};
mouseListener.onMouseMove = startTimer;
Mouse.addListener(mouseListener);
startTimer();[/AS]

Hehe, yup, there it is, nice claudio.

Thanks :beam:

Thanks a lot youse guys. It works fine!! By any chance can I use this code for the mouse movement to end the movie that was just loaded. If you can help me that is fine but this was more important which you heros have just helped me with.

-RoxyGurl

Welcome :slight_smile:
Hmm i dont quite get what you want … :-
Can you explain it for me?

I think she wants the “screensaver” to quit and go back to where the user was before it was loaded

Ok HelloKittyGurl. Make your screensaver a movie clip and give it an instance name of screensaver_mc. Put it in a layer and its important it covers the entire timeline and it should be on top of any other layer. Now apply the following code on the first frame of your main timeline:[AS]this.screensaver_mc._visible = false;
mouseListener = new Object();
mySeconds = 2;//how many seconds of inactivity
function startTimer() {
initial = getTimer()/1000;
iniTime = (initial-pauseTime)+iniTime;
this.play();
this.screensaver_mc._visible = false;
playing = true;
}
function screenSaver() {
pauseTime = getTimer()/1000;
this.stop();
this.screensaver_mc._visible = true;
playing = false;
}
_root.onEnterFrame = function() {
elapsedTime = getTimer()/1000-iniTime;
if (playing) {
elapsedTime = Math.floor(getTimer()/1000-initial);
(elapsedTime == mySeconds) ? screenSaver() : trace(elapsedTime);
}
};
mouseListener.onMouseMove = function() {
_root.startTimer();
};
Mouse.addListener(mouseListener);[/AS]This will call the screensaver_mc after 2 seconds of inactivity.
[edit]While the screensaver is being displayed, the main movie stops. If the user moves the mouse, the main movie continues playing.[/edit]

Thanks again! I was using it for a presentation that was going to be in a booth. I put the web page that I made for the company on a cd but if no one was using the web page I wanted another mc to start kinda showcasing the web page more of a presentation style. Since both were made in flash I got to use your code and it worked perfectly. The booth was a success!!
The booth was for a surf store in Hawaii. Thanks again,
RoxyGurl
:love: