Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

1

Donnerstag, 12. November 2009, 17:46

JavaScript and onLoadComplete

Hi,

I'm calling pano files via Javascript.

root.call("loadpano(base.xml,sphere=folder/images.jpeg+".jpg,MERGE,blend(1));");

Can I somehow call a custom function 'onLoadComplete'?

Many thanks,
Michael

2

Donnerstag, 12. November 2009, 18:00

Hi Michael,

First, I think your code above has some syntax error:
root.call("loadpano(base.xml,sphere=folder/images.jpeg+".jpg,MERGE,blend(1));");
Would be:
root.call("loadpano(base.xml,sphere=folder/images.jpeg,MERGE,blend(1));");
No?

About your request, I think it can be done like this:

Quellcode

1
root.call("loadpano(base.xml,sphere=folder/images.jpeg&events.onLoadComplete=SometingToDo(),MERGE,blend(1));");

I have not tried... but I thing it would be correct.

SAlut.

3

Donnerstag, 12. November 2009, 18:18

Hi Michel. Thanks for pointing the syntax error. The onLoadComplete call did not work.

4

Donnerstag, 12. November 2009, 19:08

Hi,

Zitat

The onLoadComplete call did not work
Strange... I have not tried to set events.onLoadComplete via Javascript... But I have tried as a variable passed in a url and it worked.... like this:
http://andorra360.com/panos/08/pal/krpano.swf?xml=pal.xml&events.onLoadComplete=moveto(300,15)

Is there a events.onLoadComplete defined into your base.xml file ? If so, perhaps the one in the xml erase the one set via Javascript... *whistling*
Also, try using onxmlcomplete instead of onloadcomplete...

Tell me please.. ;-)

Can you post a link to see ?

SAlut.

5

Freitag, 13. November 2009, 13:06

Hi.

You can see a sample at the following address:
http://www.virtualvisit-northernireland.…2.html#merchant


On load you will see I'm trying to call a simple function called "loaded" with an alert.

Any ideas?

Michael

6

Freitag, 13. November 2009, 13:50

Hi,

I think the problem is in those lines:

Quellcode

1
root.call("loadpano(base.xml,sphere="+location_section+"/"+jpeg+".jpg&event.onLoadComplete=loaded(),MERGE,blend(1));");

Try this:
event.onLoadComplete=js(loaded())

Quellcode

1
root.call("loadpano(base.xml,sphere="+location_section+"/"+jpeg+".jpg&event.onLoadComplete=js(loaded()),MERGE,blend(1));");


SAlut,

7

Freitag, 13. November 2009, 14:13

Hi,

Also, event ---> events ....

Quellcode

1
root.call("loadpano(base.xml,sphere="+location_section+"/"+jpeg+".jpg&events.onLoadComplete=js(loaded()),MERGE,blend(1));");


edited: reference: <events>

SAlut.

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »michel« (13. November 2009, 14:23)


8

Freitag, 13. November 2009, 16:23

Hi,

OK... you are using krpano 1.0.7.... events onloadcomplete come from 1.0.8 beta 6 !!!

Download it here: krpano 1.0.8 beta (Flash10, QTVR, Zoomify, Partials Panos, ...)

SAlut.