Flash - actionscript help..
Discussion
Hi guys, hope someone can help..
I'm trying to write a small piece of actionscript that fades from one picture to the next on roll over and back to the original on roll out. This I've managed to do, but on roll out I'd like to cause the image to pause/delay before fading back to the original.
ie. the script waits 5 seconds before fading back to the original when the mouse moves out of the image. (script below)
Thanks
Graham
onClipEvent(load)
{
dir = 0;
speed = 3;
original._alpha = 100;
delay = getTimer() + 5 * 1000;
this.onRollOver = function()
{
dir = -1;
}
this.onRollOut = function(){
if (delay <= 5000)
{
dir = 0;
}
if (delay > 5000)
{
dir = 1;
}
useHandCursor = false;
}
}
onClipEvent(enterFrame)
{
temp = BW._alpha + speed*dir;
BW._alpha = Math.min(100,Math.max(temp,0));
}
I'm trying to write a small piece of actionscript that fades from one picture to the next on roll over and back to the original on roll out. This I've managed to do, but on roll out I'd like to cause the image to pause/delay before fading back to the original.
ie. the script waits 5 seconds before fading back to the original when the mouse moves out of the image. (script below)
Thanks
Graham
onClipEvent(load)
{
dir = 0;
speed = 3;
original._alpha = 100;
delay = getTimer() + 5 * 1000;
this.onRollOver = function()
{
dir = -1;
}
this.onRollOut = function(){
if (delay <= 5000)
{
dir = 0;
}
if (delay > 5000)
{
dir = 1;
}
useHandCursor = false;
}
}
onClipEvent(enterFrame)
{
temp = BW._alpha + speed*dir;
BW._alpha = Math.min(100,Math.max(temp,0));
}
Edited by GJR on Sunday 18th February 18:04
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff


