Transition on text halts at a tap

Hello, I’m trying to display “Speed up!” on screen when the score==50. I also have a touch listener attached to my background to move my character left and right.

Here is my code I’m using to show the text:

function speedup() speedup= display.newText(  "SPEED UP!", centerX, centerY, "Capture\_it", 46 ) sceneGroup:insert(speedup) speedup.xScale=5 speedup.yScale=5 speedup:setFillColor (0.96, 0.78, 0 ) transition.to ( speedup, {time=200,xScale=1,yScale=1} ) transition.to ( speedup,  {delay=200,time=3000,y=screenTop} ) transition.to ( speedup,  {delay=250,time= 800,alpha=0} ) print("TRANSITION COMPLETED") end if score ==50 then if d1==1 then speedup() audio.play(speedSound) end d1=d1+1 end

I have this in scene:create section. It shows up on screen as expected and does the transition it is supposed to but if during the transition I tap on my background to move my character it halts the transition wherever it is and stays their until the game ends.

I have tried to put this code in different portions of the scene but same thing happens

Please help!

Try this…

local function speedup() speedup = display.newText( "SPEED UP!", centerX, centerY, "Capture\_it", 46 ) sceneGroup:insert(speedup) speedup.xScale = 5 speedup.yScale = 5 speedup:setFillColor (0.96, 0.78, 0 ) transition.to( speedup, {time=200,xScale=1,yScale=1} ) transition.to( speedup, {delay=200,time=3000,y=screenTop} ) transition.to( speedup, {delay=250,time= 800,alpha=0} ) print( "TRANSITION COMPLETED" ) end

Isn’t this the same code I posted?

you had a global function i made it local.

oh  yes, I’ve tried it doing that but no worries, anyway I’m leaving this text out for now. Maybe will experiment with it in my next app. Thanks

Well its probably a very simple fix.

nope its not. The problem is not with the text but with the event.listner I’ve spent too much tym on this app . I just wana get it done now

Hey i was thinking and maybe you need to add a 

return true 

 to your function which uses the event listener?

GoodLuck!

Try this…

local function speedup() speedup = display.newText( "SPEED UP!", centerX, centerY, "Capture\_it", 46 ) sceneGroup:insert(speedup) speedup.xScale = 5 speedup.yScale = 5 speedup:setFillColor (0.96, 0.78, 0 ) transition.to( speedup, {time=200,xScale=1,yScale=1} ) transition.to( speedup, {delay=200,time=3000,y=screenTop} ) transition.to( speedup, {delay=250,time= 800,alpha=0} ) print( "TRANSITION COMPLETED" ) end

Isn’t this the same code I posted?

you had a global function i made it local.

oh  yes, I’ve tried it doing that but no worries, anyway I’m leaving this text out for now. Maybe will experiment with it in my next app. Thanks

Well its probably a very simple fix.

nope its not. The problem is not with the text but with the event.listner I’ve spent too much tym on this app . I just wana get it done now

Hey i was thinking and maybe you need to add a 

return true 

 to your function which uses the event listener?

GoodLuck!