# How can I pass a parameter from a class to an object created in the .fla file?

**URL:** <https://forum.kirupa.com/t/how-can-i-pass-a-parameter-from-a-class-to-an-object-created-in-the-fla-file/268638>\
**Category:** flash\
**Created:** [August 16, 2008, 11:45am UTC](https://forum.kirupa.com/t/how-can-i-pass-a-parameter-from-a-class-to-an-object-created-in-the-fla-file/268638 "2008-08-16T11:45:40Z")\
**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 16, 2008, 11:45am UTC](https://forum.kirupa.com/t/how-can-i-pass-a-parameter-from-a-class-to-an-object-created-in-the-fla-file/268638/1 "2008-08-16T11:45:40Z")

</div>

Hi,

I have this class, which is working fine, but I would like to pass a parameter to the objects in my .fla file and I have no idea how.

This is a class that can be apply to any object to fade it, the problem is that the alpha percentage is fixed, and I would like to have different percentage on each object.

How could I accomplish this task?

package {  
import flash.display.MovieClip;  
import flash.events.MouseEvent;  
import gs.TweenLite;  
import fl.motion.easing.\*;

public class TestClass {  
private var \_clip:MovieClip;  
public function TestClass(clip:MovieClip) {  
\_clip = clip;

\_clip.addEventListener(MouseEvent.MOUSE\_OVER, fadeIn);  
\_clip.addEventListener(MouseEvent.MOUSE\_OUT, fadeOut);  
}  
function fadeIn(event:MouseEvent) {

TweenLite.to(\_clip,1,{alpha:.5});

}  
function fadeOut(event:MouseEvent) {

TweenLite.to(\_clip,1,{alpha:1});

}  
}  
}

// This is the code I’m using in my fla file (objects in my fla file)

var testing:TestClass= new TestClass(myMc);  
var testing2:TestClass= new TestClass(myMc2);  
var testing3:TestClass= new TestClass(myMc3);

Thank you to all in advance,  
fs\_tigre
