I havent figured out the cause of the bug, im using nested groups and performing transitions on some of the groups nested quite far down. If I use the onComplete on a transition in the group it fires before the transition is completed. [import]uid: 5354 topic_id: 718 reply_id: 300718[/import]
Ok I figured out that passing onComplete=activateButtons(“game”) causes the function to fire immediately
Is there a way to pass values to an oncomplete function when using a transition? [import]uid: 5354 topic_id: 718 reply_id: 1433[/import]
Looks like the onComplete has a parameter “target” (the same one that is passed to the transition and to its onStart. [import]uid: 54 topic_id: 718 reply_id: 1480[/import]
Hi buzzn,
can you please post a short code example about the target?
Michael [import]uid: 5712 topic_id: 718 reply_id: 1487[/import]
Never mind, got it myself:
--\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
-- Function to be fired, once the transition is done
local function complete( target )
--\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
print( "event(complete target="..target.x..":"..target.y)
end
...
...
...
local params = { time=(dist\*3.5), x= event.x, y=event.y, onComplete=complete }
transition.to (sprShoot, params)
[import]uid: 5712 topic_id: 718 reply_id: 1496[/import]
Ah, you beat me to it. Yup, that looks right. [import]uid: 54 topic_id: 718 reply_id: 1500[/import]