Problem with prismatic joints

Hi, I'm currently working on a platformer/puzzle game. What I'm trying to do is add moving platforms that go up & down or left & right. I'm using a prismatic joint for this, and I've managed to make it work. Except, after a while the game starts to lag horribly.

I'm assuming this is because I keep adding a new joint every time I change motor speed. I tried removing the joints after adding a new one but that didn't work out too well. My code:

Code:
addEventListener(Event.ENTER_FRAME, Hover);
         function Hover(event:Event) {
            if (Math.round(floorBody.GetPosition().y) == 10) {
            prismJoint.motorSpeed = 4.0
            var joint_added:b2PrismaticJoint = Hello._world.CreateJoint(prismJoint) as b2PrismaticJoint;
            }

            if (Math.round(floorBody.GetPosition().y) == 15) {
               prismJoint.motorSpeed = -4.0
            var joint_addedd:b2PrismaticJoint = Hello._world.CreateJoint(prismJoint) as b2PrismaticJoint;
               }
            }


Is there a way to change motor speed without having to add a new joint every time? Or, is there a better way altogether to make moving platforms?

Thanks in advance!
http://www.box2dflash.org/docs/2.0.2/re ... peed%28%29
Ah, I had been trying to apply that function to the jointDef rather than the actual Joint! Thanks!

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