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