3 Replies Latest reply on Jan 22, 2010 5:00 AM by John Hall

    Changing y position but doesn't update

    John Hall Level 4

      This is so basic but I'm having a problem. Using nightly build. I want to add a new instance of a component at a certain location and that works fine. However, I also want to modify the position of the button that fired the event to make room for the new component. Screen update doesn't seem to move the button. Am I overlooking something simple:

       

                  private function addButton_clickHandler(e:MouseEvent):void{
                      var newPhone:PhoneNumber = new PhoneNumber();
                      addElement(newPhone);
                      newPhone.x = phoneAddButton.x;
                      newPhone.y = phoneAddButton.y - newPhone.height;
                      phoneAddButton.y = newPhone.y + 100 + PHONE_PADDING;
                  }

       

      have also tried

       

                  private function addButton_clickHandler(e:MouseEvent):void{
                      var newPhone:PhoneNumber = new PhoneNumber();
                      addElement(newPhone);
                      newPhone.x = e.currentTarget.x;
                      newPhone.y = e.currentTarget.y - newPhone.height;
                      e.currentTarget.y = newPhone.y + 100 + PHONE_PADDING;
                  }

       

      Have tried moving the button on a callLater function but nothing. Do I need to invalidate or invalidate properties or something? Wow, thought I was past this stage!