flex - action script 3 and custom image itemrenderers -


I have a custom item renderer that displays a separate GIF in the row based on data value from the data object. When I set the image source url using the full path and does not embed it then works fine, but when I embed images, I feel that when I scroll the grid up and down Images are disturbed and sometimes sit on each other.

Does anyone have any ideas, why embedding images in my Hbox item renderer is causing so much trouble;

code

  public tools: image; Public Works Incorporated_Aakers: Bitmap = New AssetManager.COMPUTER_ICON; .. some logic tool. AddChild (compr_icons);  

In your item renderer, override the data setter Try (which is said to be contained by SDK for each item in your Datacaprovair, as you navigate to the data-bound control you use), and from here the image's source Set the property, such as:

  & lt; Mx: list data provider = "{yourDataSource}" & gt; & Lt; Mx: itemRenderer & gt; & Lt; Mx: component & gt; & Lt; Mx: hbox & gt; & Lt; Mx: script & gt; & Lt ;! [CDATA [Override public function set data (value: object): zero {super.data = value; // Set your prices here (value is your data item) myImage.source = value.yourImageSourceInstance; MyLabel.text = value.yourLabelText; }] & Gt; & Lt; / Mx: script & gt; & Lt; Mx: image id = "myImage" /> & Lt; Mx: label id = "myLabel" /> & Lt; / Mx: hbox & gt; & Lt; / Mx: Component & gt; & Lt; / Mx: itemRenderer & gt; & Lt; / Mx: list & gt;  

... and see what helps Flex might be trying to reuse the rendering of visual elements, due to not understanding your intentions, If you want to swap in the form then by taking action (when the data item is set), you can control it more clearly with the visual elements of the renderer.

Hope that helps!


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -