# Simple time question

**URL:** <https://forum.kirupa.com/t/simple-time-question/102118>\
**Category:** Uncategorized\
**Created:** [February 19, 2004, 11:09pm UTC](https://forum.kirupa.com/t/simple-time-question/102118 "2004-02-19T23:09:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![olympiakos7](https://avatars.discourse-cdn.com/v4/letter/o/278dde/32.png) [@olympiakos7](https://forum.kirupa.com/u/olympiakos7)\
**Post date:** [February 19, 2004, 11:09pm UTC](https://forum.kirupa.com/t/simple-time-question/102118/1 "2004-02-19T23:09:54Z")

</div>

I’m trying to fade away my navigation buttons after pressing them while a scene loads, and then have them reappear after 20 seconds.

I can’t seem to get the delay to work, or get the buttons to do a gradual fade.

something like this:

on (release){

but1.\_alpha=0;

if (time) =\>20 ; set. but1.\_alpha=100;  
}

any suggestions?

---

<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:** [February 20, 2004, 12:35am UTC](https://forum.kirupa.com/t/simple-time-question/102118/2 "2004-02-20T00:35:47Z")

</div>

```auto

onClipEvent (enterFrame) {
	var bytes = _root.getBytesTotal();
	var bytes_loaded = _root.getBytesLoaded();
	if (bytes_loaded == bytes) {
                                this.onEnterFrame = menu.fadeIn;
		_root.gotoAndPlay(2);
	} else {
		_root.gotoAndStop(1);
				
	}
}
MovieClip.prototype.fadeIn = function() {
        this._alpha += 5;
        this._alpha>=100; 
};
MovieClip.prototype.fadeOut = function() {
        this._alpha -= 5;
        this._alpha<=20;
};
menu.onRelease = function() {
// You could change this to 
// menu.onPress = function() {
// 4 a faster reaction. 
        this.onEnterFrame = this.fadeOut;
};

```

Just make a simbol with the label ‘menu’

---

<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:** [February 20, 2004, 5:10am UTC](https://forum.kirupa.com/t/simple-time-question/102118/3 "2004-02-20T05:10:28Z")

</div>

Thanks for the help, I’m starting to understand how it’s supposed to function, but i can’t seem to get it to work

[www.nikomedia.com/dev1/flash/fade\_menu.fla](http://www.nikomedia.com/dev1/flash/fade_menu.fla)

when one of the buttons are pressed i want all the buttons to fade away, then after 20 seconds i want them to fade back in.

what am i doing wrong? any help would be greatly appreciated

---

<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:** [February 20, 2004, 1:50pm UTC](https://forum.kirupa.com/t/simple-time-question/102118/4 "2004-02-20T13:50:07Z")

</div>

work fine for me.

---

<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:** [February 20, 2004, 1:55pm UTC](https://forum.kirupa.com/t/simple-time-question/102118/5 "2004-02-20T13:55:35Z")

</div>

to let it wait i would do. this, i don’t know if there is a command to let it wait but i think this should work the same.

```auto

onClipEvent (enterFrame) {
var framespresecond = 20;
var seconds = framespresecond*20
for (i=0; i<seconds; i++) {
this.onEnterFrame = menu.fadeIn;
}

```
