how to make a clip invisible after 4 seconds of idle.
Printable View
how to make a clip invisible after 4 seconds of idle.
define "idle"
You would need to use the getTimer() method to work out the time the movie clip has been idle.
idle as in after the clip has not been used, it turns invisible. In my case the clip I want to make invisible is the control panel to my video gallery, which after 4 seconds I want to turn invisibe.
ok I used it on the clip but after it disappeared completely after i clicked on one of the control panel buttons. here is the code I used.
Code:on (rollOver){
_parent.ba._visible = true;
_parent.bb._visible = true;
_parent.bc._visible = true;
_parent.bd._visible = true;
_parent.controlpanel._visible = true;
if (getTimer()>4000) {
_parent.controlpanel._visible = false;
_parent.ba._visible = false;
_parent.bb._visible = false;
_parent.bc._visible = false;
_parent.bd._visible = false;
}
}
I don't think getTimer() is exactly what you want...
The getTimer() function tells you the number of milliseconds that have passed since the movie started playing. What you need is how long it has been since the user last tried to access the movie clip...
I made a quick example of one way to do it. It has an explanation inside, and fully commented code. Hope it helps!
-Zippy Dee
can I put a timer to hide after a mousemove function. here is the code i used, all I need is a timer that will make it invisible after a mousemove function. I feel this will be easier than a get time function.
Code:onMouseMove = function()
{
ba._visible = true;
bb._visible = true;
bc._visible = true;
bd._visible = true;
controlpanel._visible = true;
};
That should be it.Code:timer = 0;
onEnterFrame = function(){
if(timer <= 60){ //change that number to the desired number of frames to wait before hiding
timer ++;
}else{
ba._visible = false;
bb._visible = false;
bc._visible = false;
bd._visible = false;
controlpanel._visible = false;
}
}
onMouseMove = function(){
ba._visible = true;
bb._visible = true;
bc._visible = true;
bd._visible = true;
controlpanel._visible = true;
timer = 0;
}
if you have another onEnterFrame function somewhere else, then just put that onEnterFrame code into the one you already have.
I understand exactly what you are trying to do. I don't see why that code I gave you wouldn't work.
Yeah, I can take a look. That will probably be easier.
here is the file.