Sie sind nicht angemeldet.

1

Montag, 25. Oktober 2010, 14:57

Timer

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.

2

Montag, 25. Oktober 2010, 15:40

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.

3

Montag, 25. Oktober 2010, 15:41

Hi! see this

timerset(); - http://krpano.com/docu/actions/#timerset
delayedcall(); - http://krpano.com/docu/actions/#delayedcall
and random value already have - http://krpano.com/docu/quickref/
findout random

Regards!

You just need to see documentation and examples....
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

4

Montag, 25. Oktober 2010, 16:02

Thanks a lot guys
For the random, I already read the regarding posts.
I will take a look at the others

5

Montag, 25. Oktober 2010, 16:48

Sorry but the delayCall which seem to be the most accurate function doesn't work with random
Here is my code :

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
<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

Quellcode

1
2
3
4
5
6
7
8
9
10
11
<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

6

Montag, 25. Oktober 2010, 17:36


Sorry but the delayCall which seem to be the most accurate function doesn't work with random
...
What is going on ?


try changing

Quellcode

1
  	delayedcall(randomvalue, action(playS1); );
to

Quellcode

1
  	delayedcall(get(randomvalue), action(playS1); );


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

7

Montag, 25. Oktober 2010, 18:28

Thanks a lot, it's working now

Ähnliche Themen