1 Reply Latest reply on Nov 24, 2008 6:09 AM by Newsgroup_User

    itemRenderer, states and set data

    albedo83
      Hi all,

      I am using an ItemRenderer in a list and use
      public override function set data(data:Object):void
      to add a child to the selected item using states.
      The first time i click on an item, it works well, but a second time i click, the set data is not called and no child appears.
      Any issue ??
        • 1. Re: itemRenderer, states and set data
          Level 7

          "albedo83" <webforumsuser@macromedia.com> wrote in message
          news:ggeb47$oma$1@forums.macromedia.com...
          > Hi all,
          >
          > I am using an ItemRenderer in a list and use
          > public override function set data(data:Object):void
          > to add a child to the selected item using states.
          > The first time i click on an item, it works well, but a second time i
          > click,
          > the set data is not called and no child appears.
          > Any issue ??
          >
          >
          > override public function set data(value:Object):void {
          > super.data = value;
          > if (value != null) {
          > if (ListBase(owner).isItemSelected(value)) {
          > currentState="showMicroGallery";
          > } else {
          > currentState="";
          > }
          > }
          > }

          I'd step through the code to see what's going on.

          HTH;

          Amy