onFrameAdvance callback