Help me change the Car speed...

How can I do a simple thing like changing the speed of the engine in the belt-vehicle in the "PhysTest/Example".

I have tried somehow referencing the "Car" in TestExample.as but I don't have a clue how to do it!
I just think it would be cool to make the up/down keys change and eventually reverse the litte "tank"
Please help me - I am pulling my hair out here 🙂

Thanks in advance
You could set the motorSpeed on the b2RevoluteJoint on the car. Either that or just ApplyTorque directly. There have been some other posts on here about doing stuff with cars if you search too.
Ok - I have figured out that the car has an engine and that its speed can be changed - but how can I reference it?
What is the instance name of that particular joint you talk about - and how do I set its speed?
Something like: ???.motorSpeed = -22;
How can I apply torque directly - and what is the advantage of that? - Not having an engine and just applying torque when the correct key is pressed?
Can you give me an example of how to implement this...

Thanks for you time 🙂

(I haven't been fortunate enough to find anything in my searches...)
There's no real advantage to setting torque directly, it's just a different way of doing it. I don't remember what the instance of that specific joint is called, but you can find it easily. The different parts are commented like "car body", etc... and you just look for the b2RevoluteJoint of the wheel. You have the right idea with setting the speed, but you will want to set the torque too. There are at least two other posts if you search for "car", and at least one of them relates specifically to AS3.

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