EOS - Can I use setInterval

All about the past, current and future webteases and the art of webteasing in general.
---
Post Reply
User avatar
boundupone
Explorer At Heart
Explorer At Heart
Posts: 614
Joined: Sat Jun 01, 2013 8:01 pm
Gender: Male
Sexual Orientation: Straight
I am a: Switch

EOS - Can I use setInterval

Post by boundupone »

I am trying to automatically ramp volume over the course of a tease. I have a var set -

Code: Select all

var teaseramps = (volend - volstart) / teasetime
This works by taking the user choices of start volume, end volume and tease time to calculate % increases needed per minute of playing to get to the end target volume

However, I am having issues getting setInterval to work -

Code: Select all

var myInterval; 

myInterval = setInterval(whichFunction,60000);

whichFunction{volume = volume + teaseramps
}
It doesnt seem to matter if I put it in an eval or announce, it just isn't playing

Can anyone help or give me a better way to achieve what I want?
Try anything once!
Ghingis
Explorer At Heart
Explorer At Heart
Posts: 177
Joined: Mon Oct 24, 2011 4:55 pm

Re: EOS - Can I use setInterval

Post by Ghingis »

Afaik there is no setInterval in EOS, but you can check this out, it might help.

viewtopic.php?p=301829#p301829
User avatar
boundupone
Explorer At Heart
Explorer At Heart
Posts: 614
Joined: Sat Jun 01, 2013 8:01 pm
Gender: Male
Sexual Orientation: Straight
I am a: Switch

Re: EOS - Can I use setInterval

Post by boundupone »

Ghingis wrote: Tue May 18, 2021 6:58 pm Afaik there is no setInterval in EOS, but you can check this out, it might help.

viewtopic.php?p=301829#p301829
Hey thanks, but not sure if that one helps me much, but maybe I am missing something?
Try anything once!
fapnip
Explorer At Heart
Explorer At Heart
Posts: 431
Joined: Mon Apr 06, 2020 1:54 pm

Re: EOS - Can I use setInterval

Post by fapnip »

boundupone wrote: Tue May 18, 2021 8:12 pm but maybe I am missing something?
Probably missed that the aforementioned demo uses my setTimeout and setInterval polyfills extensively.

There's no setInterval in Eos natively, but I wrote a polyfill for it that emulates setInterval and setTimeout using sound end events.

See:
viewtopic.php?p=301725#p301725

As explained in the polyfill thread, you'll need the first IF action in the start page (and all its contents -- including all of the Audio play actions) along with the silent MP3.

If you're having issues with it, let me know! (Preferably, post any issues/questions on the polyfill in the polyfill thread.)
User avatar
boundupone
Explorer At Heart
Explorer At Heart
Posts: 614
Joined: Sat Jun 01, 2013 8:01 pm
Gender: Male
Sexual Orientation: Straight
I am a: Switch

Re: EOS - Can I use setInterval

Post by boundupone »

Ah, thanks. Will be a couple of days before I can look at this but will let you know how it goes
Try anything once!
fapnip
Explorer At Heart
Explorer At Heart
Posts: 431
Joined: Mon Apr 06, 2020 1:54 pm

Re: EOS - Can I use setInterval

Post by fapnip »

To simplify use, I've created a fadeTo extension for Eos's Sound object.

See:
viewtopic.php?f=2&t=24081
User avatar
boundupone
Explorer At Heart
Explorer At Heart
Posts: 614
Joined: Sat Jun 01, 2013 8:01 pm
Gender: Male
Sexual Orientation: Straight
I am a: Switch

Re: EOS - Can I use setInterval

Post by boundupone »

Thanks guys, having some issues still so will post on the polyfil thread
Try anything once!
Post Reply