Set over skin for cell in list component

Hey,

I have 2 list components, list_a & list_b.

Each component has the exact same number of rows.

If you hover over a row in list_b, then I want the row in list_a to show the over skin just for that row.

I can grab a reference to the row in list_a, but I am not sure how I go about setting that row to have a different skin.

Any ideas?

Thanks
LVL 6
pD_EOAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

section25Commented:
What do you mean by "skin"? Please explain in more detail exactly what you are trying to do.

Thanks.
0
pD_EOAuthor Commented:
Drag a list component to your stage, double click on it.  You then have various parts of the skin (i.e colours etc).

I can't really make my question above any clearer, so I will write some example code.

Add 2 list components, name them "list_a" and "list_b".

Now, when you rollover an item in list A, it will tell you the index number, what I wish to do is then set the same row in list_b to have the same row highlighted (note: not selected, just to mimic what you rollover in list_a).

I get grab a reference to the row in list_b, but I do not know how to change the skin on that cell (double click component to see the skin states).

Sorry I don't have any more points.
import fl.events.ListEvent;
 
var list_data:Array = [
	"A",
	"B",
	"C",
	"D",
	"E"
];
 
// Populate lists with data
 
for(var i:Number = 0; i < list_data.length; i ++){
	this.list_a.addItem({
		label: list_data[i],
		data: i
	});
	
	this.list_b.addItem({
		label: list_data[i],
		data: i
	});
}
 
this.list_a.addEventListener(ListEvent.ITEM_ROLL_OVER, this.list_b_rollover);
 
function list_b_rollover(event:ListEvent):void {
	trace("You hovered over list A, row index " + event.rowIndex);
}

Open in new window

0
pD_EOAuthor Commented:
A simpler way...

Inside the list_b_rollover function, this is basically what I want it to do:

get row at index X from list_b and fire rollover event
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

section25Commented:
Don't apologize for not having more points. That isn't the object here.

Try addressing list_b like this:

function list_b_rollover(event:ListEvent):void {
  this.list_b.setPropertiesAt(event.rowIndex, {backgroundColor:0x000000})      
  trace("You hovered over list A, row index " + event.rowIndex);
}
0
pD_EOAuthor Commented:
Thanks :)

I gave it a go, but unfortunately I am using AS3, so setPropertiesAt isn't supported, and I can't see what would do the same.
0
section25Commented:
Sorry, I don't use CS3. Maybe this tutorial can help.

http://www.adobe.com/devnet/flash/articles/skinning_flash_cs3.html

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pD_EOAuthor Commented:
Yeah, did look at that, but not really sure on how to do it exactly.

Ah well, thanks for your help anyway.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.