<?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>Alex Jeffery &#187; Programming</title>
	<atom:link href="http://www.alexjeffery.org/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alexjeffery.org</link>
	<description></description>
	<lastBuildDate>Sun, 09 Aug 2009 05:14:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How To Embed An MP3 In Haxe With FlashDevelop</title>
		<link>http://www.alexjeffery.org/programming/how-to-embed-an-mp3-in-haxe-with-flashdevelop/</link>
		<comments>http://www.alexjeffery.org/programming/how-to-embed-an-mp3-in-haxe-with-flashdevelop/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 13:09:30 +0000</pubDate>
		<dc:creator>Alex Jeffery</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flashdevelop]]></category>
		<category><![CDATA[haxe]]></category>
		<category><![CDATA[swfmill]]></category>

		<guid isPermaLink="false">http://www.alexjeffery.org/?p=356</guid>
		<description><![CDATA[Another quick tutorial about using embedded assets in Flash using Haxe and Flashdevelop.
This time we are embedding an mp3.
For some reason in FlashDevelop after adding an mp3 to your project you can&#8217;t add the mp3 to the library. I am unsure why this is.  What this means is we can&#8217;t embed the mp3 in exactly the [...]]]></description>
			<content:encoded><![CDATA[<p>Another quick tutorial about using embedded assets in Flash using <a title="Haxe" href="http://haxe.org/">Haxe</a> and <a title="FlashDevelop" href="http://www.flashdevelop.org/">Flashdevelop</a>.<br />
This time we are embedding an mp3.</p>
<p>For some reason in FlashDevelop after adding an mp3 to your project you can&#8217;t add the mp3 to the library. I am unsure why this is.  What this means is we can&#8217;t embed the mp3 in exactly the same way as we <a href="http://www.alexjeffery.org/programming/embed-a-custom-bitmap-using-haxe-and-flashdevelop/">embed a bitmap</a></p>
<p>Luckly there is a work around. There is a utility program called <a title="SWFMill" href="http://swfmill.org/">SWFMill</a> that can create SWF files based on an xml config file. It looks like FlashDevelop uses SWFMill behind the scenes to create it&#8217;s library. You can see this by looking in the obj folder for a flash project as there is an xml file in there and also in the FlashDevelop install location, it includes a version of SWFMill.</p>
<p>So the first step is to create a swf file that contains our target mp3 file. My example xml config looks like this.</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="sc3"><span class="re1">&lt;?xml</span> <span class="re0">version</span>=<span class="st0">&quot;1.0&quot;</span> <span class="re0">encoding</span>=<span class="st0">&quot;utf-8&quot;</span><span class="re2">?&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1"><span class="sc3"><span class="re1">&lt;movie</span> <span class="re0">version</span>=<span class="st0">&quot;9&quot;</span> <span class="re0">width</span>=<span class="st0">&quot;800&quot;</span> <span class="re0">height</span>=<span class="st0">&quot;600&quot;</span> <span class="re0">framerate</span>=<span class="st0">&quot;30&quot;</span><span class="re2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="sc3"><span class="re1">&lt;background</span> <span class="re0">color</span>=<span class="st0">&quot;#FF0080&quot;</span> <span class="re2">/&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="sc3"><span class="re1">&lt;frame<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;library<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;sound</span> <span class="re0">id</span>=<span class="st0">&quot;Funk&quot;</span> <span class="re0">name</span>=<span class="st0">&quot;Funk&quot;</span> <span class="re0">import</span>=<span class="st0">&quot;Funk.mp3&quot;</span><span class="re2">/&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/library<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="sc3"><span class="re1">&lt;/frame<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1"><span class="sc3"><span class="re1">&lt;/movie<span class="re2">&gt;</span></span></span></div>
</li>
</ol>
</div>
<p>After creating the config file we call SWFMill to build the swf file with our mp3 in it. The  call looks like this.</p>
<p>swfmill.exe simple config.xml music.swf</p>
<p>After SWFMill has run you should get a music.swf file and it should be about the same file size as your mp3.</p>
<p>Now import the music.swf file into your FlashDevelop project.<br />
Right click the music.swf file and select the add to library option.</p>
<p>Now we need to create a class for the music file. There is one thing to note here. If you want this music class to be in a package you must set it&#8217;s name attribute in the SWFMill config above to &#8220;packageName.AssetName&#8221; or else you will get an error 2068 invalid sound. Here is the code snippet to create the sound class.</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw3">import</span> flash.<span class="me1">media</span>.<span class="kw3">Sound</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">class</span> Funk <span class="kw3">extends</span> <span class="kw3">Sound</span> <span class="br0">&#123;</span> <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw2">new</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="kw3">super</span><span class="br0">&#40;</span><span class="br0">&#41;</span>; <span class="br0">&#125;</span> <span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>Playing the music is now very easy.</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">var</span> music:Funk;</div>
</li>
<li class="li1">
<div class="de1">music = <span class="kw2">new</span> Funk<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">music.<span class="kw3">play</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjeffery.org/programming/how-to-embed-an-mp3-in-haxe-with-flashdevelop/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How To Embed A SWF File In Haxe</title>
		<link>http://www.alexjeffery.org/programming/how-to-embed-a-swf-file-in-haxe/</link>
		<comments>http://www.alexjeffery.org/programming/how-to-embed-a-swf-file-in-haxe/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 08:35:06 +0000</pubDate>
		<dc:creator>Alex Jeffery</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flashdevelop]]></category>
		<category><![CDATA[haxe]]></category>

		<guid isPermaLink="false">http://www.alexjeffery.org/?p=225</guid>
		<description><![CDATA[Overview
This tutorial will show you how to access objects from an SWF file using Haxe and FlashDevelop. By following these steps you will be able to compile ActionScript 3 code into a SWC, extract the SWF file from the SWC, embed the SWF file in your Haxe project and access the ActionScript 3 objects.
Prerequisites

FlashDevelop installed
Haxe [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Overview</strong></p>
<p>This tutorial will show you how to access objects from an SWF file using <a title="Haxe" href="http://haxe.org/">Haxe</a> and <a title="FlashDevelop" href="http://www.flashdevelop.org/">FlashDevelop</a>. By following these steps you will be able to compile ActionScript 3 code into a SWC, extract the SWF file from the SWC, embed the SWF file in your Haxe project and access the ActionScript 3 objects.</p>
<p><strong>Prerequisites</strong></p>
<ul>
<li><a title="How to install FlashDevelop" href="http://www.alexjeffery.org/programming/how-to-install-flashdevelop/">FlashDevelop installed</a></li>
<li>Haxe installed</li>
<li>Flex3 SDK installed</li>
</ul>
<p>For this tutorial I am going to be embedding this <a title="AS3 SWF Profiler" href="http://www.lostinactionscript.com/blog/index.php/2008/10/06/as3-swf-profiler/">AS3 SWF Profiler</a> written by Shane McCartney. Note that I will be using the version downloaded from <a title="Lost In ActionScript On Google Code" href="http://code.google.com/p/lostinactionscript/">GoogleCode</a> it has a different package than the one on his blog.</p>
<p><strong>Compiling a SWC</strong></p>
<p>To compile a SWC from ActionScript soure we need to use the compc component compiler that came with the Flex3 SDK. It can be found in the bin directory under your Flex3 SDK root dir. For example &#8220;C:\flexsdk\bin\compc.exe&#8221;</p>
<p>To run the compiler I found it easiest to create a config file and tell compc that to use it to work out what to compile. Here is an example config with comments explaining what each element does.</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="sc3"><span class="re1">&lt;flex-config<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="sc3"><span class="re1">&lt;compiler<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;source-path<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1"><span class="sc3"><span class="coMULTI">&lt;!&#8211;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="coMULTI">The path-element tells compc where to find the actionscript source files</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&#8211;&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;path-element<span class="re2">&gt;</span></span></span>D:\Flash Games\External\SWF Profiler<span class="sc3"><span class="re1">&lt;/path-element<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/source-path<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="sc3"><span class="re1">&lt;/compiler<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li2">
<div class="de2"><span class="sc3"><span class="coMULTI">&lt;!&#8211;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">The output tells compc what to call the compiled file.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&#8211;&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="sc3"><span class="re1">&lt;output<span class="re2">&gt;</span></span></span>SWFProfiler.swc<span class="sc3"><span class="re1">&lt;/output<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="sc3"><span class="re1">&lt;include-classes<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li2">
<div class="de2"><span class="sc3"><span class="coMULTI">&lt;!&#8211;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">The class nodes tell compc wich classes to include.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">Add more class nodes to add more classes to the output.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">Note: The class files have to be in folders that match their package under the path-element directory.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">For example my actionscript file is found here D:\Flash Games\External\SWF Profiler\com\lia\utils\SWFProfiler.as</span></div>
</li>
<li class="li2">
<div class="de2"><span class="coMULTI">&#8211;&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;class<span class="re2">&gt;</span></span></span>com.lia.utils.SWFProfiler<span class="sc3"><span class="re1">&lt;/class<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="sc3"><span class="re1">&lt;/include-classes<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1"><span class="sc3"><span class="re1">&lt;/flex-config<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>Then simply call compc from the command line and tell it to use this config file.<br />
For example: &#8221;C:\flexsdk\bin\compc.exe&#8221; -load-config+=config.xml</p>
<p>If all goes well you will end up with a new file called SWFProfiler.swc</p>
<p><strong>Generate Haxe classes</strong></p>
<p>After compiling our SWC file we need to generate some Haxe classes so that we can reference these object from our Haxe project. This is pretty easy as the Haxe compiler will help do this for us but first we need to extract the SWF file from the SWC file.</p>
<p>Take the SWFProfiler.swc and rename it to SWFProfiler.zip</p>
<p>Open this zip file and extract the library.swf file.</p>
<p>Tell the Haxe compiler to generate class files for the library.swf by executing this command from the command line:</p>
<p>haxe &#8211;gen-hx-classes library.swf</p>
<p>If all goes well you will have a directory structure that looks like this:</p>
<p>hxclasses\com\lia\utils\SWFProfiler.hx</p>
<p><strong>Embeding the SWF file into the Haxe project</strong></p>
<p>Open your Haxe project with FlashDevelop.</p>
<p>Duplicate the directory structure that was generated by the Haxe compiler. The easiest way to do this that I have found is to copy the com directory in Windows explorer and paste it under my src directory in FlashDevelop.</p>
<p>Import the library.swf file into your Haxe project. Again I find it is easy to copy/paste it from Windows explorer into my haxe project.</p>
<p>Rename the library.swf to some thing more meaningful. Eg: SWFProfiler.swf</p>
<p>Right click the SWFProfiler.swf and press the &#8220;Add to library&#8221; menu option</p>
<p>You should now be able to call the SWFProfiler code from your Haxe code!</p>
<p>For example I have this line of code in my test project and I am able to then use the profiler in my compiled Haxe project.</p>
<p>SWFProfiler.init(flash.Lib.current.stage,flash.Lib.current);</p>
<p><strong>Conclusion</strong></p>
<p>By following these steps you should now be able to compile ActionScript 3 source code into a swc file, extract a libray.swf file from the swc file, generate Haxe classes for each class in the swf, embed the swf and use the embeded objects from a Haxe project in FlashDevelop.</p>
<p><strong>References</strong>
<ul>
<li><a title="Using compc the component compiler" href="http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_22.html">Using compc the component compiler</a></li>
<li><a title="Using MochiAds in haXe" href="http://hesselboom.com/blog/2009/04/using-mochiads-in-haxe/">Using MochiAds in haXe</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjeffery.org/programming/how-to-embed-a-swf-file-in-haxe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Install FlashDevelop</title>
		<link>http://www.alexjeffery.org/programming/how-to-install-flashdevelop/</link>
		<comments>http://www.alexjeffery.org/programming/how-to-install-flashdevelop/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 00:31:50 +0000</pubDate>
		<dc:creator>Alex Jeffery</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flashdevelop]]></category>
		<category><![CDATA[game programming]]></category>

		<guid isPermaLink="false">http://www.alexjeffery.org/?p=98</guid>
		<description><![CDATA[Overview
I will be covering how to install and configure FlashDevelop a free, opensource Flash IDE for Windows.
Prerequisites
You will need to have the following software installed before starting this instalation.

Microsoft .NET Framework Version 2.0 Redistributable Package (x86)
Java

Step 1
Download the following:

FlashDevelop
Flash Player 10 ActiveX control content debugger (for IE)
Flash Player 10 Projector content debugger
Flex 3 SDK
FlashDevelop Hello [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Overview</strong></p>
<p>I will be covering how to install and configure FlashDevelop a free, opensource Flash <a title="Integrated Development Environment" href="http://en.wikipedia.org/wiki/Integrated_development_environment">IDE</a> for <a title="Microsoft Windows" href="http://en.wikipedia.org/wiki/Microsoft_Windows">Windows</a>.</p>
<p><strong>Prerequisites</strong></p>
<p>You will need to have the following software installed before starting this instalation.</p>
<ul>
<li><span style="text-decoration: underline;"><a style="text-decoration: none;" title="Microsoft .NET Framework Version 2.0 Redistributable Package (x86)" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&amp;displaylang=en">Microsoft .NET Framework Version 2.0 Redistributable Package (x86)</a></span></li>
<li><a title="Java" href="http://www.java.com">Java</a></li>
</ul>
<p><strong>Step 1</strong></p>
<p>Download the following:</p>
<ul>
<li><a title="FlashDevelop Releases" href="http://www.flashdevelop.org/community/viewforum.php?f=11">FlashDevelop</a></li>
<li><a title="Flash 10 ActiveX Content Debugger" href="http://download.macromedia.com/pub/flashplayer/updaters/10/flashplayer_10_ax_debug.exe">Flash Player 10 ActiveX control content debugger (for IE)</a></li>
<li><a style="text-decoration: none;" title="Flash 10 Projector Content Debugger" href="http://download.macromedia.com/pub/flashplayer/updaters/10/flashplayer_10_sa_debug.exe">Flash Player 10 Projector content debugger</a></li>
<li><a title="Flex 3 SDK" href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3">Flex 3 SDK</a></li>
<li><a title="Flash Develop Hello World Project" rel="attachment wp-att-131" href="http://www.alexjeffery.org/programming/how-to-install-flashdevelop/attachment/hello-world/">FlashDevelop Hello World Project</a></li>
</ul>
<p><strong>Step 2</strong></p>
<p>Install the Flash Player ActiveX content debugger. There are no install options or configuration needed.</p>
<p><strong>Step 3</strong></p>
<p>Unzip the Flex 3 SDK to c:\Flex3Sdk</p>
<p><strong>Step 4</strong></p>
<p>Run the FlashDevelop installer using the default install options.</p>
<p>Launch FlashDevelop. Open the settings dialog by going to the Tools/Settings menu.</p>
<p>You can also press F10 to launch the settings dialog.</p>
<p>From the left hand side under plugins select the AS3Context.</p>
<p>Now in the right hand side menu under Language set the Flex SDK Location to the directory you unzipped the Flex sdk too. For example c:\Flex3sdk</p>
<p><strong>Step 5</strong></p>
<p>Unzip the Flash Develop Hello World Project.</p>
<p>Double click the Hello World.as3proj to load the Hello World project.</p>
<p>Press F5 to build and run the Flash application.</p>
<p>You should get a Flash application popup with Hello World in a big blue font if your install is successful.</p>
<p><strong>Conclusion</strong></p>
<p>You should now have a working, tested and verified install of FlashDevelop.</p>
<p>If you run into any issues you can try these pages on the FlashDevelop wiki for troubleshooting.</p>
<ul>
<li><a title="Getting Started" href="http://www.flashdevelop.org/wikidocs/index.php?title=Getting_Started">Getting Started</a></li>
<li><a title="AS3" href="http://www.flashdevelop.org/wikidocs/index.php?title=AS3">AS3</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjeffery.org/programming/how-to-install-flashdevelop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embed A Custom Bitmap Using Haxe And FlashDevelop</title>
		<link>http://www.alexjeffery.org/programming/embed-a-custom-bitmap-using-haxe-and-flashdevelop/</link>
		<comments>http://www.alexjeffery.org/programming/embed-a-custom-bitmap-using-haxe-and-flashdevelop/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 14:19:57 +0000</pubDate>
		<dc:creator>Alex Jeffery</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flashdevelop]]></category>
		<category><![CDATA[haxe]]></category>

		<guid isPermaLink="false">http://www.alexjeffery.org/?p=199</guid>
		<description><![CDATA[Recently I started learning Haxe to program Flash games using FlashDevelop. I wanted to embed a custom bitmap image to use as my player sprite. It took me two days to figure this out, so I am writing a quick tutorial in the hope it will save someone else some time.
Add a png file to [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I started learning <a title="Haxe" href="http://haxe.org/">Haxe</a> to program Flash games using <a title="FlashDevelop" href="http://www.flashdevelop.org/">FlashDevelop</a>. I wanted to embed a custom bitmap image to use as my player sprite. It took me two days to figure this out, so I am writing a quick tutorial in the hope it will save someone else some time.</p>
<p>Add a png file to your FlashDevelop project<br />
Right click your png file and click the &#8220;Add to library&#8221; option<br />
Right click your png again and select the new &#8220;Options&#8221; option that is now active<br />
Check the &#8220;Embed as Bitmap instead of clip&#8221; check box<br />
Uncheck the &#8220;Auto-generate ID for attachMovie():&#8221;</p>
<p>Enter a sensible name Eg &#8220;PlayerBitmap&#8221;.<br />
Prefix this name with the package your Main is found in. Eg &#8220;org.alexjeffery.PlayerBitmap&#8221;</p>
<p>The need to prefix your embeded sprite name with the package name tripped me up when I was trying to get this to work. If you don&#8217;t do it the code will compile fine but you will get an invalid bitmap exception when you try to create your custom BitmapData class.</p>
<p>Add the following code to your project</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">class</span> PlayerBitmap <span class="kw3">extends</span> BitmapData <span class="br0">&#123;</span><span class="kw3">public</span> <span class="kw2">function</span> <span class="kw2">new</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><span class="kw3">super</span><span class="br0">&#40;</span><span class="nu0">0</span>,<span class="nu0">0</span><span class="br0">&#41;</span>;<span class="br0">&#125;</span><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">var</span> bitmapData:BitmapData;</div>
</li>
<li class="li1">
<div class="de1">bitmapData = <span class="kw2">new</span> PlayerBitmap<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">var</span> bitmap:Bitmap = <span class="kw2">new</span> Bitmap<span class="br0">&#40;</span>bitmapData, flash.<span class="me1">display</span>.<span class="me1">PixelSnapping</span>.<span class="me1">AUTO</span>, <span class="kw2">false</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">bitmap.<span class="me1">x</span> = <span class="nu0">100</span>;</div>
</li>
<li class="li1">
<div class="de1">bitmap.<span class="me1">y</span> = <span class="nu0">100</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">flash.<span class="me1">Lib</span>.<span class="me1">current</span>.<span class="me1">addChild</span><span class="br0">&#40;</span>bitmap<span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
<p>Build and test your movie.<br />
You should see your custom sprite on the screen.</p>
<p>References:<br />
<a href="http://sness.blogspot.com/2008/02/embed-bitmap-in-haxe.html">Embed bitmap in haxe</a><br />
<a href="http://stackoverflow.com/questions/1115383/how-to-embed-and-display-a-png-with-flashdevelop-haxe-and-swfmill">How to embed and display a png with FlashDevelop, Haxe and Swfmill</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjeffery.org/programming/embed-a-custom-bitmap-using-haxe-and-flashdevelop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHP session lost when using Applets or Flash</title>
		<link>http://www.alexjeffery.org/programming/cakephp/cakephp-session-lost-when-using-applets-or-flash/</link>
		<comments>http://www.alexjeffery.org/programming/cakephp/cakephp-session-lost-when-using-applets-or-flash/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 23:40:55 +0000</pubDate>
		<dc:creator>Alex Jeffery</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Pulpcore]]></category>

		<guid isPermaLink="false">http://blog.alexjeffery.org/2008/03/27/cakephp-session-lost-when-using-applets-or-flash/</guid>
		<description><![CDATA[Recently I have been developing a website on my dev machine using the CakePHP framework. During this I ran into a problem where I could log a user in, view a Pulpcore applet and then be logged out right after viewing it.
After doing a bit of searching on the net I found the cause and [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have been developing a website on my dev machine using the <a href="http://www.cakephp.org/">CakePHP</a> framework. During this I ran into a problem where I could log a user in, view a Pulpcore applet and then be logged out right after viewing it.</p>
<p>After doing a bit of searching on the net I found the cause and the solution.</p>
<p>The cause:<br />
My Pulpcore applet trying to do a request a CakePHP action from the web server to get and set the highscores.<br />
CakePHP would check the HTTP_USER_AGENT and compare it to the one used to create the session.<br />
When it found that they differed it would kill the session thinking it was preventing a session hijack attempt.</p>
<p>A solution:<br />
In the config/core.php set the following lines<br />
Configure::write(&#8217;Session.checkAgent&#8217;, false);<br />
Configure::write(&#8217;Security.level&#8217;, &#8216;medium&#8217;);</p>
<p>This will stop CakePHP from regenerating a session every request and stop CakePHP from checking the user agent.<br />
After that my Pulpcore applets where able to request actions as the logged in user fine and keep the session alive.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjeffery.org/programming/cakephp/cakephp-session-lost-when-using-applets-or-flash/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Pulpcore: Hello world tutorial</title>
		<link>http://www.alexjeffery.org/programming/pulpcore/pulpcore-hello-world-tutorial/</link>
		<comments>http://www.alexjeffery.org/programming/pulpcore/pulpcore-hello-world-tutorial/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 13:38:12 +0000</pubDate>
		<dc:creator>Alex Jeffery</dc:creator>
				<category><![CDATA[Pulpcore]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.alexjeffery.org/2008/02/06/pulpcore-hello-world-tutorial/</guid>
		<description><![CDATA[A while ago I found a neat Java API called Pulpcore
Pulpcore is an API for creating games in Java as web applets while maintaining a good user experience.
It looks to be quite promising from my dabbling with it so far.
Check out the demo game Milpa to see for your self.
A weak point I can see [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I found a neat <a href="http://www.java.com">Java</a> API called <a href="http://www.interactivepulp.com/pulpcore/">Pulpcore</a></p>
<p>Pulpcore is an API for creating games in Java as web applets while maintaining a good user experience.<br />
It looks to be quite promising from my dabbling with it so far.<br />
Check out the demo game <a href="http://www.pulpgames.net/milpa/">Milpa</a> to see for your self.</p>
<p>A weak point I can see with Pulpcore is the lack of documentation for people to get started with.<br />
So now I will introduce a setting up a simple Hello world tutorial with the awesome <a href="http://www.eclipse.org/">Eclipse</a> IDE.</p>
<p>You can find the tutorial <a href="http://blog.alexjeffery.org/pulpcore-tutorials/">here</a>.</p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjeffery.org/programming/pulpcore/pulpcore-hello-world-tutorial/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Crystal Reports Tip: crdb_oracle.dll could not be loaded</title>
		<link>http://www.alexjeffery.org/programming/crystal-reports/crystal-reports-tip-crdb_oracledll-could-not-be-loaded/</link>
		<comments>http://www.alexjeffery.org/programming/crystal-reports/crystal-reports-tip-crdb_oracledll-could-not-be-loaded/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 13:21:18 +0000</pubDate>
		<dc:creator>Alex Jeffery</dc:creator>
				<category><![CDATA[Crystal Reports]]></category>

		<guid isPermaLink="false">http://blog.alexjeffery.org/2008/02/06/crystal-reports-tip-crdb_oracledll-could-not-be-loaded/</guid>
		<description><![CDATA[At work recently I had to use Crystal reports
We where using it to connect to an Oracle database and generate a report which was then displayed from an ASPX page.
Both of these installs failed at first with the error:
&#8220;The database dll &#8216;crdb_oracle.dll&#8217; could not be loaded&#8221;
Here is a check list of things to try.

Check that [...]]]></description>
			<content:encoded><![CDATA[<p>At work recently I had to use <a href="http://www.businessobjects.com/products/reporting/crystalreports/">Crystal reports</a><br />
We where using it to connect to an <a href="http://www.oracle.com">Oracle</a> database and generate a report which was then displayed from an ASPX page.</p>
<p>Both of these installs failed at first with the error:<br />
&#8220;<strong>The database dll &#8216;crdb_oracle.dll&#8217; could not be loaded</strong>&#8221;<br />
Here is a check list of things to try.</p>
<ol>
<li>Check that crdb_oracle.dll is installed. By default in the Crystal Reports 10 install that I had Oracle was not installed. To fix it run the installer and pick Oracle from the list of items to install.</li>
<li>Check you have the Oracle client tools installed. I remember vaguely it had to be version 9.2 upwards.</li>
<li>Check your PATH variable. If you have more than one version of the Oracle client tools installed I have read that Crystal reports will use the first one it finds set in the PATH variable. Make sure it is the correct version for the database your report needs to connect to.</li>
<li>Check that the IIS user that runs your reports has access to your Oracle client install. Parent directory&#8217;s count too from my experience.</li>
<li>Check that the IIS user that runs your reports has access to the crdb_oracle.dll</li>
<p>Checking these things fixed both installs. Both times it was a problem with the IIS user not being able to get to either the Oracle or Crystal report dll&#8217;s.</p>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjeffery.org/programming/crystal-reports/crystal-reports-tip-crdb_oracledll-could-not-be-loaded/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
