1 Reply Latest reply on Jan 27, 2011 10:20 AM by kglad-zqbLf4

    stage.width help



      I have an object (plane) and I am controlling its size using plane._height =, plane._width = ...etc.


      how can I constrain the proportions so they gradually get bigger until they reach a set size (ie h=268 w=318)


      so i want the plane to grow from say (h=13 w=15) until it gets to (h=268 w=318)


      i am also using a size listener


      is there an easy way to do this, or do you just have to be reallyyyyy good at math?

      thanks as always

        • 1. Re: stage.width help
          kglad-zqbLf4 Level 3

          if your plane starts at the correct proportion, store that in a variable and use it:


          var aspectRatio:Number=plane._width/plane._height;



          then when you want to increase the _width, for example, use:


          plane._width = whatever;