I’ve looked through the G2 docs and can’t find a way to determine the snapshot object when a transition on the snapshot.path fires the onComplete event. Do I have to resort to this sort of unsatisfying stuff: ???
local function SnapDone(snap) local maxlimit = 90 local minlimit = 20 local y3 = -minlimit local y4 = minlimit if snap.y4 \< minlimit+1 then y4 = maxlimit; y3 = -maxlimit end transition.to( snap, { y3=y3, y4=y4, time=2500, delay=1, transition=easing.outExpo, onComplete = SnapDone} ) end local snapshot = display.newSnapshot(200,200) local circle = display.newCircle( 0, 0, 55 ) circle:setStrokeColor(0, 0, 0, 1) circle.strokeWidth = 3 circle:setFillColor(.5, .5, .5, .05) snapshot.group:insert(circle) snapshot.x = 512 snapshot.y = 200 local maxlimit = 90 snapshot.path.y3 = -maxlimit snapshot.path.y4 = maxlimit transition.to( snapshot.path, { y3=-maxlimit, y4=maxlimit, time=2500, delay=2000, transition=easing.outExpo, onComplete = SnapDone} )
I get a ‘userdata’ table in SnapDone when the onComplete fires… how do I get back to the snapshot object?