Flex customized Horizental List
Posted
by muzammal
on Stack Overflow
See other posts from Stack Overflow
or by muzammal
Published on 2010-06-07T05:54:43Z
Indexed on
2010/06/07
6:02 UTC
Read the original article
Hit count: 228
flex3
i have customized Horizontal List (items are image and some text) of a reel with some no of clips . i have customized highlight , un highlight and select style , which will be implemented dynamically and mouse over and out. now pproblem is to make un highlight previously playing clip.
enter code here
styleName="unhighlightedClip" updateComplete="currentlyPlaying();" rollOver="highlighted();" rollOut="unhighlighted();">
.currentlyPlayingClip{
borderColor: #95123E;
borderStyle: solid;
borderThickness: 2;
}
.unhighlightedClip{
borderStyle: none;
}
.highlightedClip{
borderColor: #70BAE7;
borderStyle: solid;
borderThickness: 2;
}
</mx:Style>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.controls.HorizontalList;
private var prevIndex:int = -1;
protected function unhighlighted():void{
var selected:Boolean = HorizontalList(this.owner).isItemSelected(this.data);
clipDesription.useHandCursor = false;
clipStartTime.useHandCursor = false;
this.useHandCursor = false;
if(!selected)
this.setStyle('styleName', 'unhighlightedClip');
}
protected function highlighted():void{
clipDesription.useHandCursor = true;
clipStartTime.useHandCursor = true;
this.useHandCursor = true;
var selected:Boolean = HorizontalList(this.owner).isItemSelected(this.data);
if(!selected)
this.setStyle('styleName', 'highlightedClip');
}
protected function currentlyPlaying():void{
var selected:Boolean = HorizontalList(this.owner).isItemSelected(this.data);
var currentIndex:int = HorizontalList(this.owner).selectedIndex;
if(selected)
this.setStyle('styleName', 'currentlyPlayingClip');
// else if(prevIndex != currentIndex )
// this.setStyle('styleName', 'unhighlightedClip');
//
// prevIndex = currentIndex;
}
]]>
© Stack Overflow or respective owner