type = 'application/x-shockwave-flash'
data = 'http://sitepointstatic.com/flash/fadingtext.swf'
width = '400'
height = '400'
bgcolor = 'black'
>

Download the sample files here, then follow these steps to create this great effect…

1. Create any text of your choice, and convert the text to a movie clip.

2. Right click the movie clip, and insert these actions:

onClipEvent (load) 
{
this._alpha = 20;
}
onClipEvent (enterFrame)
{
ax = Math.abs(this._x-_root._xmouse);
ay = Math.abs(this._y-_root._ymouse);
incr = Math.max(ax, ay);
if (incr<=80)
{
this._alpha = 100-incr;
} else {
this._alpha = 20;
}
}

3. Copy this movie clip.

That’s all you need to do! Play the movie, and move the mouse over the text to see the effect at work.

Georgina has more than fifteen years' experience writing and editing for web, print and voice. With a background in marketing and a passion for words, the time Georgina spent with companies like Sausage Software and sitepoint.com cemented her lasting interest in the media, persuasion, and communications culture.

Get your free chapter of Level Up Your Web Apps with Go

Get a free chapter of Level Up Your Web Apps with Go, plus updates and exclusive offers from SitePoint.


No Reader comments

Related books & courses
Available now on SitePoint Premium

Preview for $1