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