# ARe FadeIn and FadeOut difficult?

**URL:** https://forum.kirupa.com/t/are-fadein-and-fadeout-difficult/18916
**Category:** flash
**Created:** [April 22, 2003, 4:23pm UTC](https://forum.kirupa.com/t/are-fadein-and-fadeout-difficult/18916 "2003-04-22T16:23:39Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![mngBJ](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@mngBJ](https://forum.kirupa.com/u/mngBJ)
#### Post date: [April 22, 2003, 4:23pm UTC](https://forum.kirupa.com/t/are-fadein-and-fadeout-difficult/18916/1 "2003-04-22T16:23:39Z")

</div>

my problem is fadeIn and FadeOut ? How can i use fadeIn and FadeOut Function?  
You can see this url

[http://bj.mng.cc/RollOver3Btn.html](http://bj.mng.cc/RollOver3Btn.html)

WHat i mean is  
If mouse over button1 then fadeIn btn1mov. and if i rollover button2 then fadeOut btn1mov and fadeIn btn2mov. and so on. I can do this just if i have 2 buttons.  
But third button is a bit strange. 'coz If mouse over button1 then fadeIn btn1mov. but i cann’t fade out btn1mov.

HELP ME this.  
Thanx everyone.

---

<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: [April 22, 2003, 4:28pm UTC](https://forum.kirupa.com/t/are-fadein-and-fadeout-difficult/18916/2 "2003-04-22T16:28:08Z")

</div>

Ok ! I will try explaning this I hope you understand it !

Place the text that appears in the left down corner in to a movie clip !

Then convert it to a Movie clip then edit the text or the movie clip by clicking it 2 times ! then make a tween in the timeline ! thats in the movie clip that you have created then set the tween 10 frames long ! then in the furst frame set the alpha of the “text” to 0% and the last frame thats frame 10 to alpha = 100% !

I hope this helps ! or you undertsand ! say so if you dont !(-:

---

<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: [April 22, 2003, 4:34pm UTC](https://forum.kirupa.com/t/are-fadein-and-fadeout-difficult/18916/3 "2003-04-22T16:34:18Z")

</div>

Thanx for your help  
Blastboy.  
But i wanna a something just different from your advice. Maybe you visit that page. Maybe that is help you just what i mean.  
could i use a function that something fadeIn and fadeOut. or something different.

---

<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: [April 22, 2003, 5:42pm UTC](https://forum.kirupa.com/t/are-fadein-and-fadeout-difficult/18916/4 "2003-04-22T17:42:28Z")

</div>

```auto
MovieClip.prototype.fade = function(desAlpha, rate) {
	this.onEnterFrame = function() {
		if (this._alpha<=desAlpha) {
			this._alpha += rate;
			if (this._alpha>desAlpha) {
				this._alpha = desAlpha;
				delete (this.onEnterFrame);
			}
		}
		if (this._alpha>=desAlpha) {
			this._alpha -= rate;
			if (this._alpha<desAlpha) {
				this._alpha = desAlpha;
				delete (this.onEnterFrame);
			}
		}
	};
};

```

on your button

```auto
on(rollOver){
mc.fade(100,10);
}
on(rollOut){
mc.fade(50,10);
}

```

this function is two way fade, u can control it as u like…  
but if u want to separate it to fadeIn() and fadeOut() function, i think u can make it from the sample above…  
search [www.proto.layer51.com](http://www.proto.layer51.com) for more fade function…

---

<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: [April 22, 2003, 5:54pm UTC](https://forum.kirupa.com/t/are-fadein-and-fadeout-difficult/18916/5 "2003-04-22T17:54:36Z")

</div>

this is for the fadeOut function

```auto
MovieClip.prototype.fadeOut = function(speed) {
	this._alpha = 100;
	this.onEnterFrame = function() {
		this._alpha -= speed;
		if (this._alpha<=0) {
			this._alpha = 0;
			delete (this.onEnterFrame);
		}
	};
};

```

the fadeIn it would be easy now isn’t it??

---

<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: [April 23, 2003, 7:22am UTC](https://forum.kirupa.com/t/are-fadein-and-fadeout-difficult/18916/6 "2003-04-23T07:22:09Z")

</div>

Thanx.  
indojepang.  
I have to check this script and if i have problem.  
may i ask question?

---

<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: [April 23, 2003, 9:07am UTC](https://forum.kirupa.com/t/are-fadein-and-fadeout-difficult/18916/7 "2003-04-23T09:07:38Z")

</div>

sure… if ican help…😛

---

<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: [April 23, 2003, 11:43am UTC](https://forum.kirupa.com/t/are-fadein-and-fadeout-difficult/18916/8 "2003-04-23T11:43:24Z")

</div>

Sorry indojepang.  
That script doesn’t work.  
Can u attach a fla file. Or explain usega of that script a little more.  
THanx

---

<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: [April 23, 2003, 12:20pm UTC](https://forum.kirupa.com/t/are-fadein-and-fadeout-difficult/18916/9 "2003-04-23T12:20:14Z")

</div>

this is the fla that use fade() function, another is comin: fadeIn() & fadeOut()…

btw last night i copied too much function for u… 🙂 feel sleepy…

---

<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: [April 23, 2003, 12:20pm UTC](https://forum.kirupa.com/t/are-fadein-and-fadeout-difficult/18916/10 "2003-04-23T12:20:35Z")

</div>

prototypes are a bit confusing for new users, indojepang… but it looks like you have a good feel for them. I may pick your brain soon as I’m trying to develope a tutorial explaining them in newbie terms.

I look forward to you trying to explain them to mngBJ. 🙂

---

<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: [April 23, 2003, 12:32pm UTC](https://forum.kirupa.com/t/are-fadein-and-fadeout-difficult/18916/11 "2003-04-23T12:32:12Z")

</div>

i experienced the same trouble before…🙂  
btw it would be a great tutorial !!!

---

<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: [April 23, 2003, 12:42pm UTC](https://forum.kirupa.com/t/are-fadein-and-fadeout-difficult/18916/12 "2003-04-23T12:42:14Z")

</div>

this is the 2nd fla…  
I hope i’m not wastin page here…😛

---

<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: [April 24, 2003, 4:48am UTC](https://forum.kirupa.com/t/are-fadein-and-fadeout-difficult/18916/13 "2003-04-24T04:48:29Z")

</div>

Thanx. indojepang.  
That’s just what i need. And I will finish my work. so easy.  
And again thanx

---

<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: [April 24, 2003, 10:52am UTC](https://forum.kirupa.com/t/are-fadein-and-fadeout-difficult/18916/14 "2003-04-24T10:52:14Z")

</div>

u welcome…🙂 function is ROck!!

---

<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: [April 25, 2003, 6:34am UTC](https://forum.kirupa.com/t/are-fadein-and-fadeout-difficult/18916/15 "2003-04-25T06:34:09Z")

</div>

Can i switch a variables between 2 different swfs.  
What i mean is  
In my firts.swf contain a number. (i=5)  
So in the second.swf begins frame number 5. COz i took i=5;  
if i=6 second.swf begins from 6-th frame.

Is it possible? :_( :_(

---

<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: [April 25, 2003, 5:27pm UTC](https://forum.kirupa.com/t/are-fadein-and-fadeout-difficult/18916/16 "2003-04-25T17:27:09Z")

</div>

i don’ get the picture here… what do u wanna do?

---

<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: [April 26, 2003, 7:47am UTC](https://forum.kirupa.com/t/are-fadein-and-fadeout-difficult/18916/17 "2003-04-26T07:47:49Z")

</div>

in a one word: that is i wanna run my swf at any frame number?  
that is maybe i can do.  
And also FMX how can i draw a rectangle using action script?

---

<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: [April 26, 2003, 2:36pm UTC](https://forum.kirupa.com/t/are-fadein-and-fadeout-difficult/18916/18 "2003-04-26T14:36:52Z")

</div>

sorry i really don’t understand… may be someone can help u with that…  
but for draw rectangle, search [http://proto.layer51.com/default.aspx](http://proto.layer51.com/default.aspx)

---

<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: [April 28, 2003, 11:53am UTC](https://forum.kirupa.com/t/are-fadein-and-fadeout-difficult/18916/19 "2003-04-28T11:53:43Z")

</div>

Thanx. indojepang.
