# Rollover event on a ButtonBar?

**URL:** <https://forum.kirupa.com/t/rollover-event-on-a-buttonbar/290171>\
**Category:** flash\
**Created:** [June 10, 2009, 8:24pm UTC](https://forum.kirupa.com/t/rollover-event-on-a-buttonbar/290171 "2009-06-10T20:24:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tic](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tic](https://forum.kirupa.com/u/tic)\
**Post date:** [June 10, 2009, 8:24pm UTC](https://forum.kirupa.com/t/rollover-event-on-a-buttonbar/290171/1 "2009-06-10T20:24:30Z")

</div>

I have a buttonbar and with this function

```auto
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:

```auto
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

```auto
<?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 🙂
