haXe 2 Beginner's Guide
eBook - ePub

haXe 2 Beginner's Guide

Benjamin Dasnois

Buch teilen
  1. 288 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

haXe 2 Beginner's Guide

Benjamin Dasnois

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

In Detail

haXe is the universal programming language that is completely cross-platform and provides a standard library that remains the same - regardless of platform.

haXe 2 Beginner's Guide will get you up and running with this exciting language and will guide you through its features in the easiest way possible.

haXe has filled the gap in creating multi-platform applications, and haXe 2 Beginner's Guide will fill the gap in learning all you need to know about haXe - even if it's the first time you have heard of it.

This book will enable you to fully realize haXe's potential for translating code from a haXe program into different languages.

Start with learning how to install haXe, work your way up to templating, and finally learn exactly how to make the same code work for multiple platforms. In between, find heaps of tricks and techniques and work with haXe's typing system. Learn about inheritance, go from learning what a parameter is to creating your own parameterized classes, and find out what the fuss is all about regarding the dynamic type.

By the time you are done with this book, you'll find yourself writing efficient haXe code for multiple platforms in less time than you can say "compatible".

Approach

This book is part of the Packt Beginner's Guide series. Written in an engaging style, it offers step-by-step examples with screenshots at key steps and clear explanation of what is happening in each task.

Who this book is for

This book is written for both Beginners and Developers who want to learn this multi-platform programming language to build web applications from scratch.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist haXe 2 Beginner's Guide als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu haXe 2 Beginner's Guide von Benjamin Dasnois im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Ciencia de la computación & Computación cliente-servidor. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

haXe 2


Table of Contents

haxe 2
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why subscribe?
Free access for Packt account holders
Preface
Here is haXe
Where and for what is haXe used?
Where is haXe used?
What is haXe used for?
One language to rule them all
Object-oriented programming
haXe versions
haXe and the new models of web applications
haXe as an universal language
Getting help
Reading some documentation
Asking questions
The haXe forum
The haXe mailing list
Some advice
Reading some blogs
Nicolas Cannasse
Weblob
GameHaXe
A Bug's Life
Blog.haxe.org
Helping the community
The mailing list and the forum
The wiki
Write on your blog or website
Writing libraries or tools
Talking about haXe
What this book covers
What you need for this book
Who this book is for
Conventions
Time for action – heading
What just happened?
Pop quiz – heading
Have a go hero – heading
Reader feedback
Customer support
Downloading the example code for this book
Errata
Piracy
Questions
1. Getting to know haXe
Installing haXe
Two ways to install: The installer and sources compilation
Installing on Windows
Installing on MacOSX
Installing on Linux
Installing nightly builds
Verifying your installation
Choosing an editor
FlashDevelop 3
The TextMate bundle
VIM
Writing your first program
Time for action – Writing a Hello World
What just happened?
A program with some interaction
Time for action – Interacting with the user
What just happened?
Pop quiz – basic knowledge
Summary
2. Basic Syntax and Branching
Modules, packages, and classes
Packages
Modules
Classes
Accessing a class
Constants and its types
Booleans
Integers
Floats
Base 10
Scientific notation
Strings
Regular expressions
The null value
Flash9 and above
Binary and unary operators
Binary operators
Assigning values
Comparison operators
Arithmetic operators
Boolean operators
Bitwise operators
Unary operators
Blocks
Variable declaration and scope
Declaring a variable
At class level
Time for action – Declaring some fields
What just happened?
In a block of instructions
Field access and function calls
Constructing class instance
Conditional branching
If
Switch
Loops
While
For
Break and continue
Time for action – Using the break keyword
What just happened?
Time for action – Using the continue keyword
What just happened?
Return
Exception handling
Anonymous objects
Local functions
Managing a fridge
Time for action – Managing a fridge
What just happened?
Have a go hero – Throw Exceptions to prevent crashes
Summary
3. Being Cross-platform with haXe
What is cross-platform in the library
Object storage
The Std class
The haxe package
The haxe.remoting package
The haxe.rtti package
The haxe.Http class
Regular expressions and XML handling
Regular expressions
XML handling
Input and output
The DOM interface
The Flash interface
The standard input/output interface
Platform-specific packages
JavaScript
Flash
Neko
PHP
C++
Conditional compilation
Conditional compilation depending on flags
Conditional compilation depending on the target
The remap switch
Coding cross-platform using imports
Time for action – Welcoming the user on Neko & PHP
What just happened?
Pop quiz – Writing cross-platform code
Have a go hero – Handle XML
Time for action – Reading from the XML file
What just happened?
Time for action – Writing to an XML file
What just happened?
Testing our sample
Making it cross-platform
Summary
4. Understanding Types
Explicitly typed variables
Static typing
Values with several types
Defining a type
Inheritance
Multi-inheritance
Implementing an interface
Representing a blog article
Time for action – Representing different types of articles
Function's type
Expressing a function's type
Functions using functions
Dynamic functions
Anonymous objects
Duck typing
Creating a function to apply another one
Time for action – Applying a function on every item
What just happened?
Type inference
Assigning a value
Assigning the value of the variable to another one
Passing the variable as a parameter
Casting
Safe casting
Unsafe casting
Untyped
Type parameters
Usage of Type parameters
Creating a parameterized class
Constraint parameters
Extending the fridge
Time for action – A fridge with constraints
What just happened?
Have a go hero – Creating a typed container
Pop quiz – Verify your knowledge
Summary
5. The Dynamic Type and Properties
Freeing yourself from the typing system
Time for action – Assigning to Dynamic variables
Time for action – Assigning from Dynamic variables
Field access
Functions in Dynamic variables
Parameterized Dynam...

Inhaltsverzeichnis