To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Reply
 
Thread Tools Search this Thread Display Modes
Old 10-08-2004, 06:53 PM   #1
clinton2
Banned
 
Join Date: Aug 2004
Posts: 138
timing

How do you run function after so many seconds
like if I had a button that would call a function, how would I make it work so the function works after a few seconds after the button is clicked?
clinton2 is offline   Reply With Quote
Old 10-08-2004, 07:04 PM   #2
jbum
Senior Member
 
jbum's Avatar
 
Join Date: Feb 2004
Location: Los Angeles
Posts: 2,920
See the sticky post at the top of this forum about setInterval() - that's what you're looking for.

code:

millisecondsToDelay = 4*1000; // 4 seconds

myFutureFunction = function()
{
clearInterval(ih);
// do future stuff here...
}

ih = setInterval(myFutureFunction, millisecondsToDelay);

__________________
jbum is offline   Reply With Quote
Old 10-08-2004, 07:41 PM   #3
clinton2
Banned
 
Join Date: Aug 2004
Posts: 138
thnx jbum
clinton2 is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:15 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.