Chapter 5. The Dynamic Type and Properties

A magic type.

The Dynamic type is a type with a special behavior. Through this chapter you will learn why, how you can use it, and also what you should pay attention to. Understanding the Dynamic type is a key point in mastering haXe.

We have already been introduced to haXe's typing system. But in this chapter we will learn about something new in this typing system: the Dynamic type. The Dynamic type is a type that introduces a very special behavior that we will now study.

In this chapter we will:

  • Use Dynamic variables
  • Learn about Dynamic's pitfalls
  • Learn about the parameterized Dynamic class
  • Implement Dynamic in a class
  • Learn about the use of properties in classes
  • Implement properties in classes

Let's get started. ...

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.