how do i make an arrow fly off the screen on touch?

hello i was wondering if when my menu screen load i have an arrow for the start button and when i click it it fly’s off the screen and then the startgame.lua starts im stuck and cant get it to work thanks for any  coding help!

use transition.to

http://docs.coronalabs.com/api/library/transition/to.html

then in the onComplete event just use goto to load up the startgame.lua

thank you so so much!!!
 

maybe you can look at my other post?

What other post would that be?

http://forums.coronalabs.com/topic/51586-spawning-objects/#entry267621

its a bit more diffacult

Answered on your other post, enjoy :slight_smile:

function touchPLayBtn(event)

if event.phase == “ended” then

transition.to(playBtn,{time=200, x=200, y=350})

end

end

Runtime:addEventListener(“touch”, touchPLayBtn)

i have that so far and it works now i need it to use On.Complete idk how to can you help?

transition.to(playBtn, {time = 200, x = 200, y = 350, onComplete = function() composer.gotoScene("stargame", {effect = "fade", time=500}) end})

On most of the stuff you are asking for you will find in the documentation and at the bottom of the area in question you will find example code on hose it works etc.

For composer

http://docs.coronalabs.com/api/library/composer/gotoScene.html

For transitions.

http://docs.coronalabs.com/api/library/transition/to.html

Just scroll to bottom and you will see plenty of different types of examples on how to implement these functions :slight_smile:

oh i see thanks for your help and info

hope it help others to :slight_smile:

use transition.to

http://docs.coronalabs.com/api/library/transition/to.html

then in the onComplete event just use goto to load up the startgame.lua

thank you so so much!!!
 

maybe you can look at my other post?

What other post would that be?

http://forums.coronalabs.com/topic/51586-spawning-objects/#entry267621

its a bit more diffacult

Answered on your other post, enjoy :slight_smile:

function touchPLayBtn(event)

if event.phase == “ended” then

transition.to(playBtn,{time=200, x=200, y=350})

end

end

Runtime:addEventListener(“touch”, touchPLayBtn)

i have that so far and it works now i need it to use On.Complete idk how to can you help?

transition.to(playBtn, {time = 200, x = 200, y = 350, onComplete = function() composer.gotoScene("stargame", {effect = "fade", time=500}) end})

On most of the stuff you are asking for you will find in the documentation and at the bottom of the area in question you will find example code on hose it works etc.

For composer

http://docs.coronalabs.com/api/library/composer/gotoScene.html

For transitions.

http://docs.coronalabs.com/api/library/transition/to.html

Just scroll to bottom and you will see plenty of different types of examples on how to implement these functions :slight_smile: