# Random Fading Grid

**URL:** https://forum.kirupa.com/t/random-fading-grid/253977
**Category:** flash
**Created:** [March 6, 2008, 10:35pm UTC](https://forum.kirupa.com/t/random-fading-grid/253977 "2008-03-06T22:35:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tolgainam](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tolgainam](https://forum.kirupa.com/u/tolgainam)
#### Post date: [March 6, 2008, 10:35pm UTC](https://forum.kirupa.com/t/random-fading-grid/253977/1 "2008-03-06T22:35:03Z")

</div>

Hello;

I’d like to make a 30x30 grid system.  
When Flash is launched it selects a random box in the 30x30 grid and then  
displays the boxes there( alpha 0 to alpha 100) then the other 4 boxes above,bottom , left and to the right of it and then continue like this until this ends (whole grid displayed) Please , I need help.

I wrote smth like that:

function displayBox() {  
startPoint = random(amH\*amV);  
box.duplicateMovieClip(“box”+startPoint, depth);  
focus = this[“box”+int(startPoint)];  
focusU = this[“box”+int(startPoint-amH)];  
focusD = this[“box”+int(startPoint+amH)];  
focusL = this[“box”+int(startPoint-1)];  
focusR = this[“box”+int(startPoint+1)];  
visibleBoxes.push(focus,focusU,focusD,focusL,focusR);

```
trace(focus+" "+focusU+" "+focusD+" "+focusL+" "+focusR);
trace(visibleBoxes);
}

```

displayBox();

but cant calculate further.
