Another Example: One Surface

In our last example, we show how in several lines of code you can create a cute decorative element for your webpage like the little spinning surface below. All we did was to create a fla file with the Stage 116 by 166 pixels. We chose gray for the document background and entered the code quoted beneath the applet on the first frame. Everything will work provided SpinSurfaceBoard.as is in the same directory as your fla file.

Download

  • Download all Flash CS3 'fla' files and AS3 'as' class file: surfaces.zip

The source files for the applet above, surfaces_app2.fla and SpinSurfaceBoard.as are contained in the zip file. They have to be in the same folder for the fla file to compile.

The Complete Code

Here is the complete code for the little applet.

 

var spBoard:SpinSurfaceBoard=new SpinSurfaceBoard(110);

this.addChild(spBoard);

spBoard.x=3;

spBoard.y=3;

spBoard.changeMesh(15);

spBoard.changeExampleNum(10);

spBoard.enableMessageBox();

spBoard.setMessageBoxPos(3,1);

spBoard.setMessageBoxFormat(0xCCCCCC,10,"Mouse over.");

spBoard.changeBackColor(0x000000);

 

Back to Advanced Tutorials              Back to Flash and Math Home

We welcome your comments, suggestions, and contributions. To contact us, email Barbara Kaskosz at barbara@flashandmath.com, Doug Ensley at doug@flashandmath.com, or Dan Gries at dan@flashandmath.com.

Adobe®, Flash®, Flex® are registered trademarks of Adobe Systems Incorporated.