considering my English is not very good. I will try to use picture
Hopefully you can get what I mean. Basically what I want is I want to rotate the triangle such that the base of the triangle is flat straight ( horizontally straight). Keep in mind, that the triangle is a shape. and I know the coordinate of each point, and each midpoint of each edges. How would I do that?

This seems to be an equilateral triangle so could you not just rotate the triangle 120 degrees?
If not you could use Math.atan. So plainly put you can get the x and y coordinates of a and c. Use the difference between the x's and y's to give you two vectors. Then x = adjacent, y = opposite and so Math.atan(Opp, Adj) = angle. Then select your object and rotate it an extra value of angle.
https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Math.html#atan()
Think thats what you're after
Edit
So this image is what I think you are after. I randomly drew a triangle. Now you want B.y = C.y. So if you get the angle of r you should be able to use that to rotate the triangle the correct amount so that B.y = C.y.
You will have to consider what if B.y > C.y and adapt this to make it work 100%, but in this example this should work.