We help IT Professionals succeed at work.

Flash Datagrid Cell Highlight issue

Medium Priority
Last Modified: 2013-11-12
Hey everyone,

I apologize for my overly desperate title but I was left with no choice. I've posted this issue a bunch of time now with no luck. I am somewhat pressed for time now so I can really use the help. Anyway, enough complaining from me; here is my issue:

Does anyone know how I can modify the datagrid component in Flash CS3 so that individual cells highlight on rollover instead of the default where the entire row highlights (I am using Actionscript 2.0 - and I've come to notice that there is a difference between the datagrid component with AS2 and AS3).

To help clarify, I have attached an image to demonstrate what I am trying to accomplish. I have searched on forums and have played around with different classes but have had no luck.

If someone can please help me out, I would greatly appreciate it. Please let me know if you need any more info from me. Thanks.
Watch Question

Andrew BeersTechnology Lead

instead of using the default mouse over use a cell based mouse over for the element.  You can do this by binding an event to individual cell components on item databind.

Don't have time to post code but should be easy enought to google.



Thanks for the reply Aqua.

I've searched "mouse over" and "cell" (as well as a bunch of other terms) within the Flash help document as well as in Google but haven't found a solution to my problem.

I know that the cell highlight on mouse over can be done with Actionscript 3.0, but have yet to find a class or anything that would help me with Actionscript 2.0.

If you do have time to elaborate on your post, I would really appreciate it.
Andrew BeersTechnology Lead



Easiest way is to assign a custom item renderer for the cell component, from there you can attach your even to the cell itself depending on the type of cell... so on and so forth.

Your event would be attached to your list item and then checked in the rendered.



Thanks again aqua9880. However, the link you provided was for Flex. I know a little about Flex but I didn't think it was possible to use Flex code/syntax in Flash. Am I wrong?
Andrew BeersTechnology Lead


They can be set-up to play nicely.  Takes a bit of leg-work but of the 2 code lines Flex is the more powerful and flexible.

What Datagrid object are you using?  I'm not aware of any out of the box Flash datagrid component other than the Flex / MX object which the documentation I provided will address.



I am using the built-in Flash datagrid component (with AS2) so it's not out-of-the-box.

I appreciate your help Aqua, although I'm not sure if I'm advanced enough with my programming to get both Flash and Flex to work in sync with the Flash datagrid component. I will take a look around and play around with it a bit. Hopefully I can get something out of it. If not though, if you or anyone else has any other suggestions, I'm still open to anything. Thanks again.
Andrew BeersTechnology Lead
Wow... You're making me dig wayyyyyyy back:




You can set a custom cell renderer on the datagrid as a whole.  You'll need to ignore the table row highlighting and do this yourself through the cell reder function.  Those two links should be able to help out a bit.

Sorry for the massive confusion on my part.  Not too many people are using MX2k4 anymore.  I would reccomend learning Flex when you get some downtime.   It has a lot more info online and a lot more power.

For future help try to dig around on Adobe's live docs a bit more.  They keep a fairly extensive API reference.


Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Andrew BeersTechnology Lead

reder == render

Type... don't want to confuse you there.


Thanks Aqua. But to clarify, I am actually using Flash CS3, not MX2004 (not sure what I may have said that would imply MX2004). I am however using Actionscript 2.0 and not Actionscript 3.0.

I have looked into the Cell Render class through the Flash livedocs but haven't been able to find anything that would allow me to customize the datagrid and allow for individual cell highlighting (but it could just be that I'm not looking in the right places). I think this link is essentially the same as the one you provided but for CS3:


"You can set a custom cell renderer on the datagrid as a whole.  You'll need to ignore the table row highlighting and do this yourself through the cell reder function."

I really appreciate you continuously replying and trying to help me out and I hope you are still willing to help me out. I hope it's not too much to ask but can you possibly elaborate a bit more on how I can accomplish what you stated above?

As I mentioned, I have a well-rounded understand of Actionscript by my abilities can only take me so far. I have posted this issue a number of times over the past month or so and most people point me to the Flash livedocs which unfortunately hasn't helped me solve my problem yet. I don't want to imply to anyone that I am hoping they figure it out for me, I guess I am just hoping for a little more clarification on how I can accomplish my task.

