<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Xlander Software</title>
	<atom:link href="http://xlandersoftware.com/feed" rel="self" type="application/rss+xml" />
	<link>http://xlandersoftware.com</link>
	<description></description>
	<lastBuildDate>Fri, 27 Nov 2009 12:23:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Void Intruders: Wave Machine Design</title>
		<link>http://xlandersoftware.com/development/void-intruders-wave-machine-design</link>
		<comments>http://xlandersoftware.com/development/void-intruders-wave-machine-design#comments</comments>
		<pubDate>Tue, 24 Nov 2009 10:56:25 +0000</pubDate>
		<dc:creator>Xlander</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Haxe]]></category>
		<category><![CDATA[Void Intruders]]></category>

		<guid isPermaLink="false">http://xlandersoftware.com/?p=177</guid>
		<description><![CDATA[For Void Intruders I want the player to do battle with large waves of enemies.
In my previous game Notepad Wars I would randomly spawn in enemies from the edge of the screen. While this approach is quite easy and works it is not the most exciting to play. While playing Geometry Wars I noticed there [...]]]></description>
			<content:encoded><![CDATA[<p>For Void Intruders I want the player to do battle with large waves of enemies.<br />
In my previous game <a href="http://xlandersoftware.com/games/notepad-wars">Notepad Wars</a> I would randomly spawn in enemies from the edge of the screen. While this approach is quite easy and works it is not the most exciting to play. While playing <a href="http://www.bizarrecreations.com/games/geometry_wars_retro_evolved/">Geometry Wars</a> I noticed there where some patterns to how the enemies are spawned. Often there would be a swarm of green squares in each corner, or you would become surrounded by a circle of blue squares. These sort of waves are much more fun to encounter.<br />
<span id="more-177"></span><br />
Time to design a wave machine for Void Intruders.<br />
As a picture speaks a thousand words I have sketched up a rough design of the wave machine in <a href="http://en.wikipedia.org/wiki/Unified_Modeling_Language">UML</a>.<br />
I will walk you through my design thought process top to bottom.</p>
<p><a href="http://static.xlandersoftware.com/images/void-intruders/wave-machine.png"><br />
<img src="http://static.xlandersoftware.com/images/void-intruders/wave-machine-small.png" alt="Wave Machine UML diagram" /></a></p>
<p>WaveMachine: This is the class that the main game loop will call upon to spawn a new wave of enemies at the required intensity level. It will take in an array of waves to use. This way if I want a level that only features a subset of all the waves in the game I can do it easily.<br />
The main part of this class is the spawn random wave function, it will pick a wave at random from it&#8217;s collection and spawn it with the required intensity.</p>
<p>IWave: This is the interface that the WaveMachine class will use to interact with it&#8217;s collection of waves.<br />
The intensity parameter allows me to tweak how intense / hard a wave is. For example a surround wave of intensity 10 would only have a few enemies spawned in a large rough circle around the player. On the opposite end of the scale an intensity 80 surround wave would spawn a larger number of enemies in a tighter circle closer to the player.</p>
<p>Wave Classes: The wave classes are each a specific implementation of a particular wave pattern. For example the corner wave will spawn enemies in the each corner of the screen, while the surround wave will spawn enemies in a circle around the player.</p>
<p>IVoidSpriteFactory: Each wave takes an IVoidSpriteFactory parameter. This interface hides the implementation of generating a sprite for use in the wave. So by changing the sprite factory implementation I can vary what enemies are spawned for any wave pattern.</p>
<p>Object pool: Constantly creating sprites in Flash can be a performance hit. One way to optimize this to use the <a href="http://sourcemaking.com/design_patterns/object_pool">object pool pattern</a>. The object pool is filled with sprites ready to be used. Once you are finished using the object it is recycled back into the pool. Currently it is not know how hectic the spawn rate will be and if object pooling would be need or even if it would help. Since it will interface to the waves by the IVoidSpriteFactory I can implement object pooling later then test and measure the performance.</p>
<p>VoidSprite: This is base class for all sprites in Void Intruders.</p>
<p>So that is the overall design for Void Intruders wave machine. I think it will be flexible enough to allow any combination of sprites to any wave attack pattern. It will be interesting to see how to design survives a real world implementation.</p>
<p><iframe src="http://rcm.amazon.com/e/cm?t=xlandsoftw-20&#038;o=1&#038;p=48&#038;l=st1&#038;mode=books&#038;search=Flash%20ActionScript%20Game%20Programming&#038;fc1=000000&#038;lt1=_blank&#038;lc1=3366FF&#038;bg1=FFFFFF&#038;npa=1&#038;f=ifr" marginwidth="0" marginheight="0" width="728" height="90" border="0" frameborder="0" style="border:none;" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://xlandersoftware.com/development/void-intruders-wave-machine-design/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Void Intruders: Jelly Fish Movement Prototype</title>
		<link>http://xlandersoftware.com/development/void-intruders-jelly-fish-movement-prototype</link>
		<comments>http://xlandersoftware.com/development/void-intruders-jelly-fish-movement-prototype#comments</comments>
		<pubDate>Sun, 22 Nov 2009 08:38:36 +0000</pubDate>
		<dc:creator>Xlander</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Haxe]]></category>
		<category><![CDATA[Void Intruders]]></category>

		<guid isPermaLink="false">http://xlandersoftware.com/uncategorized/171</guid>
		<description><![CDATA[Started work on a retro 2d style shooter Flash game.
The video shows me dodging some jelly fish aliens.

I like the pause, then attack movement for the jelly fish. Unsure about the movement speed. Right now the time to close to the player is independent of the distance to travel. So far away jelly fish speed [...]]]></description>
			<content:encoded><![CDATA[<p>Started work on a retro 2d style shooter Flash game.<br />
The video shows me dodging some jelly fish aliens.<br />
<span id="more-171"></span><br />
I like the pause, then attack movement for the jelly fish. Unsure about the movement speed. Right now the time to close to the player is independent of the distance to travel. So far away jelly fish speed in fast, while closer ones are more sluggish.</p>
<p><object width="425" height="350"><param name="movie" value="http://youtube.com/v/dLwSMZaqlic"></param><embed src="http://youtube.com/v/dLwSMZaqlic" type="application/x-shockwave-flash" width="425" height="350"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://xlandersoftware.com/development/void-intruders-jelly-fish-movement-prototype/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to open a url by clicking an image in Flash using FlashDevelop and Haxe</title>
		<link>http://xlandersoftware.com/tutorial/how-to-open-a-url-by-clicking-an-image-in-flash-using-flashdevelop-and-haxe</link>
		<comments>http://xlandersoftware.com/tutorial/how-to-open-a-url-by-clicking-an-image-in-flash-using-flashdevelop-and-haxe#comments</comments>
		<pubDate>Mon, 16 Nov 2009 17:30:03 +0000</pubDate>
		<dc:creator>Xlander</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[FlashDevelop]]></category>
		<category><![CDATA[Haxe]]></category>

		<guid isPermaLink="false">http://xlandersoftware.com/?p=99</guid>
		<description><![CDATA[This tutorial will show you how to use FlashDevelop and Haxe to build a Flash application that can open a url by clicking on an image.

Step 1:
Embed an image into the FlashDevelop project.
I have written a tutorial on how to do this here: Embed an image with Haxe and FlashDevelop tutorial.
Step 2:
Wrap the bitmap in a sprite.
A bitmap [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial will show you how to use <a title="FlashDevelop" href="http://www.flashdevelop.org/">FlashDevelop</a> and <a title="Haxe" href="http://haxe.org/">Haxe</a> to build a <a title="Flash" href="http://www.adobe.com/products/flashplayer/">Flash</a> application that can open a <a title="Url" href="http://en.wikipedia.org/wiki/Uniform_Resource_Locator">url</a> by clicking on an image.</p>
<p><span id="more-99"></span><br />
Step 1:<br />
Embed an image into the FlashDevelop project.<br />
I have written a tutorial on how to do this here: <a href="http://xlandersoftware.com/tutorial/how-to-embed-and-display-an-image-using-flashdevelop-and-haxe">Embed an image with Haxe and FlashDevelop tutorial</a>.</p>
<p>Step 2:<br />
Wrap the bitmap in a sprite.</p>
<p>A <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Bitmap.html">bitmap</a> will not respond to a mouse click event. The simple solution to this is to create a <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Sprite.html">sprite</a> and add the bitmap as a child of the sprite.</p>
<pre>
var sprite:Sprite;
sprite = new Sprite();
sprite.addChild(new Bitmap(new ExampleBitmapData(),
    flash.display.PixelSnapping.AUTO, false));
flash.Lib.current.addChild(sprite);
</pre>
<p>Step 3:<br />
Bind the sprite&#8217;s on click event to a function.</p>
<pre>sprite.addEventListener(MouseEvent.CLICK, SpriteClicked);</pre>
<p>Step 3:<br />
Handle the sprite clicked event.</p>
<p>For the sprite <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/events/MouseEvent.html#CLICK">MouseEvent.Click</a> to be handled you will need an event handler with the following signature.</p>
<pre>function SpriteClicked(event:MouseEvent) : Void</pre>
<p>Step 4:<br />
Open the url on click.</p>
<p>Now that the sprite has a function bound to it&#8217;s mouse click event we can simply open a url in the event handler function. Haxe has a library function for opening url&#8217;s called <a href="http://haxe.org/api/flash/lib">getURL</a>. It takes a <a title="URLReuest" href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/URLRequest.html">URLRequest</a> object as an argument.</p>
<p>Here is a simple example of opening a url.</p>
<pre>flash.Lib.getURL(new URLRequest("http://xlandersoftware.com"), "_blank");</pre>
<p>Example:<br />
<code><br />
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="205" height="105"><param name="movie" value="http://xlandersoftware.com/files/tutorials/open-url/open-url.swf" /><!--[if !IE]>--><br />
<object type="application/x-shockwave-flash" data="http://xlandersoftware.com/files/tutorials/open-url/open-url.swf" width="205" height="105"><br />
<!--<![endif]--><br />
<a href="http://adobe.com/go/getflashplayer"><br />
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a><br />
<!--[if !IE]>--><br />
</object><br />
<!--<![endif]--><br />
</object><br />
</code></p>
<p><a href="http://xlandersoftware.com/files/tutorials/open-url/open-url.zip">Download Example Project</a></p>
<p>Software Versions Used:</p>
<ul>
<li>FlashDevelop 3.0.5</li>
<li>Haxe 2.03</li>
<li>Flash 10</li>
</ul>
<p><iframe src="http://rcm.amazon.com/e/cm?t=xlandsoftw-20&#038;o=1&#038;p=48&#038;l=st1&#038;mode=books&#038;search=Flash%20ActionScript%20Game%20Programming&#038;fc1=000000&#038;lt1=_blank&#038;lc1=3366FF&#038;bg1=FFFFFF&#038;npa=1&#038;f=ifr" marginwidth="0" marginheight="0" width="728" height="90" border="0" frameborder="0" style="border:none;" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://xlandersoftware.com/tutorial/how-to-open-a-url-by-clicking-an-image-in-flash-using-flashdevelop-and-haxe/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Game Release: Find The Pixel</title>
		<link>http://xlandersoftware.com/release/game-release-find-the-pixel</link>
		<comments>http://xlandersoftware.com/release/game-release-find-the-pixel#comments</comments>
		<pubDate>Sat, 14 Nov 2009 02:09:46 +0000</pubDate>
		<dc:creator>Xlander</dc:creator>
				<category><![CDATA[Release]]></category>
		<category><![CDATA[FlashDevelop]]></category>
		<category><![CDATA[Haxe]]></category>
		<category><![CDATA[Mochi]]></category>

		<guid isPermaLink="false">http://xlandersoftware.com/?p=134</guid>
		<description><![CDATA[I wanted to program a small entry to the Mochi November 2009 Contest – 60 Seconds to Fame and thus Find The Pixel was born.
The contest theme is a game that is over in 60 seconds or less. So you have 60 second to find a pixel hidden on the screen, each click you make [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to program a small entry to the <a href="http://mochiland.com/articles/november-2009-contest-60-seconds-to-fame">Mochi November 2009 Contest – 60 Seconds to Fame</a> and thus <a href="http://xlandersoftware.com/games/find-the-pixel">Find The Pixel</a> was born.<span id="more-134"></span></p>
<p>The contest theme is a game that is over in 60 seconds or less. So you have 60 second to find a pixel hidden on the screen, each click you make will give you a hint as to how close you are to the pixel.</p>
<p>The game was written over a week of spare time and is my first <a href="https://www.mochimedia.com/r/79a16ece24bffeed">Mochi</a> game written in <a href="http://haxe.org/">Haxe</a> using <a href="http://www.flashdevelop.org/">FlashDevelop</a>.</p>
<p>The nice graphics where taken from the graphic set released for the <a href="http://lostgarden.com/2008/02/play-with-your-peas-game-prototyping.html">Play with your peas prototype challenge</a> by Danc at LostGarden. Go check out his site it has a lot of good stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://xlandersoftware.com/release/game-release-find-the-pixel/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to embed and display an image using FlashDevelop and Haxe</title>
		<link>http://xlandersoftware.com/tutorial/how-to-embed-and-display-an-image-using-flashdevelop-and-haxe</link>
		<comments>http://xlandersoftware.com/tutorial/how-to-embed-and-display-an-image-using-flashdevelop-and-haxe#comments</comments>
		<pubDate>Sun, 01 Nov 2009 06:27:41 +0000</pubDate>
		<dc:creator>Xlander</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[FlashDevelop]]></category>
		<category><![CDATA[Haxe]]></category>

		<guid isPermaLink="false">http://xlandersoftware.com/?p=59</guid>
		<description><![CDATA[This tutorial will show you how to use FlashDevelop and the Haxe programming language to build a Flash application to display an embedded image.
Step 1:
Import an image into your FlashDevelop project. You can do in one of two ways.

Drag an image from Windows Explorer onto the project tree in FlashDevelop.
Right click the project tree, select Add, select Existing File and then [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial will show you how to use <a title="FlashDevelop" href="http://www.flashdevelop.org">FlashDevelop</a> and the <a title="Haxe" href="http://haxe.org/">Haxe</a> programming language to build a <a title="Flash" href="http://www.adobe.com/products/flashplayer/">Flash</a> application to display an embedded image.</p>
<p><span id="more-59"></span>Step 1:</p>
<p>Import an image into your FlashDevelop project. You can do in one of two ways.</p>
<ul>
<li>Drag an image from Windows Explorer onto the project tree in FlashDevelop.</li>
<li>Right click the project tree, select Add, select Existing File and then select an image.</li>
</ul>
<p>If you have imported the image correctly you will see it listed in the project tree in FlashDevelop as in this picture.</p>
<p><img class=" alignnone" src="http://xlandersoftware.com/files/tutorials/embedded-images/ImportedImage.png" alt="Imported Image" width="220" height="226" /></p>
<p>Step 2:</p>
<p>Adding the image to the asset library.</p>
<p>Adding the image to the asset library tells FlashDevelop to embed the asset into the Flash application.</p>
<ol>
<li>Right click the image in the project tree.</li>
<li>Select Add To Library</li>
</ol>
<p>If you have successfully added the image to the asset library it will display with blue text in the project tree.</p>
<p><img class="alignnone" src="http://xlandersoftware.com/files/tutorials/embedded-images/AddedToLibrary.png" alt="" width="220" height="226" /></p>
<p>Step 3:</p>
<p>Create an image class.</p>
<p>To be able to access the image Haxe needs a class that extends BitmapData for the embedded image to reference. This is the class you use in your code as a <a title="BitmapData" href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/BitmapData.html">BitmapData </a>object.</p>
<ol>
<li>Right click your project and select Add, New Class</li>
<li>Name the class FishBitmapData.hx</li>
<li>Declare the class to extends BitmapData</li>
<li>class FishBitmapData extends BitmapData { public function new() { super(0, 0); } }</li>
</ol>
<p>Step 4:</p>
<p>Reference the image class from the embedded image.</p>
<p>The FishBitmapData class needs to be able to reference the embedded image, this is done by setting the image id in the asset library.</p>
<ol>
<li>Right click the image in the project tree.</li>
<li>Select Options</li>
<li>Select the Advanced tab</li>
<li>Uncheck the &#8220;Auto generate id for attachMovie();&#8221; option</li>
<li>Enter a full class name in the text box underneath. &#8220;com.xlandersoftware.embeddedimage.FishBitmapData&#8221;</li>
<li>Check the embed as Bitmap instead of Clip option.</li>
</ol>
<p><img class="alignnone" src="http://xlandersoftware.com/files/tutorials/embedded-images/AdvancedDialog.png" alt="" width="330" height="306" /></p>
<p>Step 5:</p>
<p>Create a bitmap.</p>
<p>Create a new <a title="Bitmap" href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Bitmap.html">Bitmap</a> using the embedded image as the BitmapData and add it to the stage.</p>
<pre>var bitmap:Bitmap;
bitmap = new Bitmap(new FishBitmapData(), flash.display.PixelSnapping.ALWAYS, false);
flash.Lib.current.addChild(bitmap);</pre>
<p>Example:<br />
<code><br />
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="48" height="36"><param name="movie" value="http://xlandersoftware.com/files/tutorials/embedded-images/embedded-image.swf" /><!--[if !IE]>--><br />
<object type="application/x-shockwave-flash" data="http://xlandersoftware.com/files/tutorials/embedded-images/embedded-image.swf" width="48" height="36"><br />
<!--<![endif]--><br />
<a href="http://adobe.com/go/getflashplayer"><br />
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a><br />
<!--[if !IE]>--><br />
</object><br />
<!--<![endif]--><br />
</object><br />
</code></p>
<p><a href="http://xlandersoftware.com/files/tutorials/embedded-images/embedded-image.zip">Download Example Project</a></p>
<p>Credits:</p>
<p>The fish picture comes from &#8220;<a title="Fishing Girl" href="http://lostgarden.com/2008/11/fishing-girl-game-prototyping-challenge.html">Fishing Girl</a>&#8221; art by Daniel Cook (<a title="Lost Garden" href="http://lostgarden.com/">Lostgarden.com</a>)</p>
<p>Software Versions Used:</p>
<ul>
<li>FlashDevelop 3.0.5</li>
<li>Haxe 2.03</li>
<li>Flash 10</li>
</ul>
<p><iframe src="http://rcm.amazon.com/e/cm?t=xlandsoftw-20&#038;o=1&#038;p=48&#038;l=st1&#038;mode=books&#038;search=Flash%20ActionScript%20Game%20Programming&#038;fc1=000000&#038;lt1=_blank&#038;lc1=3366FF&#038;bg1=FFFFFF&#038;npa=1&#038;f=ifr" marginwidth="0" marginheight="0" width="728" height="90" border="0" frameborder="0" style="border:none;" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://xlandersoftware.com/tutorial/how-to-embed-and-display-an-image-using-flashdevelop-and-haxe/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to embed a font and display text using FlashDevelop and Haxe</title>
		<link>http://xlandersoftware.com/tutorial/how-to-embed-a-font-and-display-text-using-flashdevelop-and-haxe</link>
		<comments>http://xlandersoftware.com/tutorial/how-to-embed-a-font-and-display-text-using-flashdevelop-and-haxe#comments</comments>
		<pubDate>Sun, 01 Nov 2009 06:25:22 +0000</pubDate>
		<dc:creator>Xlander</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[FlashDevelop]]></category>
		<category><![CDATA[Haxe]]></category>

		<guid isPermaLink="false">http://xlandersoftware.com/?p=4</guid>
		<description><![CDATA[This tutorial will show you how to use FlashDevelop and the Haxe programming language to build a Flash application with an embedded true type font for displaying text.

Step 1:
Import a true type font into your FlashDevelop project. You can do in one of two ways.

Drag a font from Windows Explorer onto the project tree in FlashDevelop.
Right click the project [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial will show you how to use <a title="FlashDevelop" href="http://www.flashdevelop.org">FlashDevelop</a> and the <a title="Haxe" href="http://haxe.org/">Haxe</a> programming language to build a <a title="Flash" href="http://www.adobe.com/products/flashplayer/">Flash</a> application with an embedded <a title="True Type Font" href="http://en.wikipedia.org/wiki/TrueType">true type font</a> for displaying text.</p>
<p><span id="more-4"></span></p>
<p>Step 1:</p>
<p>Import a true type font into your FlashDevelop project. You can do in one of two ways.</p>
<ul>
<li>Drag a font from Windows Explorer onto the project tree in FlashDevelop.</li>
<li>Right click the project tree, select Add, select Existing File and then select a font.</li>
</ul>
<p>If you have imported the font correctly you will see it listed in the project tree in FlashDevelop as in this picture.</p>
<p><img class="alignnone" src="http://xlandersoftware.com/files/tutorials/embedded-fonts/ImportedFont.png" alt="Imported Font" width="217" height="186" /></p>
<p>Step 2:</p>
<p>Adding the font to the asset library.</p>
<p>Adding the font to the asset library tells FlashDevelop to embed the asset into the Flash application.</p>
<ol>
<li>Right click the font in the project tree.</li>
<li>Select Add To Library</li>
</ol>
<p>If you have successfully added the font to the asset library it will display with blue text in the project tree.</p>
<p>Step 3:</p>
<p>Give the font a friendly name.</p>
<p>Now that the font is embedded in our application we are able to use it in our code. By default FlashDevelop tends to give library assets long names, how ever it is very easy to give assets more friendly names.</p>
<ol>
<li>Right click the font in the project tree.</li>
<li>Select Options</li>
<li>Select the Advanced tab</li>
<li>Uncheck the &#8220;Auto generate id for attachMovie();&#8221; option</li>
<li>Enter a friendly name in the text box underneath.</li>
</ol>
<p><img class="alignnone" src="http://xlandersoftware.com/files/tutorials/embedded-fonts/FontFriendlyName.png" alt="Advanced Dialog" width="330" height="306" /></p>
<p>Step 4:</p>
<p>Display some text.</p>
<p>The <a title="TextField" href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/TextField.html">TextField</a> and <a title="TextFormat" href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/TextFormat.html">TextFormat</a> are the classes needed to display the text on the screen with a custom font.  Create a TextFormat object and set the font field to the friendly name that you gave your font in step 3.</p>
<p>textFormat.font = &#8220;Rexlia&#8221;;</p>
<p>Next create a TextField object. Set the embedFonts field to true and then set the defaultTextFormat field to the TextFormat object you created earlier. Add it to your stage as per normal and you should now see some text on the screen using the embedded font.</p>
<pre>textField.embedFonts = true;
textField.defaultTextFormat = textFormat;
flash.Lib.current.addChild(textField);</pre>
<p>Example:<br />
<code><br />
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="300" height="50"><param name="movie" value="http://xlandersoftware.com/files/tutorials/embedded-fonts/embedded-font.swf" /><!--[if !IE]>--><br />
<object type="application/x-shockwave-flash" data="http://xlandersoftware.com/files/tutorials/embedded-fonts/embedded-font.swf" width="300" height="50"><br />
<!--<![endif]--><br />
<a href="http://adobe.com/go/getflashplayer"><br />
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a><br />
<!--[if !IE]>--><br />
</object><br />
<!--<![endif]--><br />
</object><br />
</code></p>
<p><a href="http://xlandersoftware.com/files/tutorials/embedded-fonts/embeded-font.zip">Download Example Project</a></p>
<p>Software Versions Used:</p>
<ul>
<li>FlashDevelop 3.0.5</li>
<li>Haxe 2.03</li>
<li>Flash 10</li>
</ul>
<p><iframe src="http://rcm.amazon.com/e/cm?t=xlandsoftw-20&#038;o=1&#038;p=48&#038;l=st1&#038;mode=books&#038;search=Flash%20ActionScript%20Game%20Programming&#038;fc1=000000&#038;lt1=_blank&#038;lc1=3366FF&#038;bg1=FFFFFF&#038;npa=1&#038;f=ifr" marginwidth="0" marginheight="0" width="728" height="90" border="0" frameborder="0" style="border:none;" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://xlandersoftware.com/tutorial/how-to-embed-a-font-and-display-text-using-flashdevelop-and-haxe/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 4.136 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-03-10 13:52:18 -->
<!-- Compression = gzip -->