Book Image

haXe 2 Beginner's Guide

5 (1)
Book Image

haXe 2 Beginner's Guide

5 (1)

Overview of this book

Table of Contents (21 chapters)
haxe 2
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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.