You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

DorinDXN

Trainee

  • "DorinDXN" started this thread

Posts: 103

Location: Timisoara, Romania

  • Send private message

1

Saturday, October 9th 2010, 9:10pm

About autorotate and javascript

Hi all, I want to implement some autorun in my webpages featuring live panoramas, I noticed that when autorotate begins the javascript isn't executed properly, it looks like the slice of time never or very rae accure for javascript, I can emulate the autorotate with javascript but the pan is not so smooth as with autorotate from krpano.



My question is can be krpano parametrised to let also javascriot ro run from time to time, I guess not but still worth asking.



thanks for any input!

cheers,

Dorin,

www.livepanoramas.com

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

2

Tuesday, October 12th 2010, 4:15pm

Hi Dorin,

First, I think you can do everything you want using javascript....

About your request here and here... If I understand, you want to set an autorotate to your panos (that have the xml embeded)...

I have tried some and it seems that you already use onxmlcomplete and onloadcomplete inside your panos... so, if we set them from javascript, we erase the code you already set...
Then, i have tried using onstart instead (it seems that your are not using it)...
like this:
http://www.livepanoramas.com/event/piram…1,onstart());)&
It seems to work...
I assume that you use 30 frames in each panos: if(files_loaded GE 30,...)

so, I think you can use:

Source code

1
2
3
...
so.addParam("onstart","if(files_loaded GE 30,set(autorotate.enabled,true);,delayedcall(1,onstart());)");
...


or/also a javascript function to set the onstart:

Source code

1
2
3
...
krpano().set(onstart,if(files_loaded GE 30,set(autorotate.enabled,true);,delayedcall(1,onstart());))
...


Hope this help...

You have a singular way to use Krpano *thumbup* ... That's interesting... Congratulation *smile* ...

SAlut

DorinDXN

Trainee

  • "DorinDXN" started this thread

Posts: 103

Location: Timisoara, Romania

  • Send private message

3

Wednesday, October 13th 2010, 9:31am

Thank you Michel useful infos and I'll sudy deeply this way to add events to krpano .swf.

I did managed to start autorotate from javascript, but the problem is once the autorotate starts the javascript isn't executed properly anymore, is true, the rotation is smoothly.

My webpages are based on javascript, for example the parmalink is updated by javascript.

The permalinks aren't updated if the autorotate is enabled and running, so looks like the only way to have both javascript ok and autoroatate working is to autorotate from javascript bit by bit from time to time.

Is not smoothly but is ok.

My problem is how to read from javascript the "files_loaded" variable to start bit by bit rotation in javascript only after the files_loaded is 30



cheers,

Dorin

www.livepanoramas.com

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

4

Thursday, October 14th 2010, 3:46am

Hi Dorin,

Quoted

My question is can be krpano parametrised to let also javascriot ro run from time to time, I guess not but still worth asking.
Here the answer from Klaus: http://www.krpano.com/forum/wbb/index.ph…19496#post19496

SAlut.

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

5

Thursday, October 14th 2010, 4:48am

Hi Dorin,

Perhaps something like this will do:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function is_files_loaded_ready() 
	{
	var krpano = document.getElementById("krpanoSWFObject");
	if (krpano && krpano.get) {
		var files_loaded = krpano.get("files_loaded");
		}
	if (files_loaded >= 30) 
		{
		your rotation things here();
		}
		else
		{
		setTimeout("is_files_loaded_ready()",1000);
		}
	}


Hope this help...

SAlut.

DorinDXN

Trainee

  • "DorinDXN" started this thread

Posts: 103

Location: Timisoara, Romania

  • Send private message

6

Thursday, October 14th 2010, 4:55pm

Thanks Michel, I think now I have all I need to have this working.



best regards,

Dorin

www.livepanoramas.com

DorinDXN

Trainee

  • "DorinDXN" started this thread

Posts: 103

Location: Timisoara, Romania

  • Send private message

7

Thursday, October 14th 2010, 8:43pm


Thanks Michel, I think now I have all I need to have this working.

and it is working here
http://www.livepanoramas.com/event/fibre-pigmenti/
click on round button with arrow for rotate (play)

cheers,
Dorin
www.livepanoramas.com