ࡱ> Root Entryp|YrRASH`#5)Contents*Page 1(Symbol 24F $ !"#%(+,-./0129:Root Entryp|YrRASH6`5)ContentsHPage 1&(Symbol 24F $%('345678;<=>?@ABCDEFGIJKLMNOPQRSymbol 35Symbol 18Symbol 35Symbol 18CPicPage CPicLayer CPicFrame CPicSpritevvdtitle? backgroundzzdorigin?origin CPicButton1(d2on (release, keyPress "") { init(); } CPicText;8 radiusInputArial(150;o8 centerYinputArial(200BZZZB<B>|*4W(4>|44Æ4z4>*4W(z?Layer 1l 8@Arial(y origin?8@Arial(radiusw;8 centerXinputArial(230 8@Arial(x origin!<8rpmInputArial(108@Arial(rpm CPicShape sf3'sf3ssf3 6J~>&h݀`#`#U`1T#`#`##U`1܀T`##&o8  numBallsInputArial(5#8@Arial(numBalls;o8ellipseWidthInput_sans(1l 1}@ _sans(ellipse widthsf3 ;o8ellipseHeightInput_sans(.11}@_sans(ellipse heightsf3;o8 rotationInput_sans(201@_sans(rotation angle+sf3d;o8rotationRPMInput_sans(51@ _sans(rotation rpmsf3d#8 maxScaleInput_sans(100@ _sans(max scaleg sf3&C @ 8@_sans(%d8 minScaleInput_sans(20z@ _sans(max scalesf3C @ 8@_sans(%We=`1T#`#`##U`1܀T`##h݀`#`#U3  $ހ?`##h݀`#`#U`1T#`#`##U ?controls?// disable yellow box around buttons accessed via the keyboard _focusrect = 0; // Initialize movement speed and start time. function init () { // First, clear the stage of any previous balls. removeBalls(); // Now make a new set of balls. makeBalls(parseInt(numBallsInput)); // Done initializing, now start the event loop toSymbol 227Symbol 20'Symbol 19!MSymbol 7 ;  "#$%&()*+,-./012345689:;<=>?@ABCDEJGHIKLMNOPQLayer 3OO?8@Arial(radiusw;8 centerXinputArial(230 8@Arial(x origin!<8rpmInputArial?CPicTextU@_sans(point of origin?Layer 2fCPicPage CPicLayer CPicFrame CPicSha move the object this.attachMovie("processDoMove", "processDoMove", 10000) // Do interface set up (set point of origin, fade title out) origin._x = parseFloat(centerXInput); origin._y = parseFloat(centerYInput); title._alpha = 30; } // Function to move a clip with each passing frame. function moveClipAroundCircle (theClip) { // Determine how much time has passed theClip.then = theClip.now; theClip.now = getTimer(); var elapsed = theClip.now - theClip.then; var numSeconds = elapsed / 1000; // Find out how many degrees to increment this frame. var degreeIncrement = theClip.degreesPerSecond * numSeconds; // Update the angle theClip.theta += degreeIncrement; // Keep the angle between -360 and 360 degrees theClip.theta %= 360; // Find radian version of theta. // Required by cos and sin functions. var radians = degreesToRadians(theClip.theta); // Figure out where the clip resides on the ellipse around which it's travelling. var xOnEllipse = theClip.ellipseWidth * (Math.cos(radians) * theClip.radius); var yOnEllipse = theClip.ellipseHeight * (Math.sin(radians) * theClip.radius); // ===Deal with ellipse rotation=== // First, determine amount to increment ellipse's rotation, // based on elapsed time and rotation speed. var rotationDegreeIncrement = theClip.rotationDegreesPerSecond * numSeconds; // Update the ellipse's rotation. theClip.rotationTheta += rotationDegreeIncrement; // Keep the rotation angle between -360 and 360 degrees theClip.theta %= 360; // Apply the ellipse's rotation to the ball's position. var rotationRadian = degreesToRadians(theClip.rotationTheta); var rotatedX = xOnEllipse * Math.cos(rotationRadian) - yOnEllipse * Math.sin(rotationRadian); var rotatedY = xOnEllipse * Math.sin(rotationRadian) + yOnEllipse * Math.cos(rotationRadian); // All done calculating position. Now place the clip on the circle. theClip._x = theClip.centerX + rotatedX; theClip._y = theClip.centerY - rotatedY; } // Simulates a 3d effect without the work of bothering with a z-axis. // Doesn't handle z-sorting, so we use alpha to fake it. It's a bit of a hack, // but it gets the job done in some circumstances. function addDepthEffect (theClip) { // Transform the object's size and transparency. sin(theta) oscillates // between -1 and 1, so we and 1 to it and use that to scale and fade our balls. var degreeSin = Math.sin(degreesToRadians(theClip.theta)); // Adjust size theClip._xscale = theClip.minScale + ((degreeSin + 1) / 2) * (theClip.maxScale - theClip.minScale); theClip._yscale = theClip.minScale + ((degreeSin + 1) / 2) * (theClip.maxScale - theClip.minScale); // Adjust transparency theClip._alpha = (theClip.minScale + ((degreeSin + 1) / 2) * (theClip.maxScale - theClip.minScale)); } // Makes a series of ball clips function makeBalls (numBalls) { // Create an array to hold the balls. We'll use this array // later when managing the balls as a group. ballList = new Array(); // Create each ball clip for (var i = 0; i < numBalls; i++) { // Put the clip on stage this.attachMovie("ball", "ball" + i, i); // Store a convenient reference to this ball clip. var thisBall = this["ball" + i]; // Define ball properties. We set these programmatically, but // more customized behaviour could be created by hand... // Start with user input values. thisBall.rpm = parseFloat(rpmInput); thisBall.radius = parseFloat(radiusInput); thisBall.centerX = parseFloat(centerXinput); thisBall.centerY = parseFloat(centerYinput); thisBall.ellipseWidth = parseFloat(ellipseWidthInput); thisBall.ellipseHeight = parseFloat(ellipseHeightInput); thisBall.rotationTheta = parseFloat(rotationInput); thisBall.rotationRPM = parseFloat(rotationRPMInput); thisBall.maxScale = parseFloat(maxScaleInput); thisBall.minScale = parseFloat(minScaleInput); // Now assign programmatic properties thisBall.theta = 0 + (i * (360/numBalls)); // angle of object, measured counterclockwise from the positive x-axis thisBall.degreesPerSecond = thisBall.rpm * 360 / 60; // amount to move per second thisBall.rotationDegreesPerSecond = thisBall.rotationRPM * 360 / 60; // amount to rotate the ellipse per second thisBall.now = getTimer(); // Place the ball way off stage so it doesn't show up before // it starts moving around the center point. thisBall._x = -1000; thisBall._y = -1000; // Add this ball to the list ballList[i] = thisBall; } } // Cleans the stage of all ball clips. function removeBalls () { for (var i = 0; i < ballList.length; i++) { ballList[i].removeMovieClip(); } } // Moves all the ball clips in ballList around the circle. function moveBalls () { for (var i = 0; i < ballList.length; i++) { moveClipAroundCircle(ballList[i]); addDepthEffect(ballList[i]); } } // Converts degrees to radians. function degreesToRadians(degrees) { return (degrees/180) * Math.PI; }scriptsOO 99 Symbol 22 title textl8F; Symbol 20 button: pointyi81; Symbol 19point of origin\xi8xi8pe7Zq>Lpp<: 4p< 4"<4p"<:7Zqwݴ45vˀdJ4555eJd55veˀCPicText0 @_sansmoving objects_sans _sans _sansalong a X_sans3d-rotatable _sans _sans _sanselliptical_sansmotion_sanspath̙̙CPicPage CPicLayer CPicFrame?CPicPage CPicLayer CPicFrame CPicSpritevvdtitle? backgroundzzdorigin?origin CPicButton1(d2on (release, keyPress "") { init(); } CPicText;8 radiusInputArial(150;o8 centerYinputArial(200Layer 1O̙(! \4;4qr4HIr4qpv4J44ľ h db8#W t4EH3R8.!Z8pz88C4'=0}0 f8r8CA8Z 81O|j8('leZ8[ft"d-?CPicPage CPicLayer CPicFrame CPicSprite8N; Symbol 24 eventLoop99 Symbol 22 title textl8F; Symbol 20 button: pointyi81; Symbol 19point of origin\xi8xi8 Symbol 7 button: go(!8gvi8 Symbol 3ball0;ball0; Symbol 18 processDoMoveSpi8l processDoMove6;*@hhhhh3Vector::Debugging Permitted0Vector::External Font Files0Vector::Generator CommandVector::Preview as GIF0Vector::Override Sounds0Vector::TemplateVector::Protect0Vector::Quality50Vector::Omit Trace Actions0Vector::Debugging PasswordVector::TopDown0"PublishFormatProperties::generatorVector::Report0Vector::Version5Vector::Stream Compress7Vector::Event Format0Vector::Event Compress7Vector::Stream Format0 CColorDef 3330 fff`    x Px x (x xx x  3P fP0 PH P` Px 3 33( 3f<0 3CH 3F` 3Hx 3 33x f3d0 3]H 3Z` 3Xx 33 3330 3f3PPH 33Px` 33Px 33P f0 3f0 ffx0 fkH fd` f`x 3f0 33fPH 3ffxPH 3fdx` 3f]x 3fZ H 3H fH xH ̙n` hx 3H 33x` 3fx` 3xx` 3̙kx 3d ` 3` f` ` x` px 3` 33x 3fx 3x 3xx 3n x 3x fx x x xx 3x 33 3f 3 3 3x f0 f30 ff(0 f5H f<` f@x H 3 H fH (H 2` 8x f30 f33PH ff3(PH f3<x` f3Cx f3F 3H 33x` f3x` 3(x` 35x 3< ff0 f3fPH fff` ffP0x ffPx ffP fH 3fx` ff0x f(0x f<x fC fH f3x` ff0x fx0x f̙dx f] H 3x` f0x  ̙PP P f` f3x ffx fx fxx fk ` 3x fx P xP d fx f3 ff f f fx x 3 f   x ` 3 ` f` ̙` (` 0x x 3x fx x  x (x 3` 33x f3 x ̙3x 3(x 32 3x 33 f3 3 3 3( f` 3fx ffx ̙fx f(x f5 fx 3f ff f f f( ` 3x fx ̙P ̙(P < x 3 f  ̙ ( ` 3x fx ̙P  P x 3 f   ( l 8@Arial(y origin?8@Arial(radiusw;8 centerXinputArial(230 8@Arial(x origin!<8rpmInputArial(108@Arial(rpm CPicShape sf3'sf3ssf3 6J~>&h݀`#`#U`1T#`#`##U`1܀T`##&o8  numBallsInputArial(5#8@Arial(numBalls;o8ellipseWidthInput_sans(1l 1}@ _sans(ellipse widthsf3 ;o8ellipseHeightInput_sans(.11}@_sans(ellipse heightsf3;o8 rotationInput_sans(201@_sans(rotation angle+sf3d;o8rotationRPMInput_sans(51@ _sans(rotation rpmsf3d#8 maxScaleInput_sans(150@ _sans(max scaleg sf3&C @ 8@_sans(%d8 minScaleInput_sans(20z@x 3 f ̙  x x 3 f    (      *] dtz^ h) origin._x = parseFloat(centerXInput); origin._y = parseFloat(centerYInput); title._alpha = 30; } // Function to move a clip with each passing frame. function moveClipAroundCircle (theClip) { // Determine how much time has passed theClip.then = theClip.now; theClip.now = getTimer(); var elapsed = theClip.now - theClip.then; var numSecond _sans(min scalesf3C @ 8@_sans(%We=`1T#`#`##U`1܀T`##h݀`#`#U3  $ހ?`##h݀`#`#U`1T#`#`##U ?controls?// disable yellow box around buttons accessed via the keyboard _focusrect = 0; // Initialize movement speed and start time. function init () { // First, clear the stage of any previous balls. removeBalls(); // Now make a new set of balls. makeBalls(parseInt(numBallsInput)); // Done initializing, now start the event loop to move the object this.attachMovie("processDoMove", "processDoMove", 10000) // Do interface set up (set point of origin, fade title out) origin._x = parseFloat(centerXInput); origin._y = parseFloat(centerYInput); title._alpha = 30; } // Function to move a clip with each passing frame. function moveClipAroundCircle (theClip) { // Determine how much time has passed theClip.then = theClip.now; theClip.now = getTimer(); var elapsed = theClip.now - theClip.then; var numSeconds = elapsed / 1000; // Find out how many degrees to increment this frame. var degreeIncrement = theClip.degreesPerSecond * numSeconds; // Update the angle theClip.theta += degreeIncrement; // Keep the angle between -360 and 360 degrees theClip.theta %= 360; // Find radian version of theta. // Required by cos and sin functions. var radians = degreesToRadians(theClip.theta); // Figure out where the clip resides on the ellipse around which it's travelling. var xOnEllipse = theClip.ellipseWidth * (Math.cos(radians) * theClip.radius); var yOnEllipse = theClip.ellipseHeight * (Math.sin(radians) * theClip.radius); // ===Deal with ellipse rotation=== // First, determine amount to increment ellipse's rotation, // based on elapsed time and rotation speed. var rotationDegreeIncrement = theClip.rotationDegreesPerSecond * numSeconds; // Update the ellipse's rotation. theClip.rotationTheta += rotationDegreeIncrement; // Keep the rotation angle between -360 and 360 degrees theClip.theta %= 360; // Apply the ellipse's rotation to the ball's position. var rotationRadian = degreesToRadians(theClip.rotationTheta); var rotatedX = xOnEllipse * Math.cos(rotationRadian) - yOnEllipse * Math.sin(rotationRadian); var rotatedY = xOnEllipse * Math.sin(rotationRadian) + yOnEllipse * Math.cos(rotationRadian); // All done calculating position. Now place the clip on the circle. theClip._x = theClip.centerX + rotatedX; theClip._y = theClip.centerY - rotatedY; } // Simulates a 3d effect without the work of bothering with a z-axis. // Doesn't handle z-sorting, so we use alpha to fake it. It's a bit of a hack, // but it gets the job done in some circumstances. function addDepthEffect (theClip) { // Transform the object's size and transparency. sin(theta) oscillates // between -1 and 1, so we and 1 to it and use that to scale and fade our balls. var degreeSin = Math.sin(degreesToRadians(theClip.theta)); // Adjust size theClip._xscale = theClip.minScale + ((degreeSin + 1) / 2) * (theClip.maxScale - theClip.minScale); theClip._yscale = theClip.minScale + ((degreeSin + 1) / 2) * (theClip.maxScale - theClip.minScale); // Adjust transparency theClip._alpha = (theClip.minScale + ((degreeSin + 1) / 2) * (theClip.maxScale - theClip.minScale)); } // Makes a series of ball clips function makeBalls (numBalls) { // Create an array to hold the balls. We'll use this array // later when managing the balls as a group. ballList = new Array(); // Create each ball clip for (var i = 0; i < numBalls; i++) { // Put the clip on stage this.attachMovie("ball", "ball" + i, i); // Store a convenient reference to this ball clip. var thisBall = this["ball" + i]; // Define ball properties. We set these programmatically, but // more customized behaviour could be created by hand... // Start with user input values. thisBall.rpm = parseFloat(rpmInput); thisBall.radius = parseFloat(radiusInput); thisBall.centerX = parseFloat(centerXinput); thisBall.centerY = parseFloat(centerYinput); thisBall.ellipseWidth = parseFloat(ellipseWidthInput); thisBall.ellipseHeight = parseFloat(ellipseHeightInput); thisBall.rotationTheta = parseFloat(rotationInput); thisBall.rotationRPM = parseFloat(rotationRPMInput); thisBall.maxScale = parseFloat(maxScaleInput); thisBall.minScale = parseFloat(minScaleInput); // Now assign programmatic properties thisBall.theta = 0 + (i * (360/numBalls)); // angle of object, measured counterclockwise from the positive x-axis thisBall.degreesPerSecond = thisBall.rpm * 360 / 60; // amount to move per second thisBall.rotationDegreesPerSecond = thisBall.rotationRPM * 360 / 60; // amount to rotate the ellipse per second thisBall.now = getTimer(); // Place the ball way off stage so it doesn't show up before // it starts moving around the center point. thisBall._x = -1000; thisBall._y = -1000; // Add this ball to the list ballList[i] = thisBall; } } // Cleans the stage of all ball clips. function removeBalls () { for (var i = 0; i < ballList.length; i++) { ballList[i].removeMovieClip(); } } // Moves all the ball clips in ballList around the circle. function moveBalls () { for (var i = 0; i < ballList.length; i++) { moveClipAroundCircle(ballList[i]); addDepthEffect(ballList[i]); } } // Converts degrees to radians. function degreesToRadians(degrees) { return (degrees/180) * Math.PI; }scriptsOO  CDocumentPage Page 1Scene 1>8O; Symbol 24 eventLoop99 Symbol 22 title textl8F; Symbol 20 button: pointyi81; Symbol 19point of origin\xi8xi8 Symbol 7 button: go(!8gvi8 Symbol 3ball0;ball0; Symbol 18 processDoMoveSpi8l processDoMove6;*@hhhhh3Vector::External Font Files0Vector::Debugging Permitted0Vector::Generator CommandVector::Preview as GIF0Vector::Override Sounds0Vector::Quality50Vector::Protect0Vector::TemplateVector::Debugging PasswordVector::Omit Trace Actions0Vector::TopDown0Vector::Report0"PublishFormatProperties::generatorVector::Event Format0Vector::Stream Compress7Vector::Version5Vector::Event Compress7Vector::Stream Format0 CColorDef 3330 fff`    x Px x (x xx x  3P fP0 PH P` Px 3 33( 3f<0 3CH 3F` 3Hx 3 33x f3d0 3]H 3Z` 3Xx 33 3330 3f3PPH 33Px` 33Px 33P f0 3f0 ffx0 fkH fd` f`x 3f0 33fPH 3ffxPH 3fdx` 3f]x 3fZ H 3H fH xH ̙n` hx 3H 33x` 3fx` 3xx` 3̙kx 3d ` 3` f` ` x` px 3` 33x 3fx 3x 3xx 3n x 3x fx x x xx 3x 33 3f 3 3 3x f0 f30 ff(0 f5H f<` f@x H 3 H fH (H 2` 8x f30 f33PH ff3(PH f3<x` f3Cx f3F 3H 33x` f3x` 3(x` 35x 3< ff0 f3fPH fff` ffP0x ffPx ffP fH 3fx` ff0x f(0x f<x fC fH f3x` ff0x fx0x f̙dx f] H 3x` f0x  ̙PP P f` f3x ffx fx fxx fk ` 3x fx P xP d fx f3 ff f f fx x 3 f   x ` 3 ` f` ̙` (` 0x x 3x fx x  x (x 3` 33x f3 x ̙3x 3(x 32 3x 33 f3 3 3 3( f` 3fx ffx ̙fx f(x f5 fx 3f ff f f f( ` 3x fx ̙P ̙(P < x 3 f  ̙ ( ` 3x fx ̙P  P x 3 f   ( x 3 f ̙  x x 3 f    (      *] dtz^ h