# \[f8\] button actionscript help

**URL:** <https://forum.kirupa.com/t/f8-button-actionscript-help/206672>\
**Category:** Uncategorized\
**Created:** [November 10, 2006, 6:47am UTC](https://forum.kirupa.com/t/f8-button-actionscript-help/206672 "2006-11-10T06:47:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![clueless](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/clueless/32/1304_2.png) [@clueless](https://forum.kirupa.com/u/clueless)\
**Post date:** [November 10, 2006, 6:47am UTC](https://forum.kirupa.com/t/f8-button-actionscript-help/206672/1 "2006-11-10T06:47:04Z")

</div>

Hi,

The ‘HOME’ page will be the FIRST thing the viewer will see when they come to my site.  
I want the ‘HOME’ button already highlighted; that is until the viewer clicks on a different button. What am I missing in my code?

b1.onRollOver = over;  
b1.onRollOut = out;  
b1.useHandCursor = false;  
b1.buttText.buttonText.text = “HOME”;  
b1.onRelease = function() {  
this.selected = true;  
resetState(this);  
};  
b2.onRollOver = over;  
b2.onRollOut = out;  
b2.useHandCursor = false;  
b2.buttText.buttonText.text = “PORTFOLIO”;  
b2.onRelease = function() {  
this.selected = true;  
resetState(this);  
};  
function over() {  
if (!this.selected) {  
this.gotoAndPlay(‘over’);  
}  
}  
function out() {  
if (!this.selected) {  
this.gotoAndPlay(‘active’);  
}  
}  
function resetState(mc) {  
for (var i = 0; i\<10; i++) {  
if (mc.\_name != “b”+i) {  
var tmp = this[“b”+i];  
if (tmp.selected) {  
tmp.selected = false;  
tmp.gotoAndPlay(‘active’);  
}  
}  
}  
}
