I would like to know if there is a way to use a timer in krpano ?
I want for example to play a sound (with the current plugin) after X second where X would be a random value.
Is it something already developed or do I need to build an SWF plugin for that.
Thanks for your reply.
-
-
there is nothing like that available now. but if you know xml well you could use the math operations to generate a random number I know that can be done, then you could insert that into a delaycall() action.
-
Hi! see this
timerset(); - https://krpano.com/docu/actions/#timerset
delayedcall(); - https://krpano.com/docu/actions/#delayedcall
and random value already have - https://krpano.com/docu/quickref/
findout randomRegards!
You just need to see documentation and examples....
-
Thanks a lot guys
For the random, I already read the regarding posts.
I will take a look at the others -
Sorry but the delayCall which seem to be the most accurate function doesn't work with random
Here is my code :Code
Display More<action name="random"> mul(randomvalue, random, 10); roundval(randomvalue,0); showlog(); trace('randomvalue=', randomvalue); delayedcall(randomvalue, action(playS1); ); trace('randomvalue=', randomvalue); </action> <action name="playS1"> playsound(s1,sounds/s1.mp3,1); </action>
Whatever the random value is the sound starts immediately.Whereas this code works
Code
Display More<action name="random"> mul(randomvalue, random, 10); roundval(randomvalue,0); showlog(); trace('randomvalue=', randomvalue); delayedcall(8, action(playS1); ); </action> <action name="playS1"> playsound(s1,sounds/s1.mp3,1); </action>
What is going on ?
Thanks -
Sorry but the delayCall which seem to be the most accurate function doesn't work with random
...
What is going on ?try changing
to
Without the get() you're passing the string value "randomvalue" as the first argument of delayedcall. get() will pass the value of the variable randomvalue.
hope this helps
steve
-
Thanks a lot, it's working now
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!