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