PDA

View Full Version : setInterval() in Flex Builder



lec
May 26th, 2008, 10:53 AM
Hi,

I started learning AS3 two days ago so I'm very new to it. I decided to use Flex Builder 3 for my AS testing but ran into a bit of a problem. I'm going through an example from the book I'm reading and I need to use setInterval() but I'm getting the following error:


1180: Call to a possibly undefined method setInterval. virtualzoo/src/zoo VirtualPet.as line 20 1211805885932 246


Here's the code:

digestIntervalID = setInterval(digest, 1000);

Is there something I have to import for setInterval to work?

Krilnon
May 26th, 2008, 01:30 PM
Is there something I have to import for setInterval to work?

Yes. Either flash.utils.setInterval or flash.utils.*

lec
May 26th, 2008, 01:42 PM
Yes! Thank you so much. Is there a way to find these? Like if I have a function name, how do I find what to import?

Krilnon
May 26th, 2008, 01:43 PM
I used the AS3 Language Reference to double check my answer to your first post: http://www.adobe.com/go/AS3LR/

lec
May 26th, 2008, 02:27 PM
For some reason the search wasn't too helpful for me but at least I can see what functions are in each package. It looks like a very comprehensive reference guide. Thanks for the link and thanks again for your help.