Chapter 12. Creating a Game with haXe and Flash

Assets imports and event handling.

In order to create a game, there are two very important things that you will need to do. The first one is to import images and sounds inside your SWF and to use them in your haXe code. The second one is to handle events, such as keyboard strokes.

This is our last chapter! We now know enough about haXe to create a Flash game with it. In this chapter, we will learn about assets embedding and usage, and events handling. We will learn to do that by targeting Flash 9 and more.

In this chapter, we will:

  • Learn how to embed assets
  • Learn how to use embedded assets
  • Learn how to handle events

Moreover, at the end of this chapter, we will create a small game making use of this.

Embedding ...

Get haXe 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.