first, just because i used 22 frames in my example does not mean that you are limited to that... the Blade runner table uses over 325 i think... just consider the file size after you load up a bunch of images. use as small as possible images, and use the webp format.
1. if you want to disable it, then just call this line in a sub somewhere:
TrustPostTimer.Enabled = 0 ' Disable the timer to stop the animation
and if you want to hide the flasher then call this line:
TrustPostFlasher.visible = False
Personally i would stop a timer anytime it is not being used.
2. If you want to stop it after 1 cycle and then hide it, here is you modified code:
Dim FramePos, Frames
' 22 frames (0 to 21) 0.06 seconds each
Frames = Array("TronBIT_00", "TronBIT_01", "TronBIT_02", "TronBIT_03", "TronBIT_04", "TronBIT_05", "TronBIT_06", "TronBIT_07", "TronBIT_08", "TronBIT_09", "TronBIT_10", "TronBIT_11", "TronBIT_12", "TronBIT_13", "TronBIT_14", "TronBIT_15", "TronBIT_16", "TronBIT_17", "TronBIT_18", "TronBIT_19", "TronBIT_20", "TronBIT_21")
Sub StartTrustPostFlasher
TrustPostFlasher.visible = True ' make it show on the playfield
FramePos = 0 ' set value to 0 in the Array
TrustPostTimer.Enabled = 1 ' enable the timer to control animation speed
End Sub
Sub TrustPostTimer_timer ' timer to control animation speed
TrustPostFlasher.ImageA = Frames(FramePos)
FramePos = (FramePos + 1)
MOD 22
' Check if the animation has reached the end of the array
If FramePos = 0 Then
TrustPostTimer.Enabled = 0 ' Disable the timer to stop the animation
TrustPostFlasher.visible = False ' Optionally, hide the flasher when the animation stops
End If
End Sub
Edited by Fusionwerks, 09 March 2024 - 11:35 PM.