<!DOCTYPE html>
<html lang="en" id="page">
<head prefix="og: https://ogp.me/ns# fb: https://ogp.me/ns/fb# article: https://ogp.me/ns/article#">
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width" />
	<title>::title::</title>

	<base href="::currentPage.baseHref::" />

	<!-- general css -->
	<link rel="stylesheet" type="text/css" href="https://haxe.org/css/bootstrap.min.css" />
	<link rel="stylesheet" type="text/css" href="css/styles.min.css" />
	<link rel="stylesheet" type="text/css" href="css/haxe-nav.min.css" />
	<link rel="stylesheet" type="text/css" href="css/fonts.min.css" />
	
	<link rel="icon" href="https://haxe.org/favicon.ico" />
	<link rel="canonical" href="::currentPage.absoluteUrl::" ::cond currentPage.absoluteUrl != null:: />
	<link href="::basePath::rss.xml" rel="alternate" type="application/atom+xml" title="RSS Feed Haxe Code Cookbook" />

	<meta name="description" content="::currentPage.description::" ::cond currentPage.description != null:: />

	<!-- Twitter Card data -->
	<meta name="twitter:creator" content="@haxe_org" />

	<!-- Open Graph data -->
	<meta property="og:title" content="::title::" />
	<meta property="og:description" content="::currentPage.description::" ::cond currentPage.description != null:: />
	<meta property="og:type" content="article" />
	<meta property="og:url" content="::currentPage.absoluteUrl::" />
	<meta property="og:image" content="::basePath::img/share.png" />
	<meta property="article:publisher" content="haxe.org" />
	<meta property="article:published_time" content="::currentPage.dates.created::" ::cond currentPage.dates!=null && currentPage.dates.created!=null:: />
	<meta property="article:modified_time" content="::currentPage.dates.modified::" ::cond currentPage.dates!=null && currentPage.dates.modified!=null:: />
	<meta property="article:section" content="technology" />
	<meta property="article:tag" content="::currentPage.tags.join(',')::" ::cond currentPage.tags!=null:: />
	
