Is this the correct approach in terms of the code to keep calling to change animations? That is, I don't really understand how the "AnimationState" code works, but continuing to make this call won't have memory issues? for example is there any clean up functions I should be calling to remove the previous states I've passed?
[code]state:setAnimationByName(0, animationName, true)[/code]
Also assuming that your gameloop should look like this?
local lastTime = 0
Runtime:addEventListener("enterFrame", function (event)
---
Compute time in seconds since last frame.
local timescale = 1.0
local currentTime = event.time / 1000 * timescale
local delta = currentTime - lastTime
lastTime = currentTime
skeleton.group.x = parentGroup.x
skeleton.group.y = parentGroup.y
state:update(delta)
state:apply(skeleton)
skeleton:updateWorldTransform()
end)