Spawn actor when moving finger

Right now on my game I have it so when there is a touch inside an actor, every 0.06 seconds it spawns the actor at the position of the touch and this results in lots of pointless actors stacked on top of each other. Can someone tell me how I can spawn the actor only if my touch position is moving (ie something like storing a variable OldX and OldY and then comparing it with the current touch position). I basically want to get rid of the timer.