Same problem as Denis above. I can’t seem to get the samples to work. I’m getting the same error:
attempt to index global ‘movieclip’ (a nil value)
In my own code, I experience the same error:
imageTable = {}
for i = 1,9 do
table.insert( imageTable, "animation\_000" .. i .. ".png" )
end
MyAnim = movieclip.MyAnim( imageTable )
MyAnim.x = 100; -- position the instance at 100x
MyAnim.y = 100; -- position the instance at 100y
MyAnim.play(); -- play the animation
Gives me an attempt to index global ‘movieclip’ (a nil value)
error [import]uid: 40285 topic_id: 5906 reply_id: 30414[/import]
I’ve got the same issue but there’s a strange way on how I managed to solve it. I did add the
local movieclip = require(“movieclip”)
line at the top. “movieclip.lua” was in the same directory as well and I created table of animation images exactly like in the movieclip example and got the:
attempt to index global ‘movieclip’ (a nil value)
This is how I solved it. I copied and pasted the MovieClip main.lua file into the directory of the app I was working on and then deleted all of the lines of code for the ui buttons… basically I deleted everything except the ‘require’ line and the call to the newAnim method and replaced the cube.png with the graphics I was using and it worked. I even compared it to the code I manually typed before, that didn’t worked, to see where I slipped if… If I misspelled something but there were no differences. I have no idea why it doesn’t work when I manually typed it and why it does when I copy and paste but it does and that’s how I’ve been working with it. [import]uid: 6035 topic_id: 5906 reply_id: 69847[/import]