The instructions under the heading Creating an empty project for Away3D stepped you through the process of creating an empty project ready to accept code that uses the Away3D engine. In order to run the Away3DTemplate
class, we now need to add that class to the empty project. We also need to specify the class as the application entry point, meaning it will be executed when the application is first run.
The following steps show you how to add the Away3DTemplate
class to the Flex and Flash Builder projects we created earlier:
Away3D.as
. This file needs to be deleted, so right-click on the file in the Project Explorer | Flex Navigator pane and click on the Delete option.Away3DTemplate
in the Name textbox and click on the Finish button.Away3DTemplate
class into the new Away3DTemplate.as
file, overwriting any default code that may be present.Away3DTemplate.as
file in the Project Explorer | Flex Navigator pane and click on the Set as Default Application option. The icon for the file should include a green triangle and a blue sphere.The following steps show you how to add the Away3DTemplate
class to the FlashDevelop project we created earlier:
Main.as
in the src
directory. This needs to be deleted. Right-click on the file in the Project pane and click on the Delete option.Away3DTemplate
class into the new file, overwriting any default code that may be present.Away3DTemplate.as
under the project src
directory by clicking the Save button.Away3DTemplate.as
file in the Project pane and click on the Always Compile option. The icon for the file should change to include a green arrow pointing down.The following steps show you how to add the Away3DTemplate
class to the Adobe Flash CS4 project we created earlier:
Away3DTemplate
class into the new file.Away3DTemplate.as
in the same directory as the FLA
file from the previous instructions.FLA
file and click File | Publish Settings….When you compile and run the application you will see, well, nothing. However, this is fine, because it is the expected result. The Away3DTemplate
class has provided a foundation that takes care of the initialization and updating of the Away3D engine, but does not create any visible objects that will be shown on the screen.