alternating panel animations inside a loop
-
22-10-2019 - |
Question
I have two panels animating (blinking on/off) fine as heartbeats. However I want them to alternate beating instead of at the same time. So panel1 beats with a 10 count and then panel2 beats with a 10 count. I then want this to loop so it continues the pattern until the user presses the back key to exit the activity. I tried a few things with no luck. Here is the two panels beating together...
Sub beats
PNL1.Initialize("PNL1")
gdpanel1.Initialize("TOP_BOTTOM", Array As Int(Colors.DarkGray, Colors.Red))
gdpanel1.CornerRadius=0
PNL1.Background=gdpanel1
mainPNL.AddView(PNL1,0,0,100%x,50%y)
SetRadialGradientRed(gdpanel1,PNL1.Height/1.5)
a.InitializeAlpha("a",0,1)
a.Duration = 200
a.RepeatCount = 10
a.Start(PNL1)
PNL2.Initialize("PNL1")
gdpanel2.Initialize("TOP_BOTTOM", Array As Int(Colors.DarkGray, Colors.Blue))
gdpanel2.CornerRadius=0
PNL2.Background=gdpanel2
mainPNL.AddView(PNL2,0,50%y,100%x,50%y)
SetRadialGradientBlue(gdpanel2,PNL2.Height/1.5)
b.InitializeAlpha("b",0,1)
b.Duration = 200
b.RepeatCount = 10
b.Start(PNL2)
End Sub
Sub a_AnimationEnd
'
End Sub
Sub b_AnimationEnd
'
End Sub
Solution
You should start animation b in Sub a_AnimationEnd and start animation a in Sub b_AnimationEnd.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow