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.

  • "info@totzek.de" started this thread

Posts: 94

Location: Berlin

Occupation: Panoramafotograf

  • Send private message

1

Monday, March 19th 2012, 4:35pm

Solved: flyout hotspot - syntax error?

Hello everybody,

after trying lots of different approaches, i need help:
what i am trying to do seems simple:

- i am using the flyout hotspot example
- i want to add more actions to the same click, which makes the hotspot flying=1

Source code

1
	         onclick="if(flying == 0.0, flyout(), set(plugin[hs-1-text].visible,true), tween(plugin[hs-1-text].alpha,1.0) ); if(flying == 1.0, flyback(), tween(plugin[hs-1-text].alpha,0.0), set(plugin[hs-1-text].visible,false) );"



this doesnt work. --> anybody knows why?
- Jan
Jan Totzek | Panoramafotografie | Berlin
www.panographer.de

This post has been edited 1 times, last edit by "info@totzek.de" (Mar 21st 2012, 7:20pm)


inno

Trainee

Posts: 80

Location: Wyk auf Föhr

  • Send private message

2

Monday, March 19th 2012, 5:16pm

Hi Jan,

without beeing able to reproduce it (due to lack of time) at the first glance I would suspect some trouble regarding the if syntax

if( condition, ifaction(), elseaction())... that is the signature of the if-statement expects 2 commatas... your implementation involves more than 2.
perhaps it may help to collapse yourelse-statements into one single action and call this in the else part (it's also makes things more readable)

Just a guess

Greez
Peter

  • "info@totzek.de" started this thread

Posts: 94

Location: Berlin

Occupation: Panoramafotograf

  • Send private message

3

Monday, March 19th 2012, 6:46pm

will try

Hi Peter,
thanks for the quick answer.

It would be cool to be able to use a bunch of actions from out of the same onclick action, as i this would make things much easier in this case.
Isnt it possible to trigger several actions when using the if condition?
- Jan
Jan Totzek | Panoramafotografie | Berlin
www.panographer.de

4

Monday, March 19th 2012, 7:41pm

Hi,

you can put as many actions in an onclick event and also in a if branch as you want,
but note - an action call ends with ';' - you are trying to use ',' in your example,

e.g.

Source code

1
onclick="dosomething1(); if(test == test2, thenaction1(p1,p2,p3); thenaction2(p1,p2); thenaction3(); , elseaction1(p1,p2); elseaction2(); ); dosomething2();"


you can also put several if inside each other, you only need to be sure that the opening '(' and closing ')' characters are correct and that the ';' is used to end an action and the ',' to set an new parameter when calling an action,

best regards,
Klaus

  • "info@totzek.de" started this thread

Posts: 94

Location: Berlin

Occupation: Panoramafotograf

  • Send private message

5

Wednesday, March 21st 2012, 7:21pm

danke

Hi and thanks!
- used ';' and thats it...
Merci!
Jan Totzek | Panoramafotografie | Berlin
www.panographer.de