I search the forum and found several example of how to pass variable/param to a function, however, none of them work for my situation. What I want to do is to pass, a variable to each one of these functions. Please see below. Iam trying pass a value for a, b, c, d, e, f which will then change the x and y value for each functions.
local function ballAni(a)
local animUp4 = function(b)
ballTween = transition.to(frog, { time=2000, x=b, onComplete=hidepath})
end
local animUp3 = function(c)
ballTween = transition.to(frog, { time=2000, y=c,onComplete=animUp4})
end
local animUp2 = function(d)
ballTween = transition.to(frog, { time=2000, x=d, onComplete=animUp3})
end
local animUp = function(e)
ballTween = transition.to(frog, { time=2000,y=e,onComplete=animUp2})
end
ballTween = transition.to( frog, { time=2000, x=a,onComplete=animUp})
end
end
---I want to try to change the value of x and y for the different functions so I tried this and none of it works.
up=ballAni() --
up.animUP(100) -- e would be 100 in the animuP function thus y=100
up.animuP2(200) -- d would be 200 in the aniUmp2 function thus x=200
– Is there a way to do this? --Thank you for the help
[import]uid: 104131 topic_id: 33869 reply_id: 333869[/import]