hello,
i would like to know how set up two functions at the end of the onComplete
transition.to(obj, {time=1000, x=100, onComplete= function() myfunction1() end, function() myfunction2() end)}
thanks for your help .
hello,
i would like to know how set up two functions at the end of the onComplete
transition.to(obj, {time=1000, x=100, onComplete= function() myfunction1() end, function() myfunction2() end)}
thanks for your help .
You could always do it the easy way:
local function firstFunc() print("I'm the first function") end local function secondFunc() print("I'm the second function") end local function CompleteFunc(obj) if obj.id == "someObj" then firstFunc() end if obj.num == 1 then secondFunc() end end local someObj = display.newRect(0,0,20,20) someObj.id = "someObj" someObj.num = 1 transition.to(someObj ,{time=500, onComplete=CompleteFunc})
Try this:
transition.to(obj, {time=1000, x=100, onComplete= function() myfunction1(); myfunction2(); end) }
Rob
Thanks you two. Have a good day.
You could always do it the easy way:
local function firstFunc() print("I'm the first function") end local function secondFunc() print("I'm the second function") end local function CompleteFunc(obj) if obj.id == "someObj" then firstFunc() end if obj.num == 1 then secondFunc() end end local someObj = display.newRect(0,0,20,20) someObj.id = "someObj" someObj.num = 1 transition.to(someObj ,{time=500, onComplete=CompleteFunc})
Try this:
transition.to(obj, {time=1000, x=100, onComplete= function() myfunction1(); myfunction2(); end) }
Rob
Thanks you two. Have a good day.