Ok,
I tried it, and my code was ok - except for the this.expBall._visible = false;
Don't put that in because it will hide all the duplicated mc's.
Draw a small ball
select the ball
make it into a movieclip ("Shapes" > "Convert to movie clip")
name the movieclip "expBall" in the "shapes" dialog box (F9)
select expBall and make that into a movie clip
select this Movie clip on the stage (probably called mc2)and double click it to show the properties dialog box.
click the "Actions" under "behavior" tab in the properties box.
click the "+"
click "Action script"
and paste this code into the AS editor.
Close the dialog boxes and test the movieCode:onClipEvent(load) { perspective = 300; anglespeed = Math.PI/72; tilt = 3; radius = 36; nBalls = 12; startx1 = 45; startx2 = 145; startx3 = 245; starty = 30; for (i=1;i<=nBalls*3;i++) { expBall.duplicateMovieClip("mcBall"+i, i); this["mcBall"+i].angle = i * Math.PI*2/nBalls; } } onClipEvent(enterFrame) { expBall._visible = false; if (!_root.turnedOff) { for (i=1;i<=nBalls;i++) { mcrBall = this["mcBall"+i] mcrBall.angle += anglespeed; a = Math.sin(mcrBall.angle)*radius; b = Math.cos(mcrBall.angle)*radius; scalar = perspective/(b+perspective); mcrBall._x = a*scalar + startx1; mcrBall._y = b*scalar/tilt + starty; mcrBall._xscale = scalar*100; mcrBall._yscale = scalar*100; mcrBall._alpha = (120-b)/2; } for (i=nBalls+1;i<=nBalls*2;i++) { mcrBall = this["mcBall"+i] mcrBall.angle += anglespeed; a = Math.cos(mcrBall.angle)*radius; b = Math.tan(mcrBall.angle)*radius; scalar = perspective/(b+perspective); mcrBall._x = a*scalar + startx2; mcrBall._y = b*scalar/tilt + starty; mcrBall._xscale = scalar*100; mcrBall._yscale = scalar*100; mcrBall._alpha = (120-b)/2; } for (i=nBalls*2+1;i<=nBalls*3;i++) { mcrBall = this["mcBall"+i] mcrBall.angle -= anglespeed; a = Math.sin(mcrBall.angle)*radius; b = Math.cos(mcrBall.angle)*radius; scalar = perspective/(b+perspective); mcrBall._x = a*scalar + startx3; mcrBall._y = b*scalar/tilt + starty; mcrBall._xscale = scalar*100; mcrBall._yscale = scalar*100; mcrBall._alpha = (120-b)/2; } } }
Phew!
A bit over the top, but someone else might find it useful
Hilary
--
BTW - all this great code comes from http://actionscript-toolbox.com/
[Edited by bridelh on 07-03-2002 at 11:28 AM]




Reply With Quote