Hi,
I would like someone to explain to me why the following transition only executes 3 times rather than continuously as intended.
local function moveMeUp(obj) obj.movement = transition.to ( obj, {time = 3000, delta = true, y= -30, onComplete = moveMeDown} ) end local function moveMeDown(obj) obj.movement = transition.to ( obj, {time = 3000, delta = true, y= 30, onComplete = moveMeUp} ) end function scene:enterScene( event ) local group = self.view -- start item movement item.movement = transition.to ( item, {time = 3000, delta = true, y= -30, onComplete = moveMeDown} ) end
I have already overcame this issue by having nested funtions for moveMeUp and MoveMeDown. But cancelling these transitions properly and immediately is proving difficult. So i would like to know why the logic behind the sample above doesn’t work properly (only executes three times) so maybe i can fix it and make hings easier in terms of cancelling the transition.
for your reference here is my workaround:
local function moveMeDown(obj) local function moveMeUp(obj) obj.movement = transition.to ( obj, {time = 3000, delta = true, y= -30, onComplete = moveMeDown} ) end obj.movement = transition.to ( obj, {time = 3000, delta = true, y= 30, onComplete = moveMeUp} ) end
Thanks for your help.
Luay