Once again, thanks Aqua. I really do appreciate the help but any more clarification or guidance would be greatly appreciated. I am trying to meet a deadline for a project and unfortunately, no one I know is overly familiar with Flash. Woe is me :(

Top Expert 2009

my goodness you're special :-)
i got a mail requesting specific help for you but i'm afraid its not great news.
my goodness - i've never worked with the cell renderer before but i've been trying this and that and i've written my class and the only thing that will change is the specific cell's text color and not its background.

i know its urgent but at this point in time i couldnt' find a solutions. I was reading some Adobe docs and it seems doable but not advisable - the comment said expensive - not sure what that means - maybe memory or CPU usage.

i found a site that was selling datagrid extensions - not sure if it works, the guy claims it does - it was $5.
if all else fails and you're desperate .



Thanks for the reply blue-genie.

At this point, even if it's just the text-color changing, that should be good enough for now. Can you please direct me on how you managed to accomplish that?

BTW, one thing that I found in an old forum with a posting similar to mine was someone managed to use row and column highlighting. When the two colors from each highlight were on the same cell, that cell combined those colours - which in turn gives that cell its own background colour. Not the greatest solution but it is another possibility. The only thing is, I didn't know it was possible to have a column highlight in addition to a row highlight.

Anyway, if this sparks any ideas, I'm curious to hear your take on it. Otherwise, the text color change would be fine.

Thanks again.


Due to my desperation, I decided to buy the TuFat datagrid extension. It does allow you a number of options to customize the datagrid component however after playing around with it and searching on a number of forums, it doesn't appear to have the ability to highlight individual cells on roll over. You can give particular cells different background colours, but I'm not sure if you can use that along with any sort of rollOver function.

I could be wrong but that seems to be the case. Anyway, I would still be interested in the font color change you had mentioned Aqua. When you have a spare moment, any details would help.



Not trying to butt in for points or anything. The others have done all the work so give them the points, but it looks to me like the extension you bought does exactly what you want.
This is Demo #2: http://demo.tufat.com/datagrid/flash7/index.html

Look what it's doing in the header. That's what you're after, right? If so, contact them for support. I think you already have your answer.



No worries MHenry, you aren't butting it. Thanks for the reply.

The highlighting that is going on in the header from that example is something that the Flash datagrid does by default (even without the extension). It will highlight each individual header but it won't do the same thing for individual cells within the table. You can check out an example here that doesn't use the extension but does the same thing:


I have continued to play with the extension and have looked on quite a few forums for a potential solution. A number of people have asked for the same thing but no one seems to have followed up with a response.

Once again, if anyone has any suggestions, I am still open to anything.
Top Expert 2009
yeah based on the website for that extension it does hightlight - i think that one is on select though and not on rollover but you should be able to modify it.
okay see the code snippet below. this is for changing the textcolor.
only thing it only kicks in as you change the rows.
i'm sure you'll see what i mean.
i modified it from a flex solution i found online.

where grid is the name of your datagrid.
this.grid.onRowRollOver = function(rowIndex:Number){
	if (!this.enabled) return;
	var len : Number = this.columns.length;
	var row = this.rows[rowIndex];
	for (var i=0; i<len ; i++) {
		var col : mx.controls.gridclasses.DataGridColumn = this.columns[i];
		var delta : Number = row._xmouse - row.cells[i]._x;
 		if (delta>=0 && delta<col .__width) {

Open in new window

Top Expert 2009

and did you try it?


Sorry for the late reply blue-genie. I have been trying to get it to work with what I have but seem to be having some difficulty. For some reason my cell-highlighting seems to stop working all together.

I will continue to play around with it today and hopefully get it to work. Sorry to bug you again but by any chance, do you have a working sample of this? Or, do you have the sample that got from Flex that I can have a look at? I just want to compare the code when it interacts with populating the datagrid just as a reference.

Thanks again for your help. It is much appreciated. If I can't get it to work in the next day or so, I will award you the points anyway.
Top Expert 2009

didn't i upload it - hmm i'm losing my mind -  remember this is the change text color only.
its cs3 file


Thanks blue-genie.

I tested it out and I got it to work. I see what you mean about it only working when you change rows. Oh well.

Coincidentally enough, someone replied to another posting a gave a similar solution. This one seems to have the text change color even on the same row. However, it seems a bit glitchy when you are highlighting the top row. I am probably going to create another post to have that fixed.

Anyway, I've attached the file if anyone is interested. Thanks again.

P.S. Just so it doesn't seem like I'm taking credit, the sample file was created by 'Vulturous'

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.