Sie sind nicht angemeldet.

1

Freitag, 29. Juli 2016, 13:40

breakall (1.19pr5)

Hi!

I updated my virtual tour to KRpano version 1.19pr5 and now I have the warning message:

Quellcode

1
WARNING: Calling deprecated action: breakall 


Breakall action is still present in the KRpano documentation (Quick Reference webpage: http://krpano.com/docu/quickref/#actions )
...But the webpage for the direct link of this action now unavailable (http://krpano.com/docu/actions/#breakall )

Is this undocumented update for 1.19pr5?
What is the trend?

2

Freitag, 29. Juli 2016, 17:04

i dunno about breakall(), but i have a question about break()...
maybe klaus can answer both here...

one way to make an action run only on a condition is to do it this way:

Quellcode

1
2
3
4
5
6
7
<action name="someaction">
	if(a == b,
		do something
		do something
		do something
	);
</action>


but the other way, using break(), is a bit nicer in my view...

Quellcode

1
2
3
4
5
6
<action name="someaction">
	if(a != b, break());
	do something
	do something
	do something
</action>


sadly this doesnt work reliably in my experience... i get strange behaviour when i use it.
other things stop working, which do not have anything to do with the action where i use the break()

so @klaus: is this second code correct (regarding the use of break) and should work?

Dieser Beitrag wurde bereits 4 mal editiert, zuletzt von »indexofrefraction« (31. Juli 2016, 11:09)


Tuur

Erleuchteter

Beiträge: 3 839

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

4

Samstag, 30. Juli 2016, 17:30

thanks, but thats not what i was talking about ...

what i want is not to use a lot of if/ifnot conditions with indenting all following code.
its more elegant to leave the action, and the following code doesnt have to be in an indented block.
in javascript that would be a simple return.

but till now i don't use break() because it always causes strange behaviours.

Tuur

Erleuchteter

Beiträge: 3 839

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

5

Samstag, 30. Juli 2016, 21:43

yes i know, but your if syntax looked wrong to me so i thought your problem was there.
Btw i don't see much difference in what you want to achieve.

if( condition .. do this
or ifnot(condition .. do this..

with or without a break.

really depends on what you exactly want of course.

Tuur *thumbsup*

6

Sonntag, 31. Juli 2016, 10:53

@tuur: i updated the code above :)

i just wanna know if using if(a != b, break()); at the beginning of an action
is correct like this, because i get strange behaviour with it.

@valentin: sorry for hijacking your thread :)

Dieser Beitrag wurde bereits 4 mal editiert, zuletzt von »indexofrefraction« (31. Juli 2016, 11:11)


7

Sonntag, 31. Juli 2016, 15:30

Well... How to stop the other actions call (non-current action how does break(), not all running actions how does breakall() )?
Maybe something like this:

Quellcode

1
break(my-action);


I'll explain the idea:
I have a long-time running action (tween after tween after tween after tween...) And I want to stop this action at another events.

8

Sonntag, 31. Juli 2016, 19:38

just add checks for a variable in your longtime action like
if(!my_action_stop, .... );

and when you want to stop it:
set(my_action_stop, true);

but maybe you should also read about
asyncloop() and setinterval() / clearinterval()

index

9

Donnerstag, 11. August 2016, 10:24

allowing myself to bump this one, too...

@klaus.. r u sure, there is not some breakall code left in break?
i sometimes got other actions stopped when i used break.

10

Donnerstag, 11. August 2016, 10:47

Hi,

the break() action has two functions:
1. when used inside a for() or loop() loop it's only breaks/stops the loop,
2. when used normally, it breaks the execution of the whole current call.

Internally break() and breakall() have no relation.
Breakall() doesn't stop the current calls, it stops all currently running tweens and delayedcalls.

If possible I would recommend avoiding these both actions, they are make things more complicated then they would need to be.

Best regards,
Klaus