Ok thanks,
but what if I make a different comparison instead of true?
if event.target==goed.g1 or event.target==goed.g2 or event.target==goed.g3 or event.target==goed.g4 or event.target==goed.g5 then
This is the whole piece of code I am using:
[code]
local function MoveWord(event)
local t = event.target
local phase = event.phase
if “began” == phase then
– Make target the top-most object
local parent = t.parent
parent:insert( t )
display.getCurrentStage():setFocus( t )
– Spurious events can be sent to the target, e.g. the user presses
– elsewhere on the screen and then moves the finger over the target.
– To prevent this, we add this flag. Only when it’s true will “move”
– events be sent to the target.
t.isFocus = true
beginX=t.x
beginY=t.y
– Store initial position
t.x0 = event.x - t.x
t.y0 = event.y - t.y
elseif t.isFocus then
if “moved” == phase then
– Make object move (we subtract t.x0,t.y0 so that moves are
– relative to initial grab point, rather than object “snapping”).
t.x = event.x - t.x0
t.y = event.y - t.y0
elseif “ended” == phase or “cancelled” == phase then
if event.target==goed.g1 or event.target==goed.g2 or event.target==goed.g3 or event.target==goed.g4 or event.target==goed.g5 then
if t.x >185 and t.x<320 and t.y >17 and t.y < 170 then
print (“antwoord is goed”)
event.target:removeSelf()
answer=false
end
else
t.x=beginX
t.y=beginY
print(“antwoord is fout”)
– PlayAudioError()
end
display.getCurrentStage():setFocus( nil )
t.isFocus = false
end
end
return true
end
[/code] [import]uid: 100901 topic_id: 36051 reply_id: 143212[/import]