Helper function to flick an element