click-able and non click-able objets?

Hello!

Basically I want to know how can I assign some kind of id to every object I create in order to make it movable by mouse or not.
So, to make it simple I want to have two types of objects in my scene: one type that interacts with mouse and one type that remains insensible to my mouse actions.

My ideea was to assign some kind of id = "clickable" at object creation and int the MouseDrag loop, when I press the mouse I check that id and build the mouse joint or not. Only that I have no idea how can I assign that id 🙂

Tnx a lot,
GF
UserData lets you associate what you like with a body.
ok 🙂 but how?

I tried

bb.getUserData["id"] = "clickable";

but throws a bunch of errors when compiled.

Tnx
GF
maybe this?
bb.getUserData().id = "clickable";
yeah.. this works:

bb.getUserData()["id"] = "nonclickable";

this after I define in my SquareMc.as class:

public var id:String;

Tnx a lot,
GF

Original thread: https://box2d.org/forum/viewtopic.php?t=4658