?
Solved

Set over skin for cell in list component

Posted on 2008-02-08
7
Medium Priority
?
278 Views
Last Modified: 2008-03-06
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
0
Comment
Question by:pD_EO
  • 4
  • 3
7 Comments
 
LVL 8

Expert Comment

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

Thanks.
0
 
LVL 6

Author Comment

by:pD_EO
ID: 20851130
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
 
LVL 6

Author Comment

by:pD_EO
ID: 20851197
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
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
LVL 8

Expert Comment

by:section25
ID: 20851315
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
 
LVL 6

Author Comment

by:pD_EO
ID: 20851386
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
 
LVL 8

Accepted Solution

by:
section25 earned 220 total points
ID: 20851634
Sorry, I don't use CS3. Maybe this tutorial can help.

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

0
 
LVL 6

Author Comment

by:pD_EO
ID: 20852260
Yeah, did look at that, but not really sure on how to do it exactly.

Ah well, thanks for your help anyway.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to how to record live broadcast.

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question