</head>
<body>
	::if false::
	<!--
		Force redirect to the right origin.
		It is needed to redirect `path` to `path/` with the correct domain name.
		See the "Caveats" section of http://strd6.com/2016/02/github-pages-custom-domain-with-ssltls/.
	-->
	::end::
	::if basePath != null && currentPage.absoluteUrl != null::
	<script type="text/javascript">
	function startsWith(str, searchString){
		return str.substr(0, searchString.length) === searchString;
	}
	if (!startsWith(location.href, "::basePath::")) {
		window.location.replace("::currentPage.absoluteUrl::");
	}
	</script>
	::end::
	<nav class="section nav dark">
		<div class="navbar navbar-fixed-top navbar-inverse">
			<div class="navbar-inner">
				<button class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse" type="button"><span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span></button> <a class="brand haxe-logo" href="https://haxe.org/"><img alt="Haxe" height="21" onerror="this.src='https://haxe.org/img/haxe-logo-horizontal-on-dark.png'" src="https://haxe.org/img/haxe-logo-horizontal-on-dark.svg" width="107" /></a>
				<a class="brand sub ide" href="./">CODE</a>

				<div class="nav-collapse collapse">
				<ul class="nav">
					<!-- required submenu  on every subsite -->
					<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-book"></i> Browse <b class="caret"></b></a>
						<ul class="dropdown-menu">
							::foreach category sitemap::
							<li ::attr class if(category==currentCategory) "active":: ::cond !category.isSerie::><a href="::category.outputPath::">::category.title:: <small class="category-count">(::category.getPageCount()::)</small></a></li>
							::end::
						</ul>
					</li>
					<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-tags"></i> Tags <b class="caret"></b></a>
						<ul class="dropdown-menu">
							::foreach tag getSortedTags()::<li ::cond tags.get(tag).length>1:: ::attr class if(tag==currentPage.customData.tag) "active"::><a href="tag/::tag::.html" rel="tag"><i class="fa fa-tag"></i> ::getTagTitle(tag):: <small class="category-count">(::tags.get(tag).length::)</small></a></li>::end::
						</ul>
					</li>
					<li class="divider"></li>
					<!-- required submenu  on every subsite, put class="active" on   -->
					<li class="dropdown">
						<a class="dropdown-toggle" data-toggle="dropdown" href="https://haxe.org/documentation/">Learn Haxe <b class="caret"></b></a>
						<ul class="dropdown-menu">
							<li>
								<a href="https://haxe.org/documentation/introduction/" rel="external nofollow noopener">Introduction</a>
							</li>
							<li>
								<a href="https://haxe.org/manual/" rel="external nofollow noopener">Manual</a>
							</li>
							<li class="active">
								<a href="https://code.haxe.org" rel="external nofollow noopener">Code Cookbook</a>
							</li>
							<li>
								<a href="https://api.haxe.org" rel="external nofollow noopener">API Documentation</a>
							</li>
							<li class="divider"></li>
							<li>
								<a href="https://haxe.org/videos/" rel="external nofollow noopener">Videos</a>
							</li>
							<li class="divider"></li>
							<li>
								<a href="https://try.haxe.org" rel="external nofollow noopener">Try Haxe online</a>
							</li>
							<li>
								<a href="https://lib.haxe.org" rel="external nofollow noopener">Haxelib</a>
							</li>
						</ul>
				</li>
				<li class=" dropdown">
					<a class="dropdown-toggle" data-toggle="dropdown" href="#">Connect <b class="caret"></b></a>
					<ul class="dropdown-menu">
						<li><a href="https://github.com/HaxeFoundation" rel="external nofollow noopener"><i class="fa fa-github"></i> GitHub</a></li>
						<li><a href="https://github.com/HaxeFoundation/haxe/issues" rel="external nofollow noopener"><i class="fa fa-github"></i> Bug reports</a></li>
						<li><a href="https://stackoverflow.com/questions/tagged/haxe" rel="external nofollow noopener"><i class="fa fa-stack-overflow"></i> Stack Overflow</a></li>
						<li><a href="https://community.haxe.org/" rel="external nofollow noopener"><i class="fa fa-envelope-o"></i> Forums</a></li>
						<li><a href="https://discordapp.com/invite/0uEuWH3spjck73Lo" rel="external nofollow"><i class="fa fa-comments-o"></i> Discord</a></li>
						<li><a href="https://gitter.im/HaxeFoundation/haxe" rel="external nofollow"><i class="fa fa-comments-o"></i> Gitter</a></li>
						<li><a href="https://haxe.org/blog"><i class="fa fa-rss"></i> Blog</a></li>
						<li class="divider"></li>
						<li><a href="https://www.facebook.com/haxe.org/" rel="external nofollow noopener"><i class="fa fa-facebook"></i> Facebook</a></li>
						<li><a href="https://twitter.com/search?q=%23haxe" rel="external nofollow noopener"><i class="fa fa-twitter"></i> #haxe</a></li>
						<li><a href="https://twitter.com/haxelang" rel="external nofollow noopener"><i class="fa fa-twitter"></i> @haxelang</a></li>
						<li><a href="https://twitter.com/haxe_org" rel="external nofollow noopener"><i class="fa fa-twitter"></i> @haxe_org</a></li>
						<li class="divider"></li>
						<li><a href="https://haxe.org/foundation/contact.html" rel="external nofollow noopener">Contact</a></li>
					</ul>
				</li>
			</ul>
			</div>
		</div>
	</div>
</nav>
<div class="main-content">
::raw __content__::
</div>
<footer class="section dark site-footer">
	<div class="container">
		<div class="copyright">
			<p>
			&copy;::DateTools.format(now, "%Y")::&nbsp;<a class="hf-link" href="https://haxe.org/foundation/" rel="external nofollow noopener" title="Haxe Foundation Website">Haxe Foundation</a> |
			&nbsp;<a href="https://github.com/HaxeFoundation/code-cookbook" title="Haxe Code Cookbook on GitHub" rel="external nofollow noopener">Code Cookbook on GitHub</a> 
			</p>
			<p class="last-modified">Last deploy: ::DateTools.format(now, "%b %d, %Y")::</p>
		</div>
	</div>
</footer>

<link rel="stylesheet" type="text/css" href="css/font-awesome.css" />


<script defer="defer" src="https://haxe.org/js/jquery.min.js"></script>
<script defer="defer" src="https://haxe.org/js/bootstrap.min.js"></script>

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-74262827-2', 'auto');
  ga('send', 'pageview');
</script>

</body>
</html>
