My code Run but function listener 1 and 2 not run :-(

transition.to( currentBall, { time=500, xScale = 1, yScale = 1, onComplete=listener1 } )

transition.to( currentBall, { time=500,delay=400, xScale = 2.5, yScale = 2.5,onComplete=listener2 } )

local listener1 = function( obj )
print( "Transition 1 completed on object: " … tostring( obj ) )
end

local listener2 = function( obj )
print( "Transition 2 completed on object: " … tostring( obj ) )
end [import]uid: 107779 topic_id: 19159 reply_id: 319159[/import]

try this,

[lua]local listener1 = function( obj )
print( "Transition 1 completed on object: " … tostring( obj ) )
end

local listener2 = function( obj )
print( "Transition 2 completed on object: " … tostring( obj ) )
end

transition.to( currentBall, { time=500, xScale = 1, yScale = 1, onComplete=listener1 } )

transition.to( currentBall, { time=500,delay=400, xScale = 2.5, yScale = 2.5,onComplete=listener2 } )[/lua] [import]uid: 12482 topic_id: 19159 reply_id: 73906[/import]

Hi syedwaseemshah786,

In lua a function needs to be defined before it can be referenced. As hgvyas123 has put in his reply you simply need to swap the order of the functions around and all should be well.

[import]uid: 82631 topic_id: 19159 reply_id: 73910[/import]