# Opacity for movie array

**URL:** <https://forum.kirupa.com/t/opacity-for-movie-array/273535>\
**Category:** Uncategorized\
**Created:** [October 16, 2008, 3:21pm UTC](https://forum.kirupa.com/t/opacity-for-movie-array/273535 "2008-10-16T15:21:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![j\_polo9](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@j\_polo9](https://forum.kirupa.com/u/j_polo9)\
**Post date:** [October 16, 2008, 3:21pm UTC](https://forum.kirupa.com/t/opacity-for-movie-array/273535/1 "2008-10-16T15:21:34Z")

</div>

hello all! I’m taking a swing at flash again. I am wondering how i can set the opacity of a movie to dissapear as it nears the edge of my stage.

Right now i am creating an array of my movie ‘word’ to randomly generate up to 10 instances moving at random speeds and appearing with random opacity. here is my code so far:

```auto
var TargetWordsArray:Array = new Array();
var maxTargetWords:Number = 10;
function addTargetWords(e:Event)
{
 var word:TargetWords = new TargetWords();
 word.x = Math.random() * stage.stageWidth/2;
 word.y = Math.random() * stage.stageHeight/2;
 word.alpha = Math.random() *.8 + .2;
 word.scaleX = word.scaleY = Math.random() * .8 + .2;
 word.xMovement = Math.random() * 10-5;
 word.yMovement = Math.random() * 10-5;
 TargetWordsArray.push(word);
 addChild(word);
 word.cacheAsBitmap = true;
 
 if (TargetWordsArray.length >= maxTargetWords)
 {
  removeChild(TargetWordsArray.shift());
 }
 
 word.addEventListener(Event.ENTER_FRAME,moveTargetWords);
}
function moveTargetWords(e:Event)
{
 e.currentTarget.x += e.currentTarget.xMovement;
 e.currentTarget.y += e.currentTarget.yMovement;
}
var myTimer:Timer = new Timer(100);
myTimer.addEventListener(TimerEvent.TIMER, addTargetWords);
myTimer.start();

```

So i need to figure out how to set the opacity to lower as it nears the edge of te stage. And then i need to set it so that the left 250 pixels is the left edge it dissapears to so it does not cover the logo.

[[COLOR=#800080]www.norcaldesigns.com[/COLOR]](http://www.norcaldesigns.com/)  
Roseville Website Design.
