Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
roubix
Reel Rookie

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
Roku Guru

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

2 REPLIES 2
necrotek
Roku Guru

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

silentEngineer
Channel Surfer

Re: Wait for animation to finish before proceeding

Jump to solution

can you share your git repository how did u do the animated splash screen and close it.

0 Kudos