# I need help creating a class please

**URL:** <https://forum.kirupa.com/t/i-need-help-creating-a-class-please/268540>\
**Category:** Uncategorized\
**Created:** [August 15, 2008, 12:52am UTC](https://forum.kirupa.com/t/i-need-help-creating-a-class-please/268540 "2008-08-15T00:52:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fs\_tigre](https://avatars.discourse-cdn.com/v4/letter/f/edb3f5/32.png) [@fs\_tigre](https://forum.kirupa.com/u/fs_tigre)\
**Post date:** [August 15, 2008, 12:52am UTC](https://forum.kirupa.com/t/i-need-help-creating-a-class-please/268540/1 "2008-08-15T00:52:20Z")

</div>

Hi,

What I want to do is create a class to fade all my links. I would like to be able to re-use this class in any future project.

I do not want to link the class directly to the object or to the Document class in the FLA file,  
what I want is to create an object of the class in my .fla file and than apply a method from the class to any object in the my .fla file.

This is what I have, but obviously it doesn’t work. Help please…

package {  
import flash.display.MovieClip;

```
public class FadeIt extends MovieClip {

	function fadeThis(fade:Number):void {
		this.target.alpha = fade;
		
	}
}

```

}

//FLA FILE:

var fading:FadeIt = new FadeIt();

myMc.FadeIt.fadeThis(.5);

Thanks,  
fs\_tigre
