RodM Member Licensed User Feb 19, 2024 #1 Hello all! My app has a label that runs a SetColorAnimated during 45 seconds. I need to stop that animation imediatelly and reset the label color, when an specific event occurs, (eg. click on a button). When I just reset the original color, just after that, the animation continues running until its preset timer ends. Is there any way in B4A to stop a running animation immediatelly before its preset time ends? Thanks in advance.
Hello all! My app has a label that runs a SetColorAnimated during 45 seconds. I need to stop that animation imediatelly and reset the label color, when an specific event occurs, (eg. click on a button). When I just reset the original color, just after that, the animation continues running until its preset timer ends. Is there any way in B4A to stop a running animation immediatelly before its preset time ends? Thanks in advance.
mangojack Expert Licensed User Longtime User Feb 19, 2024 #2 This worked for me ... Clicking the Button immediately stopped the animation . Code: Copy Label1.SetColorAnimated(45000, Colors.White, Colors.Red) Private Sub Button1_Click Label1.Color = Colors.White 'Or 'Label1.SetColorAnimated(0, Colors.Red, Colors.White) End Sub If you still have troubles you might want to show some of your code. Last edited: Feb 19, 2024 Upvote 0
This worked for me ... Clicking the Button immediately stopped the animation . Code: Copy Label1.SetColorAnimated(45000, Colors.White, Colors.Red) Private Sub Button1_Click Label1.Color = Colors.White 'Or 'Label1.SetColorAnimated(0, Colors.Red, Colors.White) End Sub If you still have troubles you might want to show some of your code.
RodM Member Licensed User Feb 19, 2024 #3 mangojack said: This worked for me ... Clicking the Button immediately stopped the animation . Code: Copy Label1.SetColorAnimated(45000, Colors.White, Colors.Red) Private Sub Button1_Click Label1.Color = Colors.White 'Or 'Label1.SetColorAnimated(0, Colors.Red, Colors.White) End Sub If you still have troubles you might want to show some of your code. Click to expand... RodM said: When I just reset the original color, just after that, the animation continues running until its preset timer ends. Click to expand... Thanks for your answer but, as I said, I did exactly what you suggest but the animation doesn't stop. Changing the color is not enough. In my case, the label is transitioning between its color to transparent (fading out). I'll post the code later, thank you. Upvote 0
mangojack said: This worked for me ... Clicking the Button immediately stopped the animation . Code: Copy Label1.SetColorAnimated(45000, Colors.White, Colors.Red) Private Sub Button1_Click Label1.Color = Colors.White 'Or 'Label1.SetColorAnimated(0, Colors.Red, Colors.White) End Sub If you still have troubles you might want to show some of your code. Click to expand... RodM said: When I just reset the original color, just after that, the animation continues running until its preset timer ends. Click to expand... Thanks for your answer but, as I said, I did exactly what you suggest but the animation doesn't stop. Changing the color is not enough. In my case, the label is transitioning between its color to transparent (fading out). I'll post the code later, thank you.
RodM Member Licensed User Feb 19, 2024 #4 mangojack said: Label1.SetColorAnimated(0, Colors.Red, Colors.White) Click to expand... Your second suggestion worked for me. Thank you! Upvote 0
mangojack said: Label1.SetColorAnimated(0, Colors.Red, Colors.White) Click to expand... Your second suggestion worked for me. Thank you!