1 Reply Latest reply on Oct 17, 2008 11:05 AM by Newsgroup_User

    Loss style when overriding the function 'set data' for a TileList

    FlexBin
      Hi!

      In a TileList, I set the itemRenderer for a components from where I override the function set data like in this example:

      but, by doing this, I'm loosing all the built-in CSS behavior. The onMouseOver effect the change the backgroundColor and the hand pointer. I try to set it programmatically but without success.

      An idea?

      Thank you
        • 1. Re: Loss style when overriding the function 'set data' for a TileList
          Level 7

          "FlexBin" <webforumsuser@macromedia.com> wrote in message
          news:gdaj4r$noj$1@forums.macromedia.com...
          > Hi!
          >
          > In a TileList, I set the itemRenderer for a components from where I
          > override
          > the function set data like in this example:
          >
          > but, by doing this, I'm loosing all the built-in CSS behavior. The
          > onMouseOver
          > effect the change the backgroundColor and the hand pointer. I try to set
          > it
          > programmatically but without success.
          >
          > An idea?
          >
          > Thank you
          >
          > public override function set data(value:Object):void
          > {
          > var xml:XML = new XML(value);
          >
          > if(this.backgroundIconName != null &&
          > this.ico != null &&
          > this.labelText != null) {
          >
          > if(xml.backgroundIconName != "") {
          >
          > this.backgroundIconName.source = "assets/" + xml.backgroundIconName;
          > }
          >
          > this.backgroundIconName.visible = (xml.backgroundIconName != "");
          >
          > this.ico.source = "assets/" + xml.iconName;
          > this.ico.width = Number(xml.width);
          > this.ico.height = Number(xml.height);
          >
          > this.labelText.text = resourceManager.getString('myResources',
          > xml.label);
          > }
          >
          > if(xml.@available == 'false')
          > {
          > this.enabled = false;
          > }
          > }


          There are examples of how to properly implement this kind of functionality
          in the itemRenderers here:
          http://flexdiary.blogspot.com/2008/09/groupingcollection-example-featuring.html
          http://flexdiary.blogspot.com/2008/09/extended-datagrid-with-stylefunction.html