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 09-27-2004, 02:59 PM   #1
JPritchard
Junior Member
 
Join Date: May 2004
Location: Philadelphia, PA
Posts: 24
trouble playing tones with 100 ms interval

I have six tones that are stored in an array, and I am trying to play them with 100 ms in between the tones. They are 100 ms tones with 100 ms pauses between, but I am trying to use a for loop and they just get mashed together.

I've tried the set interval method, but I haven't had any luck (I've never used it before, so I may not be doing it correctly).

I'd appreciate any help I could get. Thanks a lot,
JPritchard is offline   Reply With Quote
Old 09-27-2004, 06:09 PM   #2
jbum
Senior Member
 
jbum's Avatar
 
Join Date: Feb 2004
Location: Los Angeles
Posts: 2,920
You can't use a for-loop to control timing because it's gonna try to execute all that code before rendering a single frame, and if the code takes too long to execute, you'll get the dreaded 'script is taking too long' dialog.

So either onEnterFrame or setInterval is the way to go. If you post your code in which you were attempting to use setInterval, I'd be happy to help you fix it (I'd prefer to correct existing code rather than write the whole thing from scratch).
__________________
jbum is offline   Reply With Quote
Old 09-28-2004, 08:45 AM   #3
JPritchard
Junior Member
 
Join Date: May 2004
Location: Philadelphia, PA
Posts: 24
setInterval

After seeing your response, I spent about two hours working out the correct usage of the setInterval method last night (at least for what I needed it for), and low and behold, that fixed my problem.

It's a little tricky to work with (setInterval), but I can see about a million uses for it.

Thanks a lot for your help!
JPritchard is offline   Reply With Quote
Old 09-28-2004, 04:09 PM   #4
jbum
Senior Member
 
jbum's Avatar
 
Join Date: Feb 2004
Location: Los Angeles
Posts: 2,920
That's a good thing - fixing it yourself is the best way to learn!

- Jim
__________________
jbum 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 07:23 PM.


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

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


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