Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
roubix
Level 7

Wait for animation to finish before proceeding

Jump to solution

I have a splash screen with a loading progress bar that shows complete upon API calls successful and dashboard loading complete.  The screen then fades out via opacity animation to display the dashboard.

However, I want to remove the loading screen from the screen stack upon animation complete.  When I try to remove the screen from the stack at the end of that method, the animation doesn't finish because it appears to remove it from the stack too soon.

I've experimented with the sleep() and wait() methods, but without much success.  Has anyone tackled something similar where they needed to call a method after an animation was finished?

0 Kudos
1 Solution

Accepted Solutions
necrotek
Level 11

Re: Wait for animation to finish before proceeding

Jump to solution

 

animation.observefield("state","onAnimationComplete") 

sub onAnimationComplete(event)
if event.getdata()="stopped"
'do stuff
end if
end sub

 

 

https://developer.roku.com/en-gb/docs/references/scenegraph/abstract-nodes/animationbase.md

View solution in original post

1 Reply
necrotek
Level 11

Re: Wait for animation to finish before proceeding

Jump to solution

 

animation.observefield("state","onAnimationComplete") 

sub onAnimationComplete(event)
if event.getdata()="stopped"
'do stuff
end if
end sub

 

 

https://developer.roku.com/en-gb/docs/references/scenegraph/abstract-nodes/animationbase.md

View solution in original post