I have a datagrid component in my AS3 project and I have a special cell rendering assigned to a single column that loads a movie clip into a cell depending on the data value of that cell. For example, if the cell data is number 1, I load movieclip1, if 2 I load movieclip2. This works great. In the CustomCellRenderer class, I use
public function set data(value:Object):void { _data = value;
When the DataGrid loads, the correct movie clip is loaded into the cell. However, when the user sorts the columns by clicking on the column heading, some of the movie clips do not load. I checked that the data is sorted in order, and when I trace the "movie" + value. The number displays the correct line.
I think maybe I need to unload the video clips in each cell before setting the source again? How to do it?
Another thing I noticed is that when a DataGrid needs to be scrolled because there are more lines on the screen than on the screen (duh!), Only one set of movie clips will be displayed at once, as if there is an “active”, or " focus ", which will only show video clips. Again, I assume that Flash tries to show only the clips that are in the visible part of the scrollable DataGrid, and tries to update every time I scroll. However, only 1 cell shows movie clips, and not the entire visible part (about 8 lines).
thanks
source share