You are not logged in.

Fernando

Intermediate

  • "Fernando" started this thread

Posts: 330

Location: Habana, Cuba

Occupation: Architect, Photographer.

  • Send private message

1

Monday, August 17th 2020, 4:14am

[solved] Help: popup with parameters

Hi, please, What is wrong in this code?

<action name="mycode">
popup('iframe', 'index.html?starscene=scene4&startactions=trace('hello')', 800, 600, false);
</action>

Thanks!

Note: without startactions=trace('hello') works fine.

This post has been edited 2 times, last edit by "Fernando" (Aug 17th 2020, 4:46pm) with the following reason: solved by Tuur


Tuur

Sage

Posts: 3,839

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

2

Monday, August 17th 2020, 12:37pm

without startactions=trace('hello') works fine.


did you try without the single apostrophes?

Tuur *thumbsup*

Fernando

Intermediate

  • "Fernando" started this thread

Posts: 330

Location: Habana, Cuba

Occupation: Architect, Photographer.

  • Send private message

3

Monday, August 17th 2020, 2:10pm

Thanks Tuur, this code fail with any command, as the "&" char is not possible.

This action works fine:
<action name="mycode">
popup('iframe', 'index.html?startactions=trace('hello')', 800, 600, false);
</action>

but this not:

<action name="mycode">
popup('iframe', 'index.html?starscene=scene4&startactions=trace('hello')', 800, 600, false);
</action>

Tuur

Sage

Posts: 3,839

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

4

Monday, August 17th 2020, 2:25pm

Hi,

it is a bit different

see here:

startscene only: https://www.virtualtuur.com/krpano/120/t…rtscene=scene_2

+ startactions call (which is a name of a custom action called startactions.. value set to something else then null..
https://www.virtualtuur.com/krpano/120/t…&startactions=2

Source code

1
2
3
4
<action name="startactions">
		showlog();
		trace('hello');
	</action>


obviously you need this action also to be there:

Source code

1
2
3
4
5
6
	<!-- startup action - load the first scene -->
	<action name="startup" autorun="onstart">
		if(startscene === null OR !scene[get(startscene)], copy(startscene,scene[0].name); );
		loadscene(get(startscene), null, MERGE);
		if(startactions !== null, startactions() );
	</action>


or specify action in url like:
https://www.virtualtuur.com/krpano/120/t…;trace(koekoe););

or

https://www.virtualtuur.com/krpano/120/t…noutbounce,4));))


and in an iframe:
https://www.virtualtuur.com/krpano/120/tests/startactions/2/
click the blue button.

make sure you use & a m p ; (without the spaces)


Hope it helps,
Tuur *thumbsup*

This post has been edited 1 times, last edit by "Tuur" (Aug 17th 2020, 3:21pm)


Fernando

Intermediate

  • "Fernando" started this thread

Posts: 330

Location: Habana, Cuba

Occupation: Architect, Photographer.

  • Send private message

5

Monday, August 17th 2020, 4:51pm

Thanks very much Tuur!!! *thumbsup*
&amp; instead &
works fine!