# Tween Class Problem: How to make one instance independent from another

**URL:** <https://forum.kirupa.com/t/tween-class-problem-how-to-make-one-instance-independent-from-another/174281>\
**Category:** flash\
**Created:** [January 4, 2006, 11:50am UTC](https://forum.kirupa.com/t/tween-class-problem-how-to-make-one-instance-independent-from-another/174281 "2006-01-04T11:50:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bird\_Killer](https://avatars.discourse-cdn.com/v4/letter/b/4da419/32.png) [@Bird\_Killer](https://forum.kirupa.com/u/Bird_Killer)\
**Post date:** [January 4, 2006, 11:50am UTC](https://forum.kirupa.com/t/tween-class-problem-how-to-make-one-instance-independent-from-another/174281/1 "2006-01-04T11:50:06Z")

</div>

I was working on a Flash 8 work using the Tween Class with the help from the Kirupa and gotoAndLearn() tutorials.

Here’s the actionscript code:

> import mx.transitions.Tween;  
> import mx.transitions.easing.\*;  
> import flash.filters.GlowFilter;

//creates Glow Filter  
var gf:GlowFilter = new GlowFilter(0x16004D, 100, 1, 1, 1, 3, false, false);

//assigns Glow Filter and its “first look” properties to the object  
var gfX:Tween = new Tween(gf, “blurX”, Elastic.easeOut, 5, 5, 1, true);  
var gfY:Tween = new Tween(gf, “blurY”, Elastic.easeOut, 5, 5, 1, true);  
var gfS:Tween = new Tween(gf, “strength”, Elastic.easeOut, 1, 1, 1, true);  
var gfC:Color = new Color(text1);

//=======================================================================

//Object 1  
text1.onRollOver = changeOver;  
text1.onRollOut = changeOut;  
motionChanged(text1);

//Object 2  
text2.onRollOver = changeOver;  
text2.onRollOut = changeOut;  
motionChanged(text2);

//=================================================

function changeOver()  
{  
gfX.continueTo(40, 2);  
gfY.continueTo(40, 2);  
gfS.continueTo(3, 2);  
gfC.setRGB(0xC7CEC1);  
}

//------------------------------------------------

function changeOut()  
{  
gfX.continueTo(5, 2);  
gfY.continueTo(5, 2);  
gfS.continueTo(1, 2);  
gfC.setRGB(0x000000);  
}

//------------------------------------------------

function motionChanged (textClip)  
{  
gfX.onMotionChanged = function()  
{  
textClip.filters = [gf];  
}  
}

Now, my problem is that when I move my mouse over one of the object, the other object also reacts. Say I roll my mouse over [COLOR=Blue]text2[/COLOR], [COLOR=Red]text1[/COLOR] reacts as if the object too has a mouse over it. Another problem is that only [COLOR=Blue]text2[/COLOR] is showing the tween class.

I want these two instances to be independent from each other while at the same time not having to create actionscripts that is exclusively dedicated to each instances (if possible). I want to make sure that if I have the mouse over one of the instance, it will be the only instance to react.

Thanks.
