   XNA Physics to Actionscript
  I recently finished constructing a mass and spring physics system inside XNA. I used a verlet integrator and it's working just fine.Right now I'm attempting to translate my XNA code into Actionscript which is something I've done a few time before. The only problem is my physics isn't acting the same way in Flash as it did in XNA.The main problem seems to be when I'm trying to satisfy rigid constraints between two masses. I need to loop through this several times to achieve a good constraint with multiple masses, but if I loop through it more than once the masses seemed pulled to the upper left corner by some unknown force.Here is the constraint loop:for (var i:int = 0; i < 100; i++)  { for (var s:int = 0; s < springArray.length; s++) {    var dlta:Point = new Point(massArray[springArray.EndNode].x - massArray[springArray.StartNode].x, massArray[springArray.EndNode].y - massArray[springArray.StartNode].y);    var deltalength:Number = Math.sqrt(dlta.x * dlta.x + dlta.y * dlta.y);    var diff:Number = (deltalength - springArray.RestLength) / deltalength;    massArray[springArray.StartNode].x += (dlta.x * 0.5 * diff);    massArray[springArray.StartNode].y += (dlta.y * 0.5 * diff);    massArray[springArray.EndNode].x -= (dlta.x * 0.5 * diff);    massArray[springArray.EndNode].y -= (dlta.y * 0.5 * diff);    if (massArray[springArray.StartNode].Anchor == true){   massArray[springArray.StartNode].x = massArray[springArray.StartNode].PrevPos.x;massArray[springArray.StartNode].y = massArray[springArray.StartNode].PrevPos.y;}    if (massArray[springArray.EndNode].Anchor == true){   massArray[springArray.EndNode].x = massArray[springArray.EndNode].PrevPos.x;massArray[springArray.EndNode].y = massArray[springArray.EndNode].PrevPos.y;} }  }</pre>This is what this code produces for a string made of 5 springs:http://www.swfcabin.com/open/1245028712Does anyone have any idea what might be the problem?