 
         if updateFrame = (time - I.lastUpdate) >= I.activeAnimation.speed
           I.lastUpdate = time
-          if triggers = I.activeAnimation.triggers?[I.activeAnimation.frames.indexOf(I.currentFrameIndex)]
+          if triggers = I.activeAnimation.triggers?[I.currentFrameIndex]
             triggers.each (event) ->
               self.trigger(event)
 
           advanceFrame()
       else
-        if triggers = I.activeAnimation.triggers?[I.activeAnimation.frames.indexOf(I.currentFrameIndex)]
+        if triggers = I.activeAnimation.triggers?[I.currentFrameIndex]
           triggers.each (event) ->
             self.trigger(event)
 

        }
        frames: [0]
      }]      
    spriteLookup: {}
    activeAnimation:
      name: ""
      complete: ""


    return I.data

  window["#{I.animationName}SpriteLookup"] ||= []

  unless window["#{I.animationName}SpriteLookup"].length
    I.data.tileset.each (spriteData, i) ->
      window["#{I.animationName}SpriteLookup"][i] = Sprite.fromURL(spriteData.src)

  I.spriteLookup = window["#{I.animationName}SpriteLookup"]

  if I.data.animations.first().name != "" 
    I.activeAnimation = I.data.animations.first()

    I.data.tileset.each (spriteData, i) ->
      I.spriteLookup[i] = Sprite.fromURL(spriteData.src) 
  else if I.animationName
    loadByName I.animationName, ->
      I.activeAnimation = I.data.animations.first()

      I.data.tileset.each (spriteData, i) ->
        I.spriteLookup[i] = Sprite.fromURL(spriteData.src)  
