5 Replies Latest reply on Jul 26, 2007 8:13 AM by Rothrock

    resize through _height property

      This problem seems so simple, but for some reason I am banging my head against the wall! All I want to do is resize a rectangle without having the line around the rectangle become huge, the outline. It seems like when I resize the shape through the _height property, the width of the outline grows as well. I have tried many things. Please help.
      I am using this code to resize:
        • 1. Re: resize through _height property
          Rothrock Level 5
          Well if the outline is part of myBox why wouldn't it change?

          How are you making the outline? Is it drawn with the api?

          You could clear it, resize the box, then redraw the outline.

          If you draw it originally as a hairline (thickness 0 in the api, hairline in the authoring environment) then it won't scale with the rest of the things in the clip.

          If it some thick, non-drawn, regularish, border you could use 9-guide scaling instead of setting the _height.
          • 2. Re: resize through _height property
            tlm_scripter Level 1
            It changes regardless of whether it is part of the mc or not.
            In fact, even if I have a simple line and I change it's _height property then it's thickness increases. Why should it? Why does it? I am only changing it's height, so why would it's width increase? This makes no sense to me.
            • 3. Re: resize through _height property
              Rothrock Level 5
              I'm not following you at all. If you have two movie clips on stage and they both have lines in them and you change the height of one of them then the line in the other one changes too? So changing the height of one clip changes the height of all lines anywhere? Because that is what your first sentence seems to say.

              How are you making these lines?

              I also think we are thinking about different things when we talk about _height and thickness and _width.

              Basically a line has now width or height, it only has start here and go there with a stroke of this amount. So for example start at 0,0 and go to 0,100. You would probably call that a height of 100, but I wouldn't. I might say a length of 100, but that is something else.

              So if you then scale the clip, and _height and _width are just crazy substitutes for _xscale and _yscale (try it, check the _xscale of a clip, set its _width, and then check its _xscale again) as far as the clip is and line are concerned the line still has a length of 100, it still goes from 0,0 to 0,100, but it has been scaled up. And if you zoom in on a a line it will appear to get wider.

              So don't think of lines in the same way you think of rectangles or other shapes.

              Like I said the answer is to either use hairlines, which do not scale or to make the line not part of what is being scaled and redraw it as needed. There are many ways. Post a link to what you are trying to do if you need more ideas.
              • 4. resize through _height property
                tlm_scripter Level 1
                No I am not saying that at all. I am just saying that the problem can be simplified to just the line. (Or a box with no fill, which I also tried) So, if I have a movie clip that is just a line and I scale it, (or just change the _height, same thing) the stroke weight changes.

                I did notice today that there are scaling properties, normal, vertical, horizontal, and none. If I select vertical then it solves my problem. To me though, 'normal' would normal in the sense that changing it's _height would have no effect on the stroke weight.
                • 5. Re: resize through _height property
                  Rothrock Level 5
                  They are the way they are. If you think about things like lines on angles and so on you will find that how to handle lines with a stroke get quite difficult. For example, if you have a 100 pixel square with a 1 pixel stroke around it. Then you make it twice as tall, what should happen?

                  Only the top and bottom lines get thicker? But they are all part of one line and share one stroke property.

                  The lines all stay the same? But then people complain that they scaled their clip and the lines didn't scale with the rest of the art?

                  The lines all get thicker? Well that is what they chose. With an option to specify a hairline and get the above result as well.

                  I'm sure there are other options but they all involve trade offs in rendering time and processing power – something that was in short and precious supply when Flash was first written years ago. Major changes in something so basic as lines would be quite difficult and likely break a lot of folks stuff. Basically it comes down to a lot of math that was figured out by some folks a long time ago. It might be done differently now, but it is how it is.

                  The 9-slice would really only be an option if you were dealing with some kind of pixel border, not an actual line.