# 'visited' state for a button

**URL:** <https://forum.kirupa.com/t/visited-state-for-a-button/33276>\
**Category:** flash\
**Created:** [October 17, 2003, 8:16am UTC](https://forum.kirupa.com/t/visited-state-for-a-button/33276 "2003-10-17T08:16:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rolf](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@Rolf](https://forum.kirupa.com/u/Rolf)\
**Post date:** [October 17, 2003, 8:16am UTC](https://forum.kirupa.com/t/visited-state-for-a-button/33276/1 "2003-10-17T08:16:06Z")

</div>

Hi,  
Can anyone explain to me how i can add a ‘visited’ state to a button, in addition to the rollover and out states?  
I would like visitors to see which places they have alredy been to.

Thanx,

Rolf

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 21, 2003, 5:15am UTC](https://forum.kirupa.com/t/visited-state-for-a-button/33276/2 "2003-10-21T05:15:13Z")

</div>

I was actually after the same thing.

Thanks Claudio.

One question

How can i get those buttons to load external MCs.

I can get the 1st one to load an external MC using

[AS]

onClipEvent (mouseUp) {  
unloadMovieNum(1);  
loadMovieNum(“loaded.swf”, 1);  
}

[/AS]

but when changing the other 2 buttons to load different  
MCs it continues to load the 1st one. (loaded.swf)

Any ideas??

thanks again

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 21, 2003, 8:27am UTC](https://forum.kirupa.com/t/visited-state-for-a-button/33276/3 "2003-10-21T08:27:51Z")

</div>

jeez, that must be one complicated button to have to load external files!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 21, 2003, 12:11pm UTC](https://forum.kirupa.com/t/visited-state-for-a-button/33276/4 "2003-10-21T12:11:12Z")

</div>

what are u talking about

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 21, 2003, 2:51pm UTC](https://forum.kirupa.com/t/visited-state-for-a-button/33276/5 "2003-10-21T14:51:51Z")

</div>

```auto

/*
your button is in fact a movie clip with 3 frames
frame 1 is normal state
frame 2 is over state
frame 3 is visited state
name your buttons button1, button2, button3 and so on...
*/
total = 3;//number of buttons
movies_array = ["movie1.swf", "movie2.swf", "movie3.swf"];//array containing the movies
this.onEnterFrame = function() {
	for (var i = 1; i<=total; i++) {
		if (this["button"+i]._currentframe != 3) {
			if (this["button"+i].hitTest(_xmouse, _ymouse, false)) {
				this["button"+i].gotoAndStop(2);
			} else {
				this["button"+i].gotoAndStop(1);
			}
		}
	}
};
for (var i = 1; i<=total; i++) {
	this["button"+i].temp = i-1;
	this["button"+i].onPress = function() {
		loadMovieNum(movies_array[this.temp], 100);
		this.gotoAndStop(3);
	};
}

```
