setInterval() in Flex Builder

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:

[SIZE=2]digestIntervalID = setInterval(digest, 1000);[/SIZE]

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

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

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

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?

I used the AS3 Language Reference to double check my answer to your first post: http://www.adobe.com/go/AS3LR/

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.