Post for my girl, From Dave

This is just a little write up I’m doing for my little lady. Everyone else can ignore. :slight_smile:

Mind you sweety… I’m going to have to test this. I’m sure that there will be at least one error in this thing. :slight_smile:


first create your square, select it, and hit F8 to make it a movie clip. Give it a library reference name of “sq0”.

then in Frame 1 of an action script layer on the main timeline

//this first function initiates your movie by attaching instances of the sq clip to the stage and then positions them randomly over a 300 by 100 area
function initiateMovie(){
for (i=1;i<6;i++){
_root.attachMovie(sq0,“sq”+i,i);
_root[“sq”+i]._x=Math.random()*300-1;
_root[“sq”+i]._y=Math.random()*100-1;
}
}
//this function replaces a movie clip to a new location and then sets it’s visibility back to true
function replace(){
_x=Math.random()*300-1;
_y=Math.random()*100-1;
_alpha=100;
}
//this function fades the clip out in 1 pt steps. this can be increased by setting the last statement in the for loop to i-=5
function fadeOut(){
for(i=100;i>-1;i–){
_alpha=i;
}
replace();
}


frame 2 of the main timeline

initiateMovie();


as far as the rest of it… you’ll have to get back to me on exactly when and why you’ll have the movie clips fade out… but it’s easy enough to call out to the fadeOut function via any timeline or button simply by calling

_root.fadeOut();


If any of your Kirupians notice an error, feel free to let me know… There are usually a couple when I’m doing this from my head rather than in Flash.

One here :

  _root.attachMovie("sq0","sq"+i,i);

What is this for ??

pom 0]

eh… it’s a moot point now because I ended up doing it entirely differently.

that command was for attaching a movie clip from the library to the stage… not sure if it worked or not… probebly no… I know when I tried applying this to Flash I had all sorts of problems. Got really pissed, changed everything around, then discovered that I hadn’t set export linkage for the movie clip… by then I couldn’t figure out what it was supposed to look like anymore.

Then to top it off… I finaly get something working and she comes to me and says, “oh no… that’s not the effect I was talking about at all.”

It was a frustrating day. :slight_smile: