Join Lee Brimelow for an in-depth discussion in this video Creating the Flash Builder project, part of Building Flash Games with Starling.
So in this movie we are going to create the Flash Builder project that we are going to be using throughout this course. So open up Flash Builder 4.6, and I'm just going to right-click in the Package Explorer and choose New > ActionScript Project. Now we are going to be calling this project Spacer and you can just save the project to the default location. For Application type, we are going to want to create something that runs on the web inside a Flash Player, and we are going to use the default Flex 4.6 SDK.
So essentially you can leave everything else here at their default values and click Next. Now the next thing we need to do is to link up the actual source files where the Starling framework is located. So we are going to click on the Source path tab and click Add Folder, and then I'm going to browse and navigate to that code folder that we created and click Open, and then click OK, and then Finish. So now we have our default class created called Spacer.
Now one of the things that you need to be aware of when you are using the Starling framework and Stage 3D is that when you embed it using HTML into the browser, you need to set the W mode value to direct. So what we can do is to change the HTML template in our project, so I'm going to go into the HTML template folder, right -click on the indextemplate.html, and then choose Open With > Text Editor. This will allow me to edit that HTML file and all I'm going to do is to come into the swfobject code here and put in a new parameter.
So I'm going to put params.wmode and then in quotes put direct, like that. And then I'm going to save this file and now I can close the template. So now each time the HTML template is actually created, it's going to set that W mode value to direct. And again, I can now debug this project and it should open in the browser and if we right-click, you should Flash Player 11.2; again, make sure you have the latest version of the Flash Player debugger installed on your system.
And you should also, in the top of your project here, see that code folder linked to with those Starling class files. So that's our basic project setup that we are going to be using throughout this course.
Starting with installation and configuration of Starling and creation of a Flash Builder project, the course shows how to prepare and import graphical assets, create MovieClip classes from sprite sheets, manage various gaming objects, detect collisions, and add both particle and sound effects. The finished game can be deployed to any browser or mobile device that integrates Flash Player 11, which was released in September 2011.
- Downloading and installing Starling and Flash Builder
- Creating the project
- Creating the main game class, static assets class, and other classes
- Building the state machine
- Creating a static assets class
- Adding images
- Creating sprite sheets with Texture Packer
- Creating and importing bitmap fonts
- Detecting collisions
- Adding particle effects
- Adding sound effects