How to load videos from one folder to run them in sequence?

How to load videos from one folder to run them in sequence?

Attached is an example of how to do this although apparently it gets jammed every so often (probably something to do with the count). It reads the folder using the folder dat then just checks for the last frame on each movie, we used it to play movies on a tent ceiling at womad festival.
movieexample.toe (4.13 KB)