2 Replies Latest reply on Apr 2, 2012 7:23 AM by sinious

    how do i increase height of mc and keep its width?

    udikeren Level 1

      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 :

       

       

      function rotateMoveClip_u(e:Event)

      {

                var target=(center.x);

        e.target.rotation=((-target+45)/4)*1.25;

                mc.height = Math.sqrt((target-75)*(target-75) + 150*150);

        mc.width=2

      //this line is  is wrong

       

      }

       

      maybe using "height" and "width" is wrong?

       

      thank you

        • 1. Re: how do i increase height of mc and keep its width?
          kglad Adobe Community Professional & MVP

          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?

          1 person found this helpful
          • 2. Re: how do i increase height of mc and keep its width?
            sinious Most Valuable Participant

            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.

            1 person found this helpful