# Complex buttons and selected state?

**URL:** <https://forum.kirupa.com/t/complex-buttons-and-selected-state/238493>\
**Category:** flash\
**Created:** [September 11, 2007, 10:15pm UTC](https://forum.kirupa.com/t/complex-buttons-and-selected-state/238493 "2007-09-11T22:15:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mippzon](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@Mippzon](https://forum.kirupa.com/u/Mippzon)\
**Post date:** [September 11, 2007, 10:15pm UTC](https://forum.kirupa.com/t/complex-buttons-and-selected-state/238493/1 "2007-09-11T22:15:05Z")

</div>

Hey, could use some help here. Been looking around the forums, but can’t find the solution to my problem. Im trying to create a menu, where I want an item to be selected, when clicked, but I don’t find an easy and useable solution. This is my code:

```auto

var container:MovieClip = this.createEmptyMovieClip("container_mc", this.getNextHighestDepth());

var ett:MovieClip = container.attachMovie("ett_mc", "ett_mc", container.getNextHighestDepth(), {_x:30});
var tva:MovieClip = container.attachMovie("tva_mc", "tva_mc", container.getNextHighestDepth(), {_x:150});
var tre:MovieClip = container.attachMovie("tre_mc", "tre_mc", container.getNextHighestDepth(), {_x:350});

var knappArray:Array = new Array();

knappArray.push(ett);
knappArray.push(tva);
knappArray.push(tre);

for (var j:Number = 0; j<=knappArray.length; j++) {
    knappArray[j].attachMovie("selection_mc","selection_mc",knappArray[j].getNextHighestDepth());
    knappArray[j].selection_mc._alpha = 90;
}

for (var i:Number = 0; i<=knappArray.length; i++) {
    
    knappArray*.onRelease = function():Void {
            this.selection_mc._alpha = 90;
    };

    knappArray*.onRollOver = function():Void {
        this.selection_mc._alpha = 50;
    };

    knappArray*.onRollOut = function():Void {
        this.selection_mc._alpha = 0;
    };
}

```

Thanks in advance
