Running SphereDemo

For all authoring tools creating an application that builds off the Away3DTemplate class involves creating a new ActionScript AS file, writing the new class to the AS file, and specifying the new class as being the one that should be run when the application is executed.

The process of running the SphereDemo class can be used to run any of the example classes that will subsequently be presented throughout the book. As you will see, the process is very similar to creating the original Away3DTemplate class, with a few name changes.

Adobe Flex and Adobe Flash Builder

Follow steps 3 to 7 from the instructions under the preceding heading Running Away3DTemplate in Adobe Flex, substituting the name Away3DTemplate for SphereDemo, where appropriate. This will result in your project including both the SphereDemo and Away3DTemplate classes and AS files, with the SphereDemo class being set as the default application.

FlashDevelop

Follow steps 3 to 7 from the instructions under the preceding heading Running Away3DTemplate in FlashDevelop, substituting the name Away3DTemplate for SphereDemo, where appropriate. This will result in your project including both the SphereDemo and Away3DTemplate classes and AS files, with the SphereDemo class being set to always compile.

Adobe Flash CS4

Follow steps 1 to 10 from the instructions under the preceding heading Running Away3DTemplate in Adobe Flash CS4, substituting the name Away3DTemplate for SphereDemo where appropriate. This will result in the two files, SphereDemo.as and Away3DTemplate.as, residing in the same directory as the FLA file, with the SphereDemo class being used as the entry point to (or Document class) for application.

The end result

Now when you compile and run the application, you will see a sphere displayed on the screen. By extending the Away3DTemplate class, we have created a simple 3D application with the SphereDemo class using only a few lines of code. This example demonstrates how the Away3DTemplate class can be used as a foundation to quickly create new Away3D applications. All the examples presented throughout this book will build on the Away3DTemplate class in much the same way as we have done here with SphereDemo.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.112.152