
haXe 2 Beginner's Guide.
Title:
haXe 2 Beginner's Guide.
Author:
Dasnois, Benjamin.
ISBN:
9781849512572
Personal Author:
Edition:
1st ed.
Physical Description:
1 online resource (387 pages)
Contents:
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 Dynamic class -- Classes implementing Dynamic -- Time for action - Implementing a non-parameterized Dynamic -- What just happened? -- Time for action - Implementing a parameterized Dynamic -- What just happened? -- Using a resolve function when implementing Dynamic -- Time for action - Writing our Component class -- Time for action - Parsing the configuration file -- Time for action - Testing our parser.
Time for action - Writing the configuration file -- Time for action - Testing the writer -- The dot-notation -- Thoughts on writing our parser -- The dynamic keyword -- Warning -- Properties in classes -- Use -- Implementation -- Writing the getter -- Writing the setter -- Defining the property -- Accessibility -- The default getter -- The default setter -- The dynamic getter and setter -- The never getter and setter -- A compile-time feature -- Have a go hero - Writing a person class -- Pop Quiz - Doing the things -- Summary -- 6. Using and Writing Interfaces, Typedefs, and Enums -- Interfaces -- Purpose -- Default visibility -- Type inference -- Implementing an interface -- Implementation and type inference -- Implementation and visibility -- Making use of interfaces -- Typedefs -- Time for action - Naming Anonymous Types -- What just happened? -- Aliases -- Visibility -- Private typedefs -- Duck typing -- Typedefs to access private members -- Creating iterable objects -- Enums -- Basic enums -- Enums' constructors -- Switching on basic enums -- Enums with parameters -- Time for action - Switching over enums with parameters -- What just happened? -- Have a go hero - Write a fridge with an iterator -- Time for action - Writing our Fridge class -- What just happened? -- Time for action - Making it possible to iterate over a fridge -- What just happened? -- Time for action - Creating the iterator -- What just happened? -- Our main function -- Pop quiz - Typedef, interfaces, and Enums -- Summary -- 7. Communication Between haXe Programs -- The haXe serializer -- Usefulness -- Possibilities -- Class instances -- Custom serialization -- Enum instances -- Unserializing exceptions -- Reducing size and preventing infinite loops -- haXe remoting -- Supported protocols and layers -- Over HTTP -- Implementation -- Using the ExternalInterface.
The JavaScript side -- The Flash side -- Using AMF -- Time for action - Writing a zoo management tool -- The Animal class -- Representing the zoo -- Time for action - Saving the list -- Time for action - Loading the list -- The remoting service -- The getList function -- The createAnimal function -- Tying it together -- The client -- Time for action - Initializing the client connection -- What just happened? -- The createAnimal function -- The listAnimals function -- The main menu -- Compiling the client -- Have a go hero - Represent data from JS in Flash -- Pop quiz - Doing the things -- Summary -- 8. Accessing Databases -- Connecting to databases -- php.db.Connection and neko.db.Connection -- SQL usage -- The interface -- The close function -- The commit function -- The rollback function -- The escape function -- The quote function -- The request function -- The addValue function -- The dbName function -- The lastInsertId function -- Connecting to the database -- MySQL -- SQLite -- Dealing with results -- Typing -- The SPOD -- Setting a SPOD object -- The table name -- Non-mapped fields -- The cache -- A concrete example of SPOD use -- Setting the object -- Setting the connection -- The Manager -- The all function -- The count function -- The delete function -- The get function -- The getWithKeys function -- The object function -- The objects function -- The search function -- Handling relations -- Creating a blogging system -- Time for action - Creating the Users table -- What just happened? -- Time for action - Creating the User class -- What just happened? -- Time for action - Creating the Posts table -- Time for action - Creating the Post class -- What just happened? -- Time for action - Creating the connection to the database -- What just happened? -- Time for action - Listing posts -- Time for action - Listing users.
Time for action - Adding a user.
Abstract:
Develop exciting applications with this multi-platform programming language.
Local Note:
Electronic reproduction. Ann Arbor, Michigan : ProQuest Ebook Central, 2017. Available via World Wide Web. Access may be limited to ProQuest Ebook Central affiliated libraries.
Genre:
Electronic Access:
Click to View