i have a mc which seize is height = 150 and width = 2 (like a line).
i have a script which rotate this line and increases its length. this works, however i dont know how to keep the width so that it wil remain 2.
this is the scrip in as3 :
mc.height = Math.sqrt((target-75)*(target-75) + 150*150);
//this line is is wrong
maybe using "height" and "width" is wrong?
the appearance of you line's width shouldn't change unless you're scaling it and haven't assigned scale property.
is it the line's appearance you're trying to control?
Even though you rotate your line (to say, horizontal), you still need to adjust the height (because it's original orientation was a vertical line). So when you rotate the line so it's horizontal you do not update width, you still update height. Just leave width alone.
Same goes if your line was originally horizontal and you wanted it to be vertical. If the original width was 150 and height was 2 (horizontal line) and you rotate it 90 degrees to be a vertical line, you would not adjust height to make it a longer vertical line. You'd adjust width.