ࡱ> Root Entryp|YrRASH0 կ @ContentsHPage 1&Symbol 4  X !"#$%&'()*+,-./01456789:;<=>?@AYZ[\]^_`abcdefghijklmnopqrstuvwxyzRoot Entryp|YrRASH @ContentsHPage 1&Symbol 4 fX 23BCDEFGHIJKLMNOPQRSTUVW{YZ[\]^_`abcdefghijklmnopqrstuvwxyz|}~Symbol 2FSymbol 1  !"#$'()*+,-./0123456789:;<=>?@ABCDEFGHCPicPage CPicLayer CPicFrame?l="//Picture Cube by John Bezanis //visit http://swfspot.com for more flash projects stop(); //Size of the cube. cubeSize = _parent.size; cubeDiagonal = Math.sqrt(cubeSize*cubeSi  !"#$%'()*+,-./0123456789:;<=>?@ABCDEFGHSymbol 2FSymbol 1?r Layer 1OOCPicPage CPicLayer CPicFrame?Ri//use image_mc to load our image into this.createEmptyMovieClip("image_mc", this.geCPicPage CPicLayer CPicFrame CPicSpritedRiinner<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='cube' oldCopiedComponentPath=''> </component> tNextHighestDepth()); //create a listener for the completion of the movie clip load var mclListener:Object = new Object(); //run once the image loads mclListener.onLoadInit = function(target_mc:MovieClip) { image_mc._width=_parent._parent.cubeSize; image_mc._height=_parent._parent.cubeSize; }; //create a loader for the movie clip var image_mcl:MovieClipLoader = new MovieClipLoader(); //add the event listener to the loader image_mcl.addListener(mclListener); //load the image into the movieclip and keep track of the progress using the listener image_mcl.loadClip(pic, image_mc); Layer 1OO Layer 1OOFrame CPicSprCPicPage CPicLayer CPicFrame CPicSprite  ? CDocumentPagePage 1Scene 1G8HSymbol 4inner(GGinnerinner+8HSymbol 2cube G@cubeSymbol 1GSymbol 1sideGsideSymbol 18Hpphhhh?r Layer 1OOCPicPage CPicLayer CPicFrame?Ri//use image_mc to load our image into this.createEmptyMovieClip("image_mc", this.getNextHighestDepth()); //create a listener for the completion of the movie clip load var mclListener:Object = new Object(); //run once the image loads mclListener.onLoadInit = function(target_mc:MovieClip) { target_mc.forceSmoothing = true; image_mc._width=_parent._parent.cubeSize; image_mc._height=_parent._parent.cubeSize; }; //create a loader for the movie clip var image_mcl:MovieClipLoader = new MovieClipLoader(); //add the event listener to the loader image_mcl.addListener(mclListener); //load the image into the movieclip and keep track of the progress using the listener image_mcl.loadClip(pic, image_mc); Layer 1OOFrame CPicSprCPicPage CPicLayer CPicFrame CPicSprite  AAAI?J,cube<component metaDataFetched='true' schemaUrl='' schemaOperation='' sceneRootLabel='side' oldCopiedComponentPath=''> </component> ?l=//Picture Cube by John Bezanis //visit http://swfspot.com for more flash projects //The majority of the code is located within the symbol 'cube' im0=_root.im0; im1=_root.im1; im2=_root.im2; im3=_root.im3; im4=_root.im4; im5=_root.im5; size=_root.cubesize; if(size==undefined){size=200;} Stage.scaleMode="noScale"; //Align the stage to the top left Stage.align = "TL"; //This interval is set to recenter the cube if the flash applet hasn't been drawn by the browser function centercube(){ if(Stage.width!=0&&Stage.height!=0){ cube._x=Stage.width/2; cube._y=Stage.height/2; clearInterval(checkhtmlloaded); } } var checkhtmlloaded:Number; checkhtmlloaded = setInterval(this, "centercube", 10);  Layer 1OO.min(.05,speedX+Math.sin(mouseangle)*mousedist/100000)); //speedY=Math.max(-.05,Math.min(.05,speedY+Math.cos(mouseangle)*mousedist/100000)); //speedZ=0; speedX=Math.max(-.05,Math.min(.05,speedX+(Math.cos(rotationY)*_xmouse+Math.cos(rotationZ? CDocumentPagePage 1Scene 1G8HSymbol 4inner(GGinnerinner8HSymbol 2cube G@cubeSymbol 1GSymbol 1sideGsideSymbol 18HpphhhhhlegacyLineSpacing0PropSheet::ActiveTab1085%PublishFormatProperties::htmlFileName45-picturecube.html"PublishHtmlProperties::StartPaused0Vector::AS3 Package Paths PublishRNWKProperties::speed256K0!PublishGifProperties::PaletteNamePublishFormatProperties::jpeg0PublishHtmlProperties::Loop1PublishProfileProperties::nameDefaultVector::Debugging Permitted0Vector::UseNetwork0"PublishQTProperties::MatchMovieDim1 PublishQTProperties::AlphaOption PublishQTProperties::LayerOption4PublishHtmlProperties::UsingDefaultAlternateFilename1PublishHtmlProperties::Units0%PublishHtmlProperties::showTagWarnMsg1Vector::External Player&PublishRNWKProperties::singleRateAudio0&PublishRNWKProperties::speedSingleISDN0$PublishPNGProperties::OptimizeColors1PublishQTProperties::Width500%PublishFormatProperties::projectorMac0'PublishFormatProperties::gifDefaultName1&PublishFormatProperties::flashFileName45-picturecube.swfVector::Package PathsVector::Compress Movie1#PublishRNWKProperties::flashBitRate1200%PublishRNWKProperties::mediaCopyright(c) 2000PublishGifProperties::Smooth1PublishFormatProperties::html1$PublishFormatProperties::pngFileName45-picturecube.png(PublishHtmlProperties::VerticalAlignment1PublishHtmlProperties::Quality4Vector::FireFox0"PublishRNWKProperties::exportAudio1 PublishRNWKProperties::speed384K0!PublishRNWKProperties::exportSMIL1"PublishGifProperties::DitherOption-PublishFormatProperties::generatorDefaultName1!PublishHtmlProperties::DeviceFont0Vector::Override Sounds0'PublishRNWKProperties::mediaDescription"PublishPNGProperties::FilterOptionPublishFormatProperties::gif0(PublishFormatProperties::jpegDefaultName1(PublishFormatProperties::rnwkDefaultName1*PublishFormatProperties::generatorFileName45-picturecube.swtVector::Template02PublishHtmlProperties::VersionDetectionIfAvailable0*PublishHtmlProperties::HorizontalAlignment1"PublishHtmlProperties::DisplayMenu1Vector::Protect0Vector::Quality80PublishJpegProperties::DPI4718592PublishGifProperties::Interlace0"PublishGifProperties::DitherSolids0PublishPNGProperties::Smooth1PublishPNGProperties::BitDepth24-bit with AlphaPublishQTProperties::Flatten1#PublishFormatProperties::qtFileName45-picturecube.movPublishRNWKProperties::speed28K1!PublishRNWKProperties::mediaTitle$PublishRNWKProperties::mediaKeywordsPublishGifProperties::Width500PublishGifProperties::Loop1PublishFormatProperties::flash1PublishJpegProperties::Quality80$PublishRNWKProperties::realVideoRate100000$PublishRNWKProperties::speedDualISDN0#PublishGifProperties::MatchMovieDim1#PublishGifProperties::PaletteOption"PublishPNGProperties::DitherOption0PublishFormatProperties::projectorMacDefaultName1'PublishFormatProperties::pngDefaultName1-PublishFormatProperties::projectorWinFileName45-picturecube.exePublishHtmlProperties::Align0!PublishProfileProperties::version1Vector::Package Export Frame1$PublishJpegProperties::MatchMovieDim1#PublishPNGProperties::MatchMovieDim1#PublishPNGProperties::PaletteOption)PublishFormatProperties::flashDefaultName1%PublishFormatProperties::jpegFileName45-picturecube.jpgPublishHtmlProperties::Width500PublishHtmlProperties::Height400Vector::Omit Trace Actions0Vector::Debugging Password"PublishJpegProperties::Progressive0"PublishPNGProperties::DitherSolids0#PublishQTProperties::PlayEveryFrame0PublishFormatProperties::png0PublishFormatProperties::rnwk0(PublishFormatProperties::htmlDefaultName1-PublishFormatProperties::projectorMacFileName45-picturecube.hqx2PublishHtmlProperties::UsingDefaultContentFilename1!PublishHtmlProperties::WindowMode0'PublishHtmlProperties::TemplateFileNameQC:\Users\John\AppData\Local\Macromedia\Flash 8\en\Configuration\Html\Default.htmlVector::TopDown0Vector::DeviceSound0PublishJpegProperties::Size0PublishGifProperties::Height400PublishPNGProperties::Interlace0"PublishFormatProperties::generator0&PublishHtmlProperties::ContentFilename(PublishHtmlProperties::AlternateFilename+PublishHtmlProperties::OwnAlternateFilenameVector::Report0PublishRNWKProperties::speed56K1PublishGifProperties::LoopCount'PublishGifProperties::TransparentOptionPublishGifProperties::MaxColors255%PublishPNGProperties::RemoveGradients0PublishQTProperties::Height400PublishFormatProperties::qt0Vector::Stream Compress7Vector::Event Format0Vector::Version8"PublishRNWKProperties::audioFormat0$PublishGifProperties::OptimizeColors10PublishFormatProperties::projectorWinDefaultName1PublishHtmlProperties::Scale0Vector::Event Compress7Vector::ActionScriptVersion2Vector::StreamUse8kSampleRate0Vector::EventUse8kSampleRate0PublishJpegProperties::Height400 PublishRNWKProperties::speed512K0%PublishGifProperties::RemoveGradients0PublishPNGProperties::Width500PublishPNhlegacyLineSpacing0PropSheet::ActiveTab1085%PublishFormatProperties::htmlFileName45-picturecube.html"PublishHtmlProperties::StartPaused0Vector::AS3 Package Paths PublishRNWKProperties::speed256K0!PublishGifProperties::PaletteNamePublishFormatProperties::jpeg0PublishHtmlProperties::Loop1PublishProfileProperties::nameDefaultVector::Debugging Permitted0Vector::UseNetwork0"PublishQTProperties::MatchMovieDim1 PublishQTProperties::AlphaOptionGProperties::Height400&PublishFormatProperties::qtDefaultName1$PublishFormatProperties::gifFileName45-picturecube.gif"PublishHtmlProperties::VersionInfoVector::Stream Format0PublishJpegProperties::Width500"PublishRNWKProperties::exportFlash1&PublishRNWKProperties::showBitrateDlog1(PublishRNWKProperties::speedCorporateLAN0"PublishRNWKProperties::mediaAuthorPublishGifProperties::Animated0&PublishGifProperties::TransparentAlpha128!PublishPNGProperties::Transparent0!PublishPNGProperties::PaletteName*PublishQTProperties::UseQTSoundCompression0PublishQTProperties::Looping0%PublishFormatProperties::defaultNames1%PublishFormatProperties::projectorWin0%PublishFormatProperties::rnwkFileName45-picturecube.smil,PublishHtmlProperties::UsingOwnAlternateFile0PublishPNGProperties::MaxColors255%PublishQTProperties::ControllerOption0"PublishQTProperties::PausedAtStart0 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̙xx3ff`zf*]0"PublishQTProperties::QTSndSettingsCQTAudioSettingsh<?xml version="1.0" encoding="UTF-16" standalone="no" ?> <mobileSettings> <contentType id="standalonePlayer" name="Standalone Player"/> <testDevices/> </mobileSettings> pscriptionVector::Override Sounds0!PublishHtmlProperties::DeviceFont0-PublishFormatProperties::generatorDefaultName1PublishQTProperties::Flatten1PublishPNGProperties::BitDep PublishQTProperties::LayerOption4PublishHtmlProperties::UsingDefaultAlternateFilename1PublishHtmlProperties::Units0%PublishHtmlProperties::showTagWarnMsg1Vector::External Player&PublishRNWKProperties::singleRateAudio0&PublishRNWKProperties::speedSingleISDN0$PublishPNGProperties::OptimizeColors1PublishQTProperties::Width500%PublishFormatProperties::projectorMac0'PublishFormatProperties::gifDefaultName1&PublishFormatProperties::flashFileName45-picturecube.swfVector::Package PathsVector::Compress Movie1#PublishRNWKProperties::flashBitRate1200%PublishRNWKProperties::mediaCopyright(c) 2000PublishGifProperties::Smooth1PublishFormatProperties::html1$PublishFormatProperties::pngFileName45-picturecube.png(PublishHtmlProperties::VerticalAlignment1PublishHtmlProperties::Quality4Vector::FireFox0"PublishRNWKProperties::exportAudio1 PublishRNWKProperties::speed384K0!PublishRNWKProperties::exportSMIL1"PublishGifProperties::DitherOption-PublishFormatProperties::generatorDefaultName1!PublishHtmlProperties::DeviceFont0Vector::Override Sounds0'PublishRNWKProperties::mediaDescription"PublishPNGProperties::FilterOptionPublishFormatProperties::gif0(PublishFormatProperties::jpegDefaultName1(PublishFormatProperties::rnwkDefaultName1*PublishFormatProperties::generatorFileName45-picturecube.swtVector::Template02PublishHtmlProperties::VersionDetectionIfAvailable0*PublishHtmlProperties::HorizontalAlignment1"PublishHtmlProperties::DisplayMenu1Vector::Protect0Vector::Quality80PublishJpegProperties::DPI4718592PublishGifProperties::Interlace0"PublishGifProperties::DitherSolids0PublishPNGProperties::Smooth1PublishPNGProperties::BitDepth24-bit with AlphaPublishQTProperties::Flatten1#PublishFormatProperties::qtFileName45-picturecube.movPublishRNWKProperties::speed28K1!PublishRNWKProperties::mediaTitle$PublishRNWKProperties::mediaKeywordsPublishGifProperties::Width500PublishGifProperties::Loop1PublishFormatProperties::flash1PublishJpegProperties::Quality80$PublishRNWKProperties::realVideoRate100000$PublishRNWKProperties::speedDualISDN0#PublishGifProperties::MatchMovieDim1#PublishGifProperties::PaletteOption"PublishPNGProperties::DitherOption0PublishFormatProperties::projectorMacDefaultName1'PublishFormatProperties::pngDefaultName1-PublishFormatProperties::projectorWinFileName45-picturecube.exePublishHtmlProperties::Align0!PublishProfileProperties::version1Vector::Package Export Frame1$PublishJpegProperties::MatchMovieDim1#PublishPNGProperties::MatchMovieDim1#PublishPNGProperties::PaletteOption)PublishFormatProperties::flashDefaultName1%PublishFormatProperties::jpegFileName45-picturecube.jpgPublishHtmlProperties::Width500PublishHtmlProperties::Height400Vector::Omit Trace Actions0Vector::Debugging Password"PublishJpegProperties::Progressive0"PublishPNGProperties::DitherSolids0#PublishQTProperties::PlayEveryFrame0PublishFormatProperties::png0PublishFormatProperties::rnwk0(PublishFormatProperties::htmlDefaultName1-PublishFormatProperties::projectorMacFileName45-picturecube.hqx2PublishHtmlProperties::UsingDefaultContentFilename1!PublishHtmlProperties::WindowMode0'PublishHtmlProperties::TemplateFileNameQC:\Users\John\AppData\Local\Macromedia\Flash 8\en\Configuration\Html\Default.htmlVector::TopDown0Vector::DeviceSound0PublishJpegProperties::Size0PublishGifProperties::Height400PublishPNGProperties::Interlace0"PublishFormatProperties::generator0&PublishHtmlProperties::ContentFilename(PublishHtmlProperties::AlternateFilename+PublishHtmlProperties::OwnAlternateFilenameVector::Report0PublishRNWKProperties::speed56K1PublishGifProperties::LoopCount'PublishGifProperties::TransparentOptionPublishGifProperties::MaxColors255%PublishPNGProperties::RemoveGradients0PublishQTProperties::Height400PublishFormatProperties::qt0Vector::Stream Compress7Vector::Event Format0Vector::Version8"PublishRNWKProperties::audioFormat0$PublishGifProperties::OptimizeColors10PublishFormatProperties::projectorWinDefaultName1PublishHtmlProperties::Scale0Vector::Event Compress7Vector::ActionScriptVersion2Vector::StreamUse8kSampleRate0Vector::EventUse8kSampleRate0PublishJpegProperties::Height400 PublishRNWKProperties::speed512K0%PublishGifProperties::RemoveGradients0PublishPNGProperties::Width500PublishPNGProperties::Height400&PublishFormatProperties::qtDefaultName1$PublishFormatProperties::gifFileName45-picturecube.gif"PublishHtmlProperties::VersionInfoVector::Stream Format0PublishJpegProperties::Width500"PublishRNWKProperties::exportFlash1&PublishRNWKProperties::showBitrateDlog1(PublishRNWKProperties::speedCorporateLAN0"PublishRNWKProperties::mediaAuthorPublishGifProperties::Animated0&PublishGifProperties::TransparentAlpha128!PublishPNGProperties::Transparent0!PublishPNGProperties::PaletteName*PublishQTProperties::UseQTSoundCompression0PublishQTProperties::Looping0%PublishFormatProperties::defaultNames1%PublishFormatProperties::projectorWin0%PublishFormatProperties::rnwkFileName45-picturecube.smil,PublishHtmlProperties::UsingOwnAlternateFile0PublishPNGProperties::MaxColors255%PublishQTProperties::ControllerOption0"PublishQTProperties::PausedAtStart0 CColorDef3PfP0PHP`Px3ze+cubeSize*cubeSize); //Initial rotational position in radians rotationX = 0; rotationY = 0; rotationZ = 0; //Rotational speed in radians speedX = .01; speedY = .015; speedZ = .0; //Points plotting the corners of the cube var pointArray:Array = [[-cubeSize/2, -cubeSize/2, cubeSize/2], [cubeSize/2, -cubeSize/2, cubeSize/2], [cubeSize/2, cubeSize/2, cubeSize/2], [-cubeSize/2, cubeSize/2, cubeSize/2], [-cubeSize/2, -cubeSize/2, -cubeSize/2], [cubeSize/2, -cubeSize/2, -cubeSize/2], [cubeSize/2, cubeSize/2, -cubeSize/2], [-cubeSize/2, cubeSize/2, -cubeSize/2]]; //A temporary array to reset the points each frame var drawArray:Array = new Array(); //corners of each side correspond to the points var facePoints:Array = [[0, 1, 2, 3], [1, 5, 6, 2], [5, 4, 7, 6], [4, 0, 3, 7], [4,5,1,0], [3, 2, 6, 7]]; for (i=0; i<6; i++) { attachMovie('side', 'side'+i, this.getNextHighestDepth()); eval('side'+i).inner.pic = eval("_parent.im"+i); } //A side has been clicked. Spin it to that side and zoom in eval('side'+0).onPress=function(){ focusing=!focusing; focusX=0; focusY=0; focusZ=0; focusside=0; } eval('side'+1).onPress=function(){ focusing=!focusing; focusX=0; focusY=-Math.PI/2; focusZ=0; focusside=1; } eval('side'+2).onPress=function(){ focusing=!focusing; focusX=0; focusY=-Math.PI; focusZ=0; focusside=2; } eval('side'+3).onPress=function(){ focusing=!focusing; focusX=0; focusY=Math.PI/2; focusZ=0; focusside=3; } eval('side'+4).onPress=function(){ focusing=!focusing; focusX=Math.PI/2; focusY=0; focusZ=0; focusside=4; } eval('side'+5).onPress=function(){ focusing=!focusing; focusX=-Math.PI/2; focusY=0; focusZ=0; focusside=5; } focusing=false; radianstodegrees = 180/Math.PI; onEnterFrame = function () { clear(); if(!focusing){ mousedist=Math.sqrt(_xmouse*_xmouse+_ymouse*_ymouse); mouseangle=Math.atan2(_ymouse,_xmouse); //Change the speed based on the mouse position speedX=Math.max(-.05,Math.min(.05,speedX+Math.sin(mouseangle)*mousedist/100000)); speedY=Math.max(-.05,Math.min(.05,speedY+Math.cos(mouseangle)*mousedist/100000)); speedZ=0; //Change the rotation of the cube based on its speed rotationX = rotationX%(2*Math.PI)+speedX; rotationY = rotationY%(2*Math.PI)+speedY; rotationZ = rotationZ%(2*Math.PI)+speedZ; _xscale=(_xscale*4+100)/5; _yscale=(_yscale*4+100)/5; }else{ //If there is minimum change, do nothing. This reduces flickering. if(Math.round(rotationX*1000)==Math.round(focusX*1000)&&Math.round(rotationY*1000)==Math.round(focusY*1000)&&Math.round(rotationZ*1000)==Math.round(focusZ*1000)){ }else{ rotationX = (rotationX*4+(rotationX+focusX)/2)/5; rotationY = (rotationY*4+(rotationY+focusY)/2)/5; rotationZ = (rotationZ*4+(rotationZ+focusZ)/2)/5; } if((eval('side'+focusside).inner.image_mc._yscale/eval('side'+focusside).inner.image_mc._xscale)>Stage.width/Stage.height){ //wider than stage _width=(_width*5+Stage.width)/6; _yscale=(_yscale*3+_xscale*(eval('side'+focusside).inner.image_mc._xscale/eval('side'+focusside).inner.image_mc._yscale))/4; }else{ //higher than stage _height=(_height*5+Stage.height)/6; _xscale=(_xscale*3+_yscale*(eval('side'+focusside).inner.image_mc._yscale/eval('side'+focusside).inner.image_mc._xscale))/4; } } //Copy the positions of the dots on the cube. The original positions do not get modified. //Doing this eliminates round off error over time. drawArray = [pointArray[0].slice(), pointArray[1].slice(), pointArray[2].slice(), pointArray[3].slice(), pointArray[4].slice(), pointArray[5].slice(), pointArray[6].slice(), pointArray[7].slice()]; //Spin the dots for the top 4 corners. The bottom 4 corners are just negatives of the top //The cube is spun along each axis seperately. //When spinning along each axis, the value for that axis remains the same. for (position=0; position<4; position++) { rotateX(position); } for (position=0; position<4; position++) { rotateY(position); } for (position=0; position<4; position++) { rotateZ(position); } //Copy the points of the top half, but take the negative of ther values drawArray[4] = [-drawArray[2][0], -drawArray[2][1], -drawArray[2][2]]; drawArray[5] = [-drawArray[3][0], -drawArray[3][1], -drawArray[3][2]]; drawArray[6] = [-drawArray[0][0], -drawArray[0][1], -drawArray[0][2]]; drawArray[7] = [-drawArray[1][0], -drawArray[1][1], -drawArray[1][2]]; highpoint = 0; //Find the point with the highest z value for (point=1; point<8; point++) { if (drawArray[point][2]>=drawArray[highpoint][2]) { highpoint = point; } } for (curside=0; curside<6; curside++) { showside = 0; //Looping through the sides, only draw the sides that are visible. for (sidepoint=0; sidepoint<=3; sidepoint++) { if (facePoints[curside][sidepoint] == highpoint) { showside = 1; } } if (showside) { drawSide(curside); eval('side'+curside)._alpha = 100; //Adjust the brightness of the side based on its visible area myColor = new Color(eval('side'+curside)); currentColor = {rb:255*(Math.min(100,eval('side'+curside).inner._xscale)+Math.min(100,eval('side'+curside).inner._yscale))/200-255, gb:255*(Math.min(100,eval('side'+curside).inner._xscale)+Math.min(100,eval('side'+curside).inner._yscale))/200-255, bb:255*(Math.min(100,eval('side'+curside).inner._xscale)+Math.min(100,eval('side'+curside).inner._yscale))/200-255}; myColor.setTransform(currentColor); } else { eval('side'+curside)._alpha = 0; eval('side'+curside)._xscale = 0; eval('side'+curside)._yscale = 0; } } }; //the rotate functions find the point's distance from its axis, figure out its current angle, //and rotate based on the new angle function rotateX(rotatePoint) { axisDistance = Math.sqrt(Math.pow(drawArray[rotatePoint][1], 2)+Math.pow(drawArray[rotatePoint][2], 2)); drawAngle = Math.atan2(drawArray[rotatePoint][1], drawArray[rotatePoint][2])+rotationX; drawArray[rotatePoint][1] = axisDistance*Math.sin(drawAngle); drawArray[rotatePoint][2] = axisDistance*Math.cos(drawAngle); } function rotateY(rotatePoint) { axisDistance = Math.sqrt(Math.pow(drawArray[rotatePoint][0], 2)+Math.pow(drawArray[rotatePoint][2], 2)); drawAngle = Math.atan2(drawArray[rotatePoint][0], drawArray[rotatePoint][2])+rotationY; drawArray[rotatePoint][0] = axisDistance*Math.sin(drawAngle); drawArray[rotatePoint][2] = axisDistance*Math.cos(drawAngle); } function rotateZ(rotatePoint) { axisDistance = Math.sqrt(Math.pow(drawArray[rotatePoint][0], 2)+Math.pow(drawArray[rotatePoint][1], 2)); drawAngle = Math.atan2(drawArray[rotatePoint][0], drawArray[rotatePoint][1])+rotationZ; drawArray[rotatePoint][0] = axisDistance*Math.sin(drawAngle); drawArray[rotatePoint][1] = axisDistance*Math.cos(drawAngle); } //Distance between 2 points function getDistance(x1, y1, x2, y2) { deltaX = x1-x2; deltaY = y1-y2; dist = Math.sqrt((deltaX*deltaX)+(deltaY*deltaY)); return dist; } function drawSide(side) { eval('side'+curside)._xscale = 100; eval('side'+curside)._yscale = 100; eval("side"+side)._x = drawArray[facePoints[side][0]][0]; eval("side"+side)._y = drawArray[facePoints[side][0]][1]; ab = getDistance(drawArray[facePoints[side][0]][0], drawArray[facePoints[side][0]][1], drawArray[facePoints[side][1]][0], drawArray[facePoints[side][1]][1]); bc = getDistance(drawArray[facePoints[side][1]][0], drawArray[facePoints[side][1]][1], drawArray[facePoints[side][3]][0], drawArray[facePoints[side][3]][1]); ca = getDistance(drawArray[facePoints[side][3]][0], drawArray[facePoints[side][3]][1], drawArray[facePoints[side][0]][0], drawArray[facePoints[side][0]][1]); //Corner Angle in Radians cornerAngle = Math.acos(-(bc*bc-ab*ab-ca*ca)/(2*ab*ca)); eval("side"+side)._yscale = ((Math.tan(cornerAngle/2)*(cubeDiagonal/2)*2)/cubeDiagonal)*100; eval("side"+side)._rotation = radianstodegrees*Math.atan2(drawArray[facePoints[side][1]][1]-drawArray[facePoints[side][0]][1], drawArray[facePoints[side][1]][0]-drawArray[facePoints[side][0]][0])+radianstodegrees*cornerAngle/2; eval("side"+side).inner._rotation = -45; distortionscale = 100/((0.707106781186548/Math.cos(cornerAngle/2))*cubeSize); eval("side"+side).inner._xscale = ab*distortionscale; eval("side"+side).inner._yscale = ca*distortionscale; } function visitswfspot() { getURL("http://www.swfspot.com", "_blank"); } var myMenu = new ContextMenu(); var menubezz = new ContextMenuItem("3D Cube by SWF Spot", visitswfspot); myMenu.customItems.push(menubezz); _root.menu = myMenu;  Layer 1OOSymbol 4inner(GGinneri33(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̙xx3ff`zf*]0"PublishQTProperties::QTSndSettingsCQTAudioSettingsh<?xml version="1.0" encoding="UTF-16" standalone="no" ?> <mobileSettings> <contentType id="standalonePlayer" name="Standalone Player"/> <testDevices/> </mobileSettings> p