Sie sind nicht angemeldet.

1

Samstag, 21. September 2013, 11:31

Problem with AS3 plugin

Hi,
I write myfunction

private function testfunction1(...rest):void
{
// trace the given arguments
krpano.trace(1,"testfunction1() called with " + rest.length + " arguments:");
for (var i:int=0; i<rest.length; i++)
krpano.trace(1,"argument" + (i+1) + "=" + rest);

// trace the current viewing direction and fov
krpano.trace(1,"current view:");
krpano.trace(1,"hlookat = " + krpano.view.hlookat);
krpano.trace(1,"vlookat = " + krpano.view.vlookat);
krpano.trace(1,"fov = " + krpano.view.fov);
}


In have include this plugin in my tour.xml. I create a button in my tour. I want when i click to the button, that function will be called.
How would I do?

Beiträge: 1 857

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

2

Samstag, 21. September 2013, 15:58

plugin[pluginname].testfunction1(); or
layer[pluginname].testfunction1();
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

3

Montag, 23. September 2013, 05:32

In tour.xml i write:
<plugin name="myplugin" url="plugins/plugintemplate.swf" keep="true"/>


<action name="startup">
if(startscene === null, copy(startscene,scene[0].name));
loadscene(get(startscene), null, MERGE);
showlog();
plugin[myplugin].testfunction1();
</action>

but when I play vtour, it trace:


INFO: krpano 1.16.6 (build 2013-08-09)
INFO: Flashplayer WIN 11.8.800.170 PlugIn
WARNING: unknown action: plugin[myplugin].testfunction1
INFO: attr4 will be changed from 10 to 10
INFO: hello from plugin[myplugin]

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »kenit2212« (23. September 2013, 05:50)


Beiträge: 1 117

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours : the cms4vr owner

  • Nachricht senden

4

Montag, 23. September 2013, 08:16

Hi

You You call the function before loading the plugin. Try:

<plugin name="myplugin" url="plugins/plugintemplate.swf" keep="true" preload="true"/>
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*

5

Montag, 23. September 2013, 10:01

Thank you very much spacerywirtualne. I sloved *g*

Beiträge: 1 117

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours : the cms4vr owner

  • Nachricht senden

6

Montag, 23. September 2013, 10:38

*thumbup*
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*