Thank ASWC and Dialectric for your quick answer.
I still i've not see the ASWC, but i will by finishing this post, i just wanted post first.
Dialectric i've seen the other samples and basicly the thing is (or what i understand) to add new object of the MC with the skin through the "userData" to the b2BodyDef object. And then in the update function every change applied to the object must be applied to the skin too.
Code:
//adding the skin wheel to the object
bodyDef.userData = new wheel();
bodyDef.userData.width = 10 * .25 * 30;
bodyDef.userData.height = 10 * .25 * 30;
body = world.CreateBody(bodyDef);
in the update function:
Code:
//apply the changes to every skin of every object
for (var bb:b2Body = world.m_bodyList; bb; bb = bb.m_next) {
if (bb.m_userData is Sprite ) {
bb.m_userData.x = bb.GetPosition().x * pixels_in_a_meter;
bb.m_userData.y = bb.GetPosition().y * pixels_in_a_meter;
bb.m_userData.rotation = bb.GetAngle() * (180 / Math.PI);
}
}
If u see something missing please help, for now i will see the ASWC tutorial then ill tell what was my problem, i hope it solves.