|
|
Quellcode |
1 2 3 4 |
btn.onclick = function() {
krpano.actions.trace(55); //working
krpano.actions.test(); //no working
};
|
|
|
Quellcode |
1 2 3 |
<action name="test"> trace(22); </action> |
Benutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
<action autorun="onstart" type="Javascript">
<![CDATA[
krpano.test = function test(t){
krpano.actions.showlog();
krpano.trace(1, t);
}
]]>
</action>
<action name="showpano" type="Javascript"><![CDATA[
var b = krpano.addlayer("btn");
b.type = "text";
b.keep = "true";
b.align = "bottom";
b.html = "Click Me";
b.css = "font-family:Helvetica;font-size:14px;";
b.padding = "10";
b.onclick = "test(55)";
]]></action>
|
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<action name="showpano" type="Javascript"><![CDATA[
var b = krpano.addlayer("btn");
b.type = "text";
b.keep = "true";
b.align = "bottom";
b.html = "Click Me";
b.css = "font-family:Helvetica;font-size:14px;";
b.padding = "10";
b.onclick = function(){ krpano.call("test(52);"); }
]]></action>
<action name="test">
showlog(true,top);
trace(%1);
</action>
|
: https://pame.virtualtuur.comBenutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
: https://pame.virtualtuur.com|
|
Quellcode |
1 2 3 4 5 6 7 8 |
<action autorun="onstart" type="Javascript">
<![CDATA[
krpano.action_test3 = function test(t){
krpano.actions.showlog();
krpano.trace(1,t);
}
]]>
</action>
|
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »San7« (29. Dezember 2021, 17:51)
Benutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
: https://pame.virtualtuur.com|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 |
<hotspot ... onclick="action_test3(88)" />
<action autorun="onstart" type="Javascript" ><![CDATA[
krpano.action_test3 = function test(t){
krpano.actions.showlog();
krpano.trace(1,t);
krpano.call("test();");
}]]>
</action>
|
Dieser Beitrag wurde bereits 5 mal editiert, zuletzt von »San7« (30. Dezember 2021, 05:35)
in your test get the main viewer and trace to it
in your test get the main viewer and trace to it
![]()
Quellcode
1 2 3var krpano1 = document.getElementById('krpanoSWFObject'); krpano1 = krpano1.get('global'); krpano1.trace(1,'hello world');
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
//This is the xml of new krpano layer
//...
<layer name="testing_layer"
onclick="test_from_layer();"
align="righttop" keep="true" type="text" html="Action for New Krpano Layer"
/>
<action name="test_from_layer">
showlog();
trace('hola');
testing();
</action>
<action name="testing" type="Javascript">
<![CDATA[
var krpano1 = document.getElementById('krpanoSWFObject');
krpano1 = krpano1.get('global');
krpano1.call("showlog();");
krpano1.trace(1,'testing..');
krpano1.call("lookto(90,0,100);");
//All of above it works ok
//But this does not work:
krpano1.call("more_actions");
]]>
</action>
<action name="more_actions">
krpano.call("lookto(90,0,100);wait(2);lookto(120,0,100);");
// or separately... :
//lookto(90,0,100);
//wait(2);
//lookto(120,0,100);
</action>
|
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
<krpano debugmode="true">
//a- This is the Main
<preview type="grid(cube,100,100,600,0x6688CC,0x000000,0x999999);" />
//b- Text or button for run actions:
<layer name="actions_from_main"
onclick="actions_from_main();"
align="righttop"
keep="true"
type="text"
html="Action from Main To New Krpano Layer"
/>
//c- Action of text for new krpano layer
<action name="actions_from_main">
layer[newkrpanolayer].krpano.call("lookto(90,0,100);wait(1);lookto(175,0,100);showlog();trace('actions send from main to new krpano layer');");
</action>
//d- Code for making the new krpano layer:
<layer name="newkrpanolayer"
keep="true"
width="500"
height="500"
type="krpano"
onloaded="krpano.actions.loadpano('%VIEWER%/otherpanos/tour.xml');"
/>
</krpano>
|
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
<krpano debugmode="true">
//a- This is a new krapano layer
<preview type="grid(cube,200,200,600,0x6688CC,0x4466AA,0x999999);" />
//b- Text or button for run actions:
<layer name="actions_from_new_krpano_layer" align="righttop" keep="true" type="text" html="Action From New Krpano Layer To Main"
onclick="actions_from_new_krpano_layer();"
/>
//c- Action of text for Main:
<action name="actions_from_new_krpano_layer" type="Javascript"><![CDATA[
var krpano1 = document.getElementById('krpanoSWFObject');
krpano1 = krpano1.get('global');
krpano1.call("showlog();lookto(90,0,100);trace('actions send from main to new krpano layer');wait(2);lookto(120,0,100);");
]]>
</action>
</krpano>
|
Dieser Beitrag wurde bereits 4 mal editiert, zuletzt von »Fernando« (1. Januar 2022, 04:01) aus folgendem Grund: solved for me. Showing the solution. Erasing previous questions not to confuse.