# Movieclip name question

**URL:** https://forum.kirupa.com/t/movieclip-name-question/289420
**Category:** Uncategorized
**Created:** [May 30, 2009, 12:44am UTC](https://forum.kirupa.com/t/movieclip-name-question/289420 "2009-05-30T00:44:15Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![DanFitz](https://avatars.discourse-cdn.com/v4/letter/d/df705f/32.png) [@DanFitz](https://forum.kirupa.com/u/DanFitz)
#### Post date: [May 30, 2009, 12:44am UTC](https://forum.kirupa.com/t/movieclip-name-question/289420/1 "2009-05-30T00:44:15Z")

</div>

Hi everyone,

I was hoping to assign actionscript to a grid of tiles, in total there is about 80 individual tiles that I have made into movieclips. At the moment I would be looking at writing actionscript to change the alpha based on the distance from the mouse, for **each** individual tile.

where t01,t02,… is the tile:

stop()  
onEnterFrame = function () {  
xdist = Math.round(\_xmouse - t01.\_x)  
ydist = Math.round(\_ymouse - t01.\_y)  
AA = Math.round(Math.sqrt((xdist_xdist) + (ydist_ydist)))  
t01.\_alpha = (100-AA)+20  
xdist = Math.round(\_xmouse - t02.\_x)  
ydist = Math.round(\_ymouse - t02.\_y)  
AB = Math.round(Math.sqrt((xdist_xdist) + (ydist_ydist)))  
t02.\_alpha = (100-AB)+20  
…ect  
}

It can be done this way and I dont mind doing it, but would there be a smarter/cleaner way to do this.

any help would be appreciated

thanks in advance
