# Tween alpha of an array?

**URL:** https://forum.kirupa.com/t/tween-alpha-of-an-array/262144
**Category:** Uncategorized
**Created:** [June 3, 2008, 6:39pm UTC](https://forum.kirupa.com/t/tween-alpha-of-an-array/262144 "2008-06-03T18:39:41Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![kevincompton](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kevincompton/32/4049_2.png) [@kevincompton](https://forum.kirupa.com/u/kevincompton)
#### Post date: [June 3, 2008, 6:39pm UTC](https://forum.kirupa.com/t/tween-alpha-of-an-array/262144/1 "2008-06-03T18:39:41Z")

</div>

I am using the Fuse class ([mosessupposes.com](http://mosessupposes.com)) for most tweens that I do, but I can’t seem to target an array with the class.

Regardless all I’m trying to do is take this array (it actually has way more strings but you get the idea):

```auto
var clipArray:Array = new Array("full01_07", "full02_07", "full03_07");

```

And when I click a btn it fades out everything in the array to alpha:0.

Here is the code I use for fuse:

```auto
var hideClips:Fuse = new Fuse();
		
		hideClips.push({target: ????? , alpha:0, time:.25, ease:"easeInQuad"});
		hideClips.start();

```

BEFORE YOU REPLY, i did try target:clipArray\*, it doesn’t work.

---

<div class="post-metadata">

### Author: ![sparkdemon](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@sparkdemon](https://forum.kirupa.com/u/sparkdemon)
#### Post date: [June 3, 2008, 8:47pm UTC](https://forum.kirupa.com/t/tween-alpha-of-an-array/262144/2 "2008-06-03T20:47:19Z")

</div>

You want to tween an array ??? thats not a visual object/property…

or may be you want to tween on all items in the array which are actually visual object/property…

---

<div class="post-metadata">

### Author: ![kevincompton](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kevincompton/32/4049_2.png) [@kevincompton](https://forum.kirupa.com/u/kevincompton)
#### Post date: [June 3, 2008, 8:49pm UTC](https://forum.kirupa.com/t/tween-alpha-of-an-array/262144/3 "2008-06-03T20:49:09Z")

</div>

Yes sorry, to clarify each item in the string is an MC, I want to tween the alpha of the MC’s in the array. I made an array because there are 26 MC’s that need to be tweened for 26 buttons. SO I just want to make a function that I can call that simply fades them all out then fades in the one I need.

But of course, you actually knew what I meant so ya.

---

<div class="post-metadata">

### Author: ![sparkdemon](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@sparkdemon](https://forum.kirupa.com/u/sparkdemon)
#### Post date: [June 3, 2008, 9:02pm UTC](https://forum.kirupa.com/t/tween-alpha-of-an-array/262144/4 "2008-06-03T21:02:09Z")

</div>

//just a code snippet… hope it helps…  
//Well i am into Tweener… however not much difference anyway…

import caurina.transitions.Tweener;

counter=0;  
for(var i=0;i\<clipArray.length;i++)  
{  
Tweener.addTween(clipArray\*, {\_alpha:0, time:1,transition:“linear”, onComplete:function() { \_root.setComplete(clipTofadein);}});  
}

function setComplete(clipTofadein:Movieclip)  
{  
counter++;  
if(counter\>=clipArray.length)  
{  
Tweener.addTween(clipTofadein, {\_alpha:100, time:1,transition:“linear”);  
}  
}

---

<div class="post-metadata">

### Author: ![kevincompton](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kevincompton/32/4049_2.png) [@kevincompton](https://forum.kirupa.com/u/kevincompton)
#### Post date: [June 4, 2008, 7:34pm UTC](https://forum.kirupa.com/t/tween-alpha-of-an-array/262144/5 "2008-06-04T19:34:32Z")

</div>

First off that code throws up errors, I have caurina installed.

Secondly inputing a whole other class for this simple feature is probably not needed. Does anyone know how to do it with Fuse, OR how to do it with simple mx transitions?

---

<div class="post-metadata">

### Author: ![snickelfritz](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@snickelfritz](https://forum.kirupa.com/u/snickelfritz)
#### Post date: [June 4, 2008, 9:05pm UTC](https://forum.kirupa.com/t/tween-alpha-of-an-array/262144/6 "2008-06-04T21:05:06Z")

</div>

I’m not well versed in Tweener and AS2, but here’s an example using TweenMax and AS3.  
Adapt it suit your project.

Example: [[COLOR=“Blue”][U]http://www.byrographics.com/AS3/hideArray/hideArray.html[/U][/COLOR]](http://www.byrographics.com/AS3/hideArray/hideArray.html)

```auto
/*
the following AS3 code hides the array on mouse down, and shows the array on mouse up.
I've also added a .1 delay increment, so they hide and show in succession.
*/
stop();
import gs.TweenMax;

var myArray:Array = [mc1,mc2,mc3];

function hideClips(event:MouseEvent):void{
	TweenMax.allTo(myArray, .2, {autoAlpha:0, delayIncrement:.1});
}

function showClips(event:MouseEvent):void{
	TweenMax.allTo(myArray, .2, {autoAlpha:1, delayIncrement:.1});
}

stage.addEventListener(MouseEvent.MOUSE_DOWN, hideClips, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, showClips, false, 0, true);

```

---

<div class="post-metadata">

### Author: ![rondog](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rondog/32/2478_2.png) [@rondog](https://forum.kirupa.com/u/rondog)
#### Post date: [June 4, 2008, 10:42pm UTC](https://forum.kirupa.com/t/tween-alpha-of-an-array/262144/7 "2008-06-04T22:42:26Z")

</div>

yea make sure your array of movie clips aren’t in quotes like you have them. Right now you have them set as strings.

do them as a sequence:

```auto

import com.mosesSupposes.fuse.*;
ZigoEngine.simpleSetup(Shortcuts,PennerEasing);

var clipArray:Array = new Array(clip0, clip1, clip2);

var hideClips:Fuse = new Fuse();

for (var i = 0; i < clipArray.length; i++) {
    hideClips.push({target:clipArray*, alpha:0, time:.25, ease:"easeInQuad"});
    hideClips.start();
}

```

or all at the same time:

```auto

import com.mosesSupposes.fuse.*;
ZigoEngine.simpleSetup(Shortcuts,PennerEasing);

var clipArray:Array = new Array(clip0, clip1, clip2);

var hideClips:Fuse = new Fuse();

for (var i = 0; i < clipArray.length; i++) {
    clipArray*.alphaTo(0,0.5,"easeOutExpo");
}

```
