Dynamic totalFrames value