Game Development Reference
In-Depth Information
Using graphic assets
Let's start by looking at the graphical assets for Flak Cannon and how they will be embedded in
both Flex and Flash. In the Game class, we need to embed the crosshairs.gif from the library. It
looks like this:
//**Flex Framework Only
[Embed(source = "assets/flakassets.swf", symbol="CrosshairsGif")]
private var CrosshairsGif:Class;
The class designation under Embed is the same is the linkage name you would use in the Flash
IDE. To create a linkage for a Flash asset in the library (see Figure 4-12), find the asset in the
library, and click it to bring up the in-context selection menu. Then click the Linkage option. In the
Class box, type the linkage name (see Figure 4-13). Since this is a class, you should style the
name as you would the name of a class (i.e., beginning capital letter for each major word).
Figure 4-12. The FLA library with exported assets
Search WWH ::




Custom Search