I am struggling to get the PlayAnim() command working with Async, here is my code snippet:
Code: Select all
assumptions:
googleads[8][0] = 160
googleads[8][1] = 600
frames[0] = 5
#ANIMBRUSH is a previously created brush containing frames[0] frames
ExitOnError(False)
SelectDisplay(#PREVIEWWINDOW)
EndDoubleBuffer()
debugprint("number of frames to capture: " .. frames[0])
CreateAnim(1, #ANIMBRUSH, googleads[8][0], googleads[8][1], frames[0], frames[0])
Local obj
obj = PlayAnim(1,0,0, {Async = True, Speed = #SLOWSPEED})
Local framecount
framecount = GetAttribute(#ASYNCDRAW, obj, #ATTRNUMFRAMES)
debugprint("no of frames identified via async: " .. framecount)
For Local f = 0 to framecount
debugprint("here")
AsyncDrawFrame(obj, f)
VWait()
Next
FinishAsyncDraw(obj)
FreeAnim(1)
ExitOnError(True)
BeginDoubleBuffer()
animplaying = False
SelectDisplay(#MAINWINDOW)