button when pressd do and on moved cancle button

hi i am working on a game i need to fire bullets when a button is pressed
i use ui.lua to create my button

i use
[lua] function fireBtn(event)
if event.phase == “press” then
–if event.phase=="moved"then
print(“pressed”)
Runtime:addEventListener( “enterFrame”, spawnBullet )
– end
end[/lua]
to ad an event listener to spawn bullets the problem is if the player moves finger of the button it will execute the bullet spawning
if event.phase == “moved” then… it wont work for me to remove the function
do u have idea what cold be the problem ? and what cold be a solution?
thanx in advance
[import]uid: 169726 topic_id: 31225 reply_id: 331225[/import]