PDA

View Full Version : Button delay for getURL


tryin2live
08-30-2005, 07:40 AM
i'm hoping someone here can help...

i have a simple button, with a short audio clip on the down state.
the script on the button is basic -
on release....getURL, the link and button do work, however i need a delay before going to that url, about a 3-4 second delay.

i have researched and see that there are many ways of handling, but what is the shortest or simplest code I can use on my button, and do i need to add code to the html page, or can i keep it all in flash

thanks if you can help guys!

sfhazel
08-30-2005, 08:20 AM
I put this on the main timeline:

//1000 is about one second
waitTime = 2000;

function fetchLink(which){
getURL(which, "_blank");
clearInterval(_root.urlInterval);
}

And I put this on my button:

on( release ){
_root.urlInterval = setInterval(_root.fetchLink("http://www.google.com"), _root.waitTime);
}