EOS Code Enquiry

You messed up? Couldn't stick to the instructions? Confess here and do better next time.
Post Reply
IreliaDenial
Explorer
Explorer
Posts: 32
Joined: Fri Jan 19, 2018 9:02 pm

EOS Code Enquiry

Post by IreliaDenial »

Hi Code geek,

I am writing a tease these days and wondering is it possible to show the pictures/play the audio by a function.

Say, in the File/Galleries, I have two images and two different audio tracks:

"test.jpg""test_premium.jpg"
"Easy.mp3""Hard.mps"

Now, I would like to write two functions somehow like this:

function showImage(ImageID, isPremium) {
if isPremium = 0
show ImageID.jpg
else
show ImageID + "_premium.jpg"
}

function playAudio(AudioID) {
if var difficulty = 0
play "Easy.mp3"
if var difficulty = 1
play "Hard.mp3"
}

I've realized there are some API provided in the EOS editor but I'm somehow new to the coding. and, I didn't find such one to implement the show/play module above. Anyone have any ideas or suggestions?

IreliaDenial
Thamrill
Explorer At Heart
Explorer At Heart
Posts: 265
Joined: Thu Jan 03, 2013 4:55 pm
Gender: Male
Sexual Orientation: Straight
I am a: Submissive

Re: EOS Code Enquiry

Post by Thamrill »

Hi, for the audio it's possible, albeit a bit convoluted.
I saw it done in someone's tease (I can't remember the author): they added all sounds action at the start, making them continue across pages, stopping them immediately by script.
Then using the sound API they played the sound by id and stopped them when not needed, so that they would rewind.

For images, I think it's not possible, and that it requires specific IF ACTIONS, and is not doable using the API.

~Thamrill
Image

Image

Image
IreliaDenial
Explorer
Explorer
Posts: 32
Joined: Fri Jan 19, 2018 9:02 pm

Re: EOS Code Enquiry

Post by IreliaDenial »

Thamrill wrote: Sat Sep 25, 2021 8:57 am Hi, for the audio it's possible, albeit a bit convoluted.
I saw it done in someone's tease (I can't remember the author): they added all sounds action at the start, making them continue across pages, stopping them immediately by script.
Then using the sound API they played the sound by id and stopped them when not needed, so that they would rewind.

For images, I think it's not possible, and that it requires specific IF ACTIONS, and is not doable using the API.

~Thamrill
Ah, I see. Sad to know that image cannot be applied by Eval function
Thank you for the help!

regards,
IreliaDenial
fapnip
Explorer At Heart
Explorer At Heart
Posts: 430
Joined: Mon Apr 06, 2020 1:54 pm

Re: EOS Code Enquiry

Post by fapnip »

IreliaDenial wrote: Tue Sep 28, 2021 3:22 am Ah, I see. Sad to know that image cannot be applied by Eval function
About the best you can do in an eval in Eos is goto a page that has the image you want, like:

Code: Select all

pages.goto('my-image-page')
Or, use OpenEOS, where you can change images via script at runtime.
Post Reply

Who is online

Users browsing this forum: No registered users and 62 guests