Hi All! I’m trying to apply OOP to Corona. Everything is fine until it came to Movie clip.
Rectangle class:
[lua]module (…,package.seeall)
function new ()
imageSeq = {}
local movieclip = require (“movieclip”)
for i=1,13 do
table.insert (imageSeq,“images/fly40x40_”…i…".png")
end
local obj = movieclip.newAnim (imageSeq)
function obj:enterFrame (event)
self.x = self.x + 1
end
function obj:start ()
Runtime:addEventListener (“enterFrame”,self)
self:play {startFrame=2,endFrame=13,loop=0}
end
return obj
end[/lua]
[lua]Rectangle = require (“rectangle”)
— START ----
rect = Rectangle.new ()
rect.x = 100; rect.y = 100
rect:rotate (90)
rect:start ()[/lua]
I suppose the object shifted to the right as well as display some animation. However it only move without any animation at all (instead it display one still image somewhere in the middle of the sequences)
[import]uid: 40631 topic_id: 7807 reply_id: 307807[/import]