1 Reply Latest reply on Dec 2, 2009 6:43 AM by Gregory Lafrance

    How to repaint (or) redraw (or) update a label?

    Karam Chandrabose

      Hello Adobe experts,

       

      thanks for reading my question.

       

      I have a VBOX, inside the VBOX I have a label, a horizontal list and another label.

      the Horizontal List contains a list of image tiles and on select of each image (ie) when each image is highlighted I want to move the label right under that image.

       

      I have extended the horizontal list and created a Horizontal list in which I have added properties to have reference of the label. Have over ridden the drawselectionindicator method to have my custome selection indicator.

       

      I use the following code to reposition the label.(this is inside my extended HorizontalList Class)

       

        var temp:Object = this.selectedItem;
                      var myObject:myclass ;
                   myObject=  myclass(temp);
                   objLabel.text = myObject.title;
                   objLabel.invalidateProperties();
                   objLabel.invalidateDisplayList();
                   objLabel.invalidateSize();
                   objLabel.visible = true;
        var itemRenderer1:DisplayObject = this.itemToItemRenderer(this.selectedItem) as DisplayObject;
                  objLabel.x = itemRenderer1.x;
                    objLabel.move(itemRenderer1.x,objLabel.y);
                                objLabel.invalidateProperties();
                   objLabel.invalidateDisplayList();
                   objLabel.invalidateSize();

      I have given the above code in a couple of other places also. but the UI is not being Updated, if I take a moveover the item renderer the label displays in the required position.

       

      No I need to know how to repaint my Label.