Sie sind nicht angemeldet.

1

Donnerstag, 19. März 2015, 09:14

Change an image on a layer with random

Hi,

In my scene I have a layer. The layer is an image and has a OnClick on it.

I'd like to change the image by random with his link each 3 secondes for example.

Is there a way to do this ?

Thanks for your help and feed back. ;-)

herrpedro

Fortgeschrittener

Beiträge: 210

Wohnort: Lisbon

Beruf: Programmer/analyst

  • Nachricht senden

2

Donnerstag, 19. März 2015, 22:03

hi...
http://krpano.com/docu/actions/#random


catch the even "on loaded" or "onready" to call an action for the first time

you have to build and array of images (check the array of thumbs in krpano virtual tour example)
Array in AS3


then all you need is to write and action, and the action call itself 3 seconds later

http://krpano.com/docu/actions/#delayedcall


http://krpano.com/docu/xml/#layer
with that just change
layer[yourlayer].url = new_image_url
and
layer[yourlayer].onclick = something_to_do

3

Montag, 23. März 2015, 15:10

Hi herrpedro,

Thanks for your feedback. Really useful. ;-)