I have a buttonbar and with this function
private function myPortfolio_itemClick(evt:ItemClickEvent):void {
var title:String = "[" + evt.index + "] " + evt.label;
I can can things to happen when a certain label from the butonbar is pressed
like:
if(evt.label == "Home"){
siteContent.htmlText = Index.htmlText;
}
Now, the problem is that I also want a different Rollover event for each different label in the buttonBar.
Unfortunatly I cant seem to get this to work.
With this script
<?xml version="1.0" encoding="utf-8"?>
<mx:ButtonBar xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.controls.Button;
import mx.core.IFlexDisplayObject;
import mx.core.Application;
private function bb_rollOver ( evt:MouseEvent ) : void
{
Application.application.bb_rollOver ( evt );
}
private function bb_rollOut ( evt:MouseEvent ) : void
{
Application.application.bb_rollOut ( evt );
}
override protected function createNavItem( label:String, icon:Class = null ) : IFlexDisplayObject
{
var newButton:Button = super.createNavItem ( label, icon ) as Button;
newButton.addEventListener ( MouseEvent.ROLL_OVER, bb_rollOver );
newButton.addEventListener ( MouseEvent.ROLL_OUT, bb_rollOut );
return newButton;
}
]]>
</mx:Script>
</mx:ButtonBar>
I have been able to get a rollOver event on the buttonbar in total, but not on the specified part that i want..
If anyone can help me with this, or knows a solution… that would be great