ࡱ> Root Entryp|YrRASH@{X0: ContentsPage 1 Symbol 5>  Root Entryp|YrRASHT~): Contents Page 1 Symbol 5:   !"#$%&'()*+,-CPicPage CPicLayer CPicFrameެ6<6AA84[~64A4~444A84[6?Layer 1OCPicPage CPicLayer CPicFrameCPicText?$WK0@ Arialf"tkeyUp/keyDownxX@]Arial"(a keyDown handler on the "ball" movie clip sets a series of four movement state-variables to Arial"(trueeArial"( when one or more of the arrow keys is pressed. a keyUp handler correspondingly sets the states to Arial"(falsekArial"(. an enterFrame handler then moves "ball" in the four directions when the appropriate movement flags are Arial"(truesArial"(. this approach is much more fluid than using a lone keyDown handler because repeated key presses are not required. 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àU00>0`8 j8 (?content  CDocumentPage Page 1Scene 1>89 Symbol 5ball^9^9*@hhhhhVector::External Font Files0Vector::Generator CommandVector::Preview as GIF0Vector::Override Sounds0Vector::Quality50Vector::Protect0Vector::TemplateVector::Omit Trace Actions0Vector::TopDown0Vector::Report0"PublishFormatProperties::generatorVector::Event Format0Vector::Stream Compress7Vector::Version5Vector::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̙P  !"#$%&'()*+,-CPicPage CPicLayer CPicFrameެ6<6AA84[~64A4~444A84[6?Layer 1OCPicPage CPicLayer CPicFrameCPicText?$WK0@ Arialf"tkeyUp/keyDown  CDocumentPage Page 1Scene 1>89 Symbol 5ball^9^9*@hhhhhVector::External Font Files0Vector::Generator CommandVector::Preview as GIF0Vector::Override Sounds0Vector::Quality50Vector::Protect0Vector::TemplateVector::Omit Trace Actions0Vector::TopDown0Vector::Report0"PublishFormatProperties::generatorVector::Event Format0Vector::Stream Compress7Vector::Version5Vector::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$hPx3f(xx3fxx3f̙xx3fެ6f`zf*]2l$h