function precisecollision(colobj1,colobj2,step):boolean { if(colobj1.hittestobject(colobj2)==true) { //trace("checking collisions"); for (i=colobj1.x;i<(colobj1.x+colobj1.width);i +=step) { for (j=colobj2.y;j<(colobj2.y+colobj2.height);j+=step) { nrofpixels +=1; //trace("x"+i +"y"+j); if (colobj1.hittestpoint(math.round(i),math.round(j),true) && colobj2.hittestpoint(math.round(i),math.round(j),true)) { return true; break; } } } } return false; }