I did a Test project with my script. Maybe you guys can use it and/or improve it more...
http://cl.ly/3m1T1b0c0J1UEvery Item needs a Value called FRAMES which is the same amount of Frames inside the whole animation on that item (at least 2. One for inactive state, one for active state).
Example:when you want to have an animated Item with 10 frames, you set that value to 20. Also inside the animation you have the first 10 frames displaying the inactive images and the second 10 the active ones.
Include the script from the project as a definition script.
Hmm why do you need so many frames playing the same thing?
Simplest solution is 2 frames. 1 for active & 1 for inactive. Inside the first frame (inactive) you create an execute a script action to set the first & last frame of the animation to 1. I don't see the need for having a value.
-- set animation of currently held item to active frame (2)
ActiveAnimations[game.UsedItem:getName()].AnimationFirstFrame = 2
ActiveAnimations[game.UsedItem:getName()].AnimationLastFrame = 2
You would add that into a on mouse over action part. Resetting the animation is irrelevant as it will automatically reset back to default when you unload it. Well in the case of dragged items anyway. You could always query inside of the animation frames if item is held or not to control which frames should be shown.
Alternatively you could even setup a Lua table system in conjunction with the mouse event handler & have that listen for when an item is held & when it is currently over an object / character / item interaction polygon.
Lots of methods.
P.S: I've not read the entire thread, so what I've written is based on the initial few posts & the final page.