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
EOS Code Enquiry
-
- Explorer At Heart
- Posts: 266
- Joined: Thu Jan 03, 2013 4:55 pm
- Gender: Male
- Sexual Orientation: Straight
- I am a: Submissive
Re: EOS Code Enquiry
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
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
-
- Explorer
- Posts: 32
- Joined: Fri Jan 19, 2018 9:02 pm
Re: EOS Code Enquiry
Ah, I see. Sad to know that image cannot be applied by Eval functionThamrill 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
Thank you for the help!
regards,
IreliaDenial
Re: EOS Code Enquiry
About the best you can do in an eval in Eos is goto a page that has the image you want, like:IreliaDenial wrote: ↑Tue Sep 28, 2021 3:22 am Ah, I see. Sad to know that image cannot be applied by Eval function
Code: Select all
pages.goto('my-image-page')
Who is online
Users browsing this forum: No registered users and 106 guests