   playFrames: ->
     @playButton.prop 'disabled', true
     @pauseButton.prop 'disabled', false
-    # TODO
+    @advanceFrames()
+
+  advanceFrames: ->
+    @goTo @currentFrame + 1
+    @advanceTimeout = setTimeout @advanceFrames.bind(@), 250
 
   pauseFrames: ->
+    clearTimeout @advanceTimeout
     @playButton.prop 'disabled', false
     @pauseButton.prop 'disabled', true
-    # TODO
 
   setStep: (step) ->
     @step = step

      callback? image

  addToggle: (index) ->
    @togglesList.append "<li><button name='toggle-frame', value='#{index}'>#{index}</button></li>"

  goTo: (@currentFrame) ->
    @currentFrame = mod @currentFrame, @frames.length

    @frames[@currentFrame].toFront()


  img.onload = -> callback? img
  img.src = src

class SubjectViewer extends Controller
  className: 'subject-viewer'
  template: require './templates/subject-viewer'

  currentFrame: 0
  advanceTimeout: NaN

  step: ''
  toolOptions: null
