1 Reply Latest reply on Jun 29, 2006 3:11 PM by katerini

    adding Effects to Rectangle

    flexuser123
      I have a rectangle drawn using UIComponent and its graphics object. On it i need to have resize animation, but it seems as if it is not working. Below is the sample code. Can someone help in rectifying it.

      var comp:UIComponent = new UIComponent();
      comp.graphics.beginFill(0xFF0000);
      comp.graphics.drawRect(0,0,50,50);
      comp.graphics.endFill();

      addChild(comp);
      var rs:Resize = new Resize(comp);
      rs.heightTo = 300;
      rs.duration = 2000;
      rs.play();
        • 1. Re: adding Effects to Rectangle
          katerini
          I had the same problem as you did. Resize does not work if you set "absolute" width and height values. Rather, Resize expects the width and height parameters to be percentage values. Thus, instead of Rectangle, use the Box class and specify the percentWidth and percentHeight of that control. You can specify the color of the Box by setting its backgroundColor style.

          -george