I’m checking out the Vibration Effect tutorial in the Flash MX/Special effects tutorials and there’s a few things I’d like to make it do but I can’t seem to get it. Still learning AS as I go.
The example given is to randomly generate within a specified sized area a certain number of little perfectly round balls that continuously vibrate.
First, I’d like to use a different shape which is not a problem to create; but what is the problem is that now I’d like for the shape to be created at random angles when the movie plays. The way the code is now, all the shapes are facing the exact same direction. You just don’t notice it when the shapes are perfectly round. So anyway, I would think that would be an easy thing to add into the script.
Next, if I were to animate the single shape movie clip in itself (as in maybe a 10 frame little shape tween or something) and generate the movie, all of the rendered shapes perform their little animations all exactly in sync (of course). Is there a way to randomly vary the speed of each generated shape’s animation?
Lastly. I’d like to be able to mask an area over the little shapes so that they only show within certain borders in the shape of a circle. When I create a mask in the layer above the shapes, they still generate in accordance with the area they’re restricted to within the script. even beyond the boundries of the mask. Anyway to fix that?
Well, there it is. I’m pretty sure that all 3 solutions are pretty simple, I just don’t know enough AS yet to come up with it myself. I have a feeling I’ll learn a bit more from trying to do this. I’ve torn the script all up attempting this but to no avail.
Anyone help??
for all you gurus that don’t need to see anything but the script to understand me, here’s it is:
This is the script in the first frame of the timeline:
[AS]for (var i = 0; i<25; i++) {
circle.duplicateMovieClip(i, i);
}[/AS]
and this is the script within the ball movie clip:
[AS]onClipEvent (load) {
//movie width/height
height = 200;
width = 300;
//------------------------//
//makes everything random //
//------------------------//
this._x = Math.round(Math.random()*width);
this._y = Math.round(Math.random()*height);
var temp = this._alpha=Math.random()*100;
this._xscale = this._yscale=temp;
//setting initiaion position
cx = this._x;
cy = this._y;
}
onClipEvent (enterFrame) {
//causes the object to be offset
this._x = cx+(1+Math.random()*5);
this._y = cy+(Math.random()*5);
}[/AS]
THANKS FOR ANY HELP!