In KLWP: How to trigger an animation from a Flow?

I have a somewhat long-running flow in my KLWP and I was thinking to try and implement a “working” notice over the komponent’s UI while it runs. I thought 1st to use an animation to do something. I had never touch those before…

It seemed that the best animation trigger for me to try was a global switch. So I set one up and quickly realized it has to be a top-level global, not one inside the komponent. Ok, I guess. So I created a top-level global switch called “Working”.

But the flow is within the komponent and setting a global from inside a flow only lets me choose from the globals inside the komponent. Makes sense too. But… (I know there is some way to “link” globals but did not want to go there if I could avoid it - and not sure it would even help).

I decided to try using the intent uri from inside the flow and entered klwp://global/Working/On at the start and klwp://global/Working/Off at the end. This kind-of worked in that I saw the animation start one time and then never again.

I must be doing something wrong. I looked here and this seems quite out of date as the only ReactOn it says is supported is Scroll (and that’s not right).

Any suggestions? Thanks

For a continuous/looping animation you must set “ReactOn” to “Loop” or “Loop with Return” depending on the type of effect you need.

Next to trigger the animation based on the state of the global, you can use a formula on the “ReactOn” field and set its value dynamically.

$if(gv(Working)=On,LOOP_FW,DISABLED)$

Thanks for this. I really have almost no experience with animations. Indeed, I just removed the simple ones (fade out) I had used because fading out turns out to NOT disable touch inputs. I had to migrate to changing visibility based on $si(screen)$.

But actually, I was writing about a long-running Flow, not an animation. Cheers