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

Testing our sample


The following is a sample main function if you want to try this code. It may also help you to understand how to use it:

public static function main(): Void
{
   trace('Hello World');
   trace(Page.fromXMLFile("/Users/benjamin/example.xml"));
   trace(Page.fromXMLFile("/Users/benjamin/example.xml"));
   
   var p = new Page();
   p.name = "Page de test";
   
   var l1 = new Layer();
   l1.id="l1";
   var l2 = new Layer();
   l2.id="l2";
   
   p.layers.add(l1);
   p.layers.add(l2);
   
   p.toXMLFile("/Users/benjamin/page1.xml");
}