O'Reilly logo

haXe 2 by Benjamin Dasnois

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required