Skip to content

Instantly share code, notes, and snippets.

@jenbennings
Last active August 29, 2015 14:07
Show Gist options
  • Save jenbennings/64ff828777cbc21a99ab to your computer and use it in GitHub Desktop.
Save jenbennings/64ff828777cbc21a99ab to your computer and use it in GitHub Desktop.
DragMove
me.on Events.DragMove, ->
dX = Math.abs(avatarBackground.midX - me.midX)
dY = Math.abs(avatarBackground.midY - me.midY)
if dX < 42 && dY < 42
avatarBackground.states.switch("hover")
me.states.switch("hover")
else
me.backgroundColor = "purple"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment