ࡱ> Root Entryp|YrRASHR ContentsPage 1j Symbol 5: Root Entryp|YrRASH XUV ContentsPage 1m Symbol 5:  !"#$%  !"#$%&'()*00>0`8 j8 (?contentCPicPage CPicLayer CPicFrameެ6<6AA84[~64A4~444A84[6?Layer 1OCPicPage CPicLayer CPicFrameCPicText?$WK0@ Arialf"tkeyUp/keyDownx @Arial"(a keyDown handler on the ball movie clip sets a series of four movement state variables to true if one or more of the arrow keys is pressed. a keyUp handler correspondingly sets the states to false. an enterFrame handler then moves the ball in the four directions when the appropriate movement flags are true. this approach is much more fluid than using a keyDown handler in isolation because it does not require repeated pressing of the arrow keys to move the clip. CPicSprite"H"HonClipEvent (enterFrame) { if(movingLeft) { _x -= 10; } if(movingUp) { _y -= 10; } if(movingRight) { _x += 10; } if(movingDown) { _y += 10; } // note that these if statements could also be // if (Key.isDown(##) // which would eliminate the need for the keyUp and // keyDown event handlers, but would also be slightly // more processor intensive (invoking Key.isDown() // every frame is more costly than checking a boolean // value). } onClipEvent (keyDown) { if (Key.isDown(37)) { // left arrow movingLeft = true; } if (Key.isDown(38)) { // up arrow movingUp = true; } if (Key.isDown(39)) { // right arrow movingRight = true; } if (Key.isDown(40)) { // down arrow movingDown = true; } } onClipEvent (keyUp) { if (!Key.isDown(37)) { // left arrow movingLeft = false; } if (!Key.isDown(38)) { // up arrow movingUp = false; } if (!Key.isDown(39)) { // right arrow movingRight = false; } if (!Key.isDown(40)) { // down arrow movingDown = false; } }ballC%p8 Arial"("ball" clip3[0@Arialf"tevent handlers fH8h3pp0Z0x0àU  !"#$%&'()*àU00>0`8 j8 (?contentCPicPage CPicLayer CPicFrameެ6<6AA84[~64A4~444A84[6?Layer 1OCPicPage CPicLayer CPicFrameCPicText?$WK0@ Arialf"tkeyUp/keyDownx @Arial"(a keyDown handler on the ball movie clip sets a series of four movement state variables to true if one or more of the arrow keys is pressed. a keyUp handler correspondingly sets the states to false. an enterFrame handler then moves the ball in the four directions when the appropriate movement flags are true. this approach is much more fluid than using a keyDown in isolation because it does not require repeated pressing of the arrow keys to repeatedly move the clip. CPicSprite"H"HonClipEvent (enterFrame) { if(movingLeft) { _x -= 10; } if(movingUp) { _y -= 10; } if(movingRight) { _x += 10; } if(movingDown) { _y += 10; } // note that these if statements could also be // if (Key.isDown(##) // which would eliminate the need for the keyUp and // keyDown event handlers, but would also be slightly // more processor intensive (invoking Key.isDown() // every frame is more costly than checking a boolean // value). } onClipEvent (keyDown) { if (Key.isDown(37)) { // left arrow movingLeft = true; } if (Key.isDown(38)) { // up arrow movingUp = true; } if (Key.isDown(39)) { // right arrow movingRight = true; } if (Key.isDown(40)) { // down arrow movingDown = true; } } onClipEvent (keyUp) { if (!Key.isDown(37)) { // left arrow movingLeft = false; } if (!Key.isDown(38)) { // up arrow movingUp = false; } if (!Key.isDown(39)) { // right arrow movingRight = false; } if (!Key.isDown(40)) { // down arrow movingDown = false; } }ballC%p8 Arial"("ball" clip3[0@Arialf"tevent handlers fH8h3pp0Z0x0 CDocumentPage Page 1Scene 1>88n9 Symbol 5ball^9^9*@hhhhh Vector::External Font Files0Vector::Generator CommandVector::Preview as GIF0Vector::Override Sounds0Vector::Quality50Vector::Protect0Vector::TemplateVector::Omit Trace Actions0Vector::TopDown0Vector: CDocumentPage Page 1Scene 1>8?o9 Symbol 5ball^9^9*@hhhhh Vector::External Font Files0Vector::Generator CommandVector::Preview as GIF0Vector::Override Sounds0Vector::TemplateVector::Protect0Vector::Quality50Vector::Omit Trace Actions0Vector::TopDown0"PublishFormatProperties::generatorVector::Report0Vector::Version5Vector::Stream Compress7Vector::Event Format0Vector::Event Compress7Vector::Stream Format0PropSheet::ActiveTab1599 CColorDef3PfP0PHP`Px333(3f<03CH3F`3Hxf0f30ff(0f5Hf<`f@x3330333xf3d03]H3Z`3Xx3333303f3PPH33Px`33Px33Pf30f33PHff3(PHf3<x`f3Cxf3Ffff`f03f0ffx0fkHfd`f`x3f033fPH3ffxPH3fdx`3f]x3fZff0f3fPHfff`ffP0xffPxffPH3HfHxH̙n`hx3H33x`3fx`3xx`3̙kx3dfHf3x`ff0xfx0xf̙dxf]`3`f``x`px3`33x3fx3x3xx3nf`f3xffxfxfxxfkx3xfxxxxx3x333f333xfxf3fffffxxH3 HfH(H2`8x`3 `f`̙`(`0xx3xfxx x(xPx3H33x`f3x`3(x`35x3<3`33xf3 x̙3x3(x323x33f3 333(xfH3fx`ff0xf(0xf<xfCf`3fxffx̙fxf(xf5fx3ffff ff((xH3x`f0x̙PPP`3xfx̙P̙(P<x3f̙(xx`3xfxPxPd`3xfx̙PPx3f(xx3fxx3f̙xx3fެ6f`zf*]2l$h