You are not logged in.

nosferatu

Trainee

  • "nosferatu" started this thread

Posts: 80

Location: Ukraine

  • Send private message

1

Sunday, October 19th 2014, 12:22pm

Bug or feature. loop and oninterrupt

I want to interrupt the loop event click mouse.
interrupt running in HTML5, but does not work in FLASH.
krpano 1.17.5

Source code

1
2
3
4
5
loop(hovering,
  oninterrupt(break); 
  wait(0);
  set(layer[test].visible, true);
);

2

Monday, October 20th 2014, 9:26am

Hi,

what are you trying to do?

That current code can't work - the loop() action is 'synchronous' - that means the code will loop as long as the given condition is set, but during that loop nothing from 'outside' can happen, so the hovering value can never change. The additional oninterrupt+wait and are looking a bit strange...

There exists probably a better and more correct solution for your case ;-).

Best regards,
Klaus

nosferatu

Trainee

  • "nosferatu" started this thread

Posts: 80

Location: Ukraine

  • Send private message

3

Monday, October 20th 2014, 10:07am

Hi Klaus! )
This realization of tooltips.
While the cursor is over the layer - layer[hint].visible, true
At this time, "loop" is blocking the code - layer[hint].visible, false
Once the cursor fled (hovering=false), running - layer[hint].visible, false
But I want to be able to interrupt the "loop" by clicking.
All code runs through "onover".

Source code

1
2
3
4
5
6
7
loop(hovering,
  oninterrupt(break); 
  wait(0);
  set(layer[hint].visible, true);
);
		
set(layer[hint].visible, false);

4

Monday, October 20th 2014, 10:24am

Hi,

why not using the included tooltips example as reference?

And why setting visible constantly to true during the loop?
Normally once would be enough...

How is 'interrupting by click' during the hovering meant?

Maybe have a look at the asyncloop action:
http://krpano.com/docu/actions/#asyncloop

There you could do something like that:

Source code

1
onover="#1; asyncloop(hovering, #2, #3);"

where:
#1 = the code that should be called when the hovering starts
#2 = the code that should be called during the hovering every frame
#3 = the code that should be called when the hovering ends

Best regards,
Klaus

nosferatu

Trainee

  • "nosferatu" started this thread

Posts: 80

Location: Ukraine

  • Send private message

5

Monday, October 20th 2014, 10:42am

Klaus, thank you very much for your help! *smile*
"asyncloop" *doneactions - This is what I need.
I have a not trivial task, so needs its own implementation "tooltips"
By the way "doneactions" emerged recently seems, had not seen this feature.

6

Monday, October 20th 2014, 12:01pm

By the way "doneactions" emerged recently seems, had not seen this feature.
That depends how you define 'recently' - this was added in version 1.16 ;-)