# Visited MC button state

**URL:** <https://forum.kirupa.com/t/visited-mc-button-state/110664>\
**Category:** Uncategorized\
**Created:** [May 18, 2004, 7:17pm UTC](https://forum.kirupa.com/t/visited-mc-button-state/110664 "2004-05-18T19:17:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbnb](https://avatars.discourse-cdn.com/v4/letter/j/e0b2c6/32.png) [@jbnb](https://forum.kirupa.com/u/jbnb)\
**Post date:** [May 18, 2004, 7:17pm UTC](https://forum.kirupa.com/t/visited-mc-button-state/110664/1 "2004-05-18T19:17:57Z")

</div>

After searching the site for “visited” state of buttons that have been viewed, I found several options. I have attempted customizing the following code for my site, but cannot make it work properly.

My buttons load .swf’s into a frame on the main stage.The array and loading MC’s work brilliantly. The button’s, however will not stay in the “\_visited” state. If I click and then move the mouse off of the button immediately and do not move it again, it will stay “\_visited”. As soon as the mouse moves even slightly it reverts to “\_up”

Can anyone look this over and tell me what I missed?  
[http://mysite.verizon.net/jbnbsax/home.html](http://mysite.verizon.net/jbnbsax/home.html)  
Go to “Recent Work” to view the code in action.

* * *

//Movie clip button with 3 states labeled \_up, \_down, \_visited  
total = 7;//number of buttons  
movies\_array = [“work\_mc1.swf”, “work\_mc2.swf”, “work\_mc3.swf”, “work\_mc4.swf”, “work\_mc5.swf”, “work\_mc6.swf”, “work\_mc7.swf”];  
//array containing the movies  
this.onEnterFrame = function() {  
for (var i = 1; i\<=total; i++) {  
if (this[“portfolio”+i].\_currentframe != 7) {  
if (this[“portfolio”+i].hitTest(\_xmouse, \_ymouse, false)) {  
this[“portfolio”+i].gotoAndStop("\_down");  
} else {  
this[“portfolio”+i].gotoAndStop("\_up");  
}  
}  
}  
};  
for (var i = 1; i\<=total; i++) {  
this[“portfolio”+i].temp = i-1;  
this[“portfolio”+i].onPress = function() {  
loadMovie(movies\_array[this.temp], frame);  
this.gotoAndStop("\_visited");  
};  
}[http://mysite.verizon.net/jbnbsax/home.html](http://mysite.verizon.net/jbnbsax/home.html)
