Draggable images with hittest

Hi there,

I have 8 different images that I’m drawing on the screen that I want to be able to drag. I do not want physics, they should be able to be dragged over each other freely. I want to be able to hit test any of these images against static images on the screen while dragging. I have setup draggable movie clips, but since these don’t have a contentBounds property (like image objects), I will have to calculate for hits manually. Has anyone else done something similar? I’m wondering if there is a better solution.

Thanks,
Jay [import]uid: 89562 topic_id: 18918 reply_id: 318918[/import]

you can use this function for emulated physics : http://developer.anscamobile.com/code/flashs-hittestobject-emulated-using-contentbounds

or use actual physics, just declare your objects like that:
physics.addBody(obj, {isSensor=true})

this way object will recieve collisions, but will not respond to them [import]uid: 16142 topic_id: 18918 reply_id: 72894[/import]

Thanks for the quick response!

I was looking at that first link, but that works for images with the “contentBounds” property - I use movieclips because the “setDrag” method makes it easy to implement a drag for multiple objects.

I’ll try the physics method, but I worry about how optimal that will be.

[import]uid: 89562 topic_id: 18918 reply_id: 72896[/import]