<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.2" -->
<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/"
	>

<channel>
	<title>alegitimatebusiness.com</title>
	<link>http://blog.alegitimatebusiness.com</link>
	<description>blog</description>
	<pubDate>Sat, 10 Nov 2007 01:02:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>
	<language>en</language>
			<item>
		<title>Best .NET AJAX&#8230; Hijax</title>
		<link>http://blog.alegitimatebusiness.com/2007/11/10/best-net-ajax-hijax/</link>
		<comments>http://blog.alegitimatebusiness.com/2007/11/10/best-net-ajax-hijax/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 01:01:12 +0000</pubDate>
		<dc:creator>tonypee</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.alegitimatebusiness.com/2007/11/10/best-net-ajax-hijax/</guid>
		<description><![CDATA[Have you ever wanted to eliminate the page refreshes when altering a pages properties in .NET? I have.
The way .NET allows you to access the DOM in your code and quickly change control&#8217;s properties, visibility, validate values, it is amazing, but the only issue is the dreaded page refresh! When i first heard about .NET [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wanted to eliminate the page refreshes when altering a pages properties in .NET? I have.</p>
<p>The way .NET allows you to access the DOM in your code and quickly change control&#8217;s properties, visibility, validate values, it is amazing, but the only issue is the dreaded page refresh! When i first heard about .NET extensions which could make these DOM changes quickly and easily with AJAX, using a method called Jijax, i was amazed! Another important thing is that the <a href="http://ajaxian.com/archives/hijax-graceful-degration">Hijax method will degrade gracefully.</a> This is to me, is the basis of treating a HTML site more like a my beloved Flash (or a RIA). The ability to build custom controls (like a class, of movieclip in flash) and then have them talk to each other, writing everything in a single language (c#) and (without a page refresh), make update changes. Beautiful. It also saves writing your application twice (for degredation)</p>
<p>enter <a href="http://www.anthemdotnet.com/" title="Anthem.NET">Anthem.NET </a></p>
<p>It is a stable and elegant implementation for .NET and works well in VWD Express and VWD 2005.  Check out the <a href="http://www.anthemdotnet.com/examples/Default.aspx" title="Anthem Examples">Anthem Examples</a> to get a good idea of its functionality. I have found that it has the best documentation and community of the available frameworks. Other Hijax frameworks include comfort ASP and MagicAJAX.NET V0.3.0 altho i had stability issues testing them (it is probably my setup, give them a go). I found a good <a href="http://www.daniel-zeiss.de/AJAXComparison/Results.htm">comparison of .NET Ajax</a>  helpful in comparing frameworks, altho be aware that it is written by the programmer who built comfort ASP.</p>
<p>To me these Anthem components are an essential part of the .NET framework, and more useful and elegant than the AJAX (Atlas) Extensions.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alegitimatebusiness.com/2007/11/10/best-net-ajax-hijax/feed/</wfw:commentRss>
		</item>
		<item>
		<title>AS2 + AS3 Draw a Dotted Rounded Corner Box</title>
		<link>http://blog.alegitimatebusiness.com/2007/11/07/as2-as3-draw-a-dotted-rounded-corner-box/</link>
		<comments>http://blog.alegitimatebusiness.com/2007/11/07/as2-as3-draw-a-dotted-rounded-corner-box/#comments</comments>
		<pubDate>Wed, 07 Nov 2007 11:31:35 +0000</pubDate>
		<dc:creator>tonypee</dc:creator>
		
		<category><![CDATA[AS3]]></category>

		<category><![CDATA[AS2]]></category>

		<guid isPermaLink="false">http://blog.alegitimatebusiness.com/2007/11/07/as2-as3-draw-a-dotted-rounded-corner-box/</guid>
		<description><![CDATA[So you might think that rounded corners is easy in as3 with the new drawing tools. This is only so true if you don&#8217;t want it dotted.
Thanks to senocular AS2 DashedLine.as which was easily converted to an as3 version DashedLine.as for as3 we can draw dotted lines and curves with actionscript. This left me with [...]]]></description>
			<content:encoded><![CDATA[<p>So you might think that rounded corners is easy in as3 with the new drawing tools. This is only so true if you don&#8217;t want it dotted.</p>
<p>Thanks to senocular AS2 <a href="http://www.senocular.com/flash/actionscript.php?file=ActionScript_2.0/com/senocular/drawing/DashedLine.as">DashedLine.as</a> which was easily converted to an as3 version <a href="http://blog.alegitimatebusiness.com/wp-content/uploads/2007/11/dashedline.as" title="DashedLine.as for as3">DashedLine.as for as3</a> we can draw dotted lines and curves with actionscript. This left me with the task of using the quadratic drawing tools (no i didnt add a cubic curveTo to the Dashed line class) to draw circles (or quarters of circles, for the curners), which isnt the easiest, but i&#8217;ll spare you the details and simply say, its done!</p>
<p>Using Draw.curvedBox(obj, offsetX, offsetY, width, height, cornerRadius) we can draw into any graphics object (whether it be a normal Sprite.graphics or a DashedLine Object). This is essential as the Dashed line tool doesnt actually give us a fill, so we might need to draw a normal shape for the background.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript"><span style="color: #0066CC;">import</span> com.<span style="color: #006600;">senocular</span>.<span style="color: #006600;">drawing</span>.<span style="color: #006600;">DashedLine</span>
<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">tonp</span>.<span style="color: #006600;">utils</span>.<span style="color: #006600;">Draw</span>
<span style="color: #000000; font-weight: bold;">var</span> dl = <span style="color: #000000; font-weight: bold;">new</span> DashedLine<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>,<span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#41;</span>;
dl.<span style="color: #0066CC;">lineStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span>,0x000000,<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
Draw.<span style="color: #006600;">curvedBox</span><span style="color: #66cc66;">&#40;</span>dl,<span style="color: #cc66cc;">10</span>,<span style="color: #cc66cc;">10</span>,<span style="color: #cc66cc;">100</span>,<span style="color: #cc66cc;">100</span>,<span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>to draw a curved corner box with a fill, or solid outline, send in mc.graphics as the first attribute (or just the mc in as2)</p>
<p><a href="http://blog.alegitimatebusiness.com/wp-content/uploads/2007/11/dashedline.as" title="DashedLine.as for as3">DashedLine.as for as3</a></p>
<p><a href="http://blog.alegitimatebusiness.com/wp-content/uploads/2007/11/draw.as" title="Draw.as for as3">Draw.as for as3</a></p>
<p><a href="http://blog.alegitimatebusiness.com/wp-content/uploads/2007/11/draw_as2.as" title="Draw.as for as2">Draw.as for as2</a></p>
<p>So we can now do a box with curved corners in either AS2 or AS3 and in dotted or normal&#8230; phew!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alegitimatebusiness.com/2007/11/07/as2-as3-draw-a-dotted-rounded-corner-box/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using Firebugs console.log in flash AS2 &#038; AS3</title>
		<link>http://blog.alegitimatebusiness.com/2007/11/07/using-firebugs-consolelog-in-flash-as2-as3/</link>
		<comments>http://blog.alegitimatebusiness.com/2007/11/07/using-firebugs-consolelog-in-flash-as2-as3/#comments</comments>
		<pubDate>Wed, 07 Nov 2007 10:13:32 +0000</pubDate>
		<dc:creator>tonypee</dc:creator>
		
		<category><![CDATA[AS3]]></category>

		<category><![CDATA[AS2]]></category>

		<guid isPermaLink="false">http://blog.alegitimatebusiness.com/2007/11/07/using-firebugs-consolelog-in-flash-as2-as3/</guid>
		<description><![CDATA[To use the excellent features of the firebug plugin for Firefox when debugging in flash, simply put this class in your ClassPath.
This will allow you to log Objects (yes it will iterate deep objects) log data which is externally loaded such as server requests. Overall it just makes life that little bit simpler.
Usage:
var obj:Object = [...]]]></description>
			<content:encoded><![CDATA[<p>To use the excellent features of the firebug plugin for Firefox when debugging in flash, simply put this class in your ClassPath.</p>
<p>This will allow you to log Objects (yes it will iterate deep objects) log data which is externally loaded such as server requests. Overall it just makes life that little bit simpler.</p>
<p>Usage:</p>
<p>var obj:Object = {hi:”Hello World”, {hi_again:”Hello again”}}<br />
console.log(obj)<br />
console.debug(obj)<br />
console.warn(obj)<br />
console.info(obj)<br />
console.error(obj)<br />
console.assert(exp) – tests that expression is TRUE<br />
console.dir(obj) – print an objects properties like in the DOM view<br />
console.dirxml(xml)<br />
console.group(name)<br />
console.endGroup(name)<br />
console.time(name)<br />
console.endTime(name)<br />
console.profile(name)<br />
console.endProfile()</p>
<p style="margin-bottom: 0in"><a href="http://blog.alegitimatebusiness.com/wp-content/uploads/2007/11/console1.as" title="Download console.as ( for AS2 )">Download console.as ( for AS2 )</a></p>
<p style="margin-bottom: 0in"><a href="http://blog.alegitimatebusiness.com/wp-content/uploads/2007/11/console.as" title="Download console.as ( for AS3 )">Download console.as ( for AS3 )</a></p>
<p style="margin-bottom: 0in">thanks to whomevers code i&#8217;ve cannibalized to get these, sorry i lost your links.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alegitimatebusiness.com/2007/11/07/using-firebugs-consolelog-in-flash-as2-as3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Simple AS2 Load Queue</title>
		<link>http://blog.alegitimatebusiness.com/2007/11/07/simple-dirty-load-queue/</link>
		<comments>http://blog.alegitimatebusiness.com/2007/11/07/simple-dirty-load-queue/#comments</comments>
		<pubDate>Wed, 07 Nov 2007 10:04:24 +0000</pubDate>
		<dc:creator>tonypee</dc:creator>
		
		<category><![CDATA[AS2]]></category>

		<guid isPermaLink="false">http://blog.alegitimatebusiness.com/2007/11/07/simple-dirty-load-queue/</guid>
		<description><![CDATA[For some reason I&#8217;ve found it hard to find a simple and easy to modify Multiple Loader Class. Be it images, swfs, xml, or maybe a custom implementation like loading items into a “Screen” (a class i use for managing pages and transition), this load queue will tell the overall progress as well as individual [...]]]></description>
			<content:encoded><![CDATA[<p>For some reason I&#8217;ve found it hard to find a simple and easy to modify Multiple Loader Class. Be it images, swfs, xml, or maybe a custom implementation like loading items into a “Screen” (a class i use for managing pages and transition), this load queue will tell the overall progress as well as individual progress for the item current loading.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript"><span style="color: #0066CC;">Import</span> com.<span style="color: #006600;">tonp</span>.<span style="color: #006600;">utils</span>.<span style="color: #006600;">LoadQueue</span>;var my_xml:<span style="color: #0066CC;">XML</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">XML</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> mc_drop:<span style="color: #0066CC;">MovieClip</span> = <span style="color: #0066CC;">createEmptyMovieClip</span><span style="color: #66cc66;">&#40;</span>“mc_drop”,<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">Var</span> lq:LoadQueue = <span style="color: #000000; font-weight: bold;">new</span> LoadQueue<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
lq.<span style="color: #0066CC;">add</span><span style="color: #66cc66;">&#40;</span>“image”, “images/<span style="color: #cc66cc;">1</span>.<span style="color: #006600;">jpg</span>”, mc_drop, <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
lq.<span style="color: #0066CC;">add</span><span style="color: #66cc66;">&#40;</span>“image”, “<span style="color: #0066CC;">xml</span>/test.<span style="color: #0066CC;">xml</span>”, my_xml, <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
lq.<span style="color: #0066CC;">onLoadInit</span> = Delegate.<span style="color: #006600;">create</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>, <span style="color: #0066CC;">onLoadInit</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="actionscript">lq.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Callback functions are fired by the LoadQueue Object are in two sections, events fired for the current item in the queue, and events for the overall progress of the queue:</p>
<p>Item Events</p>
<p>onLoadItemStart<br />
onLoadItemError<br />
onLoadItemProgress<br />
onLoadItemComplete<br />
onTotalLoadComplete</p>
<p>Overall Events</p>
<p>onLoadStart<br />
onLoadProgress<br />
onLoadComplete<br />
onLoadError</p>
<p>The functions return attributes similar to the LoadMovie() Object where possible.</p>
<p><a href="http://blog.alegitimatebusiness.com/wp-content/uploads/2007/11/loadqueue.as" title="LoadQueue.as">Download LoadQueue.as</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alegitimatebusiness.com/2007/11/07/simple-dirty-load-queue/feed/</wfw:commentRss>
		</item>
		<item>
		<title>AS2 Cast and attach a Custom MovieClip class</title>
		<link>http://blog.alegitimatebusiness.com/2007/11/07/as2-cast-and-attach-a-custom-movieclip-class/</link>
		<comments>http://blog.alegitimatebusiness.com/2007/11/07/as2-cast-and-attach-a-custom-movieclip-class/#comments</comments>
		<pubDate>Wed, 07 Nov 2007 06:17:39 +0000</pubDate>
		<dc:creator>tonypee</dc:creator>
		
		<category><![CDATA[AS2]]></category>

		<guid isPermaLink="false">http://blog.alegitimatebusiness.com/2007/11/07/as2-cast-and-attach-a-custom-movieclip-class/</guid>
		<description><![CDATA[One annoying thing that i found in as2 that has been fixed in as3 is the ability to write: new MyCustomClass() and then attach it to the stage. In AS2 there is no way to instantiate a class (which extends MovieClip) and have it parented to an existing MovieClip, unless you put it in the [...]]]></description>
			<content:encoded><![CDATA[<p>One annoying thing that i found in as2 that has been fixed in as3 is the ability to write: new MyCustomClass() and then attach it to the stage. In AS2 there is no way to instantiate a class (which extends MovieClip) and have it parented to an existing MovieClip, unless you put it in the library with a linkage identifier, and assign the class to that asset. This is an arduous process if the clip doesn&#8217;t even require any assets drawn in the IDE.</p>
<p>A useful way to work around this is to have an empty movieClip in the library with a linkage of &#8216;empty&#8217;. Then to instantiate your custom class you must dynamically assign that class to the empty library asset with registerClass. If you then attach the &#8216;empty&#8217; and cast it as your custom class type, bingo! you have your custom class instantiated on the stage.</p>
<p>registerClass( &#8220;empty&#8221;, MyCustomClass);</p>
<p>var mc:MyCustomClass = MyCustomClass(attachMovie(&#8221;empty&#8221;));</p>
<p>With correctly casting the attachMovie() you get correct typechecking and auto-completion in <a href="www.flashdevelop.org" title="FlashDevelop" target="_blank">FlashDevelop</a>. Remember, your custom class must extend MovieClip in the .as file</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alegitimatebusiness.com/2007/11/07/as2-cast-and-attach-a-custom-movieclip-class/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Reading XML as an Object Tree in AS2</title>
		<link>http://blog.alegitimatebusiness.com/2007/08/30/reading-xml-as-an-object-tree-in-as2/</link>
		<comments>http://blog.alegitimatebusiness.com/2007/08/30/reading-xml-as-an-object-tree-in-as2/#comments</comments>
		<pubDate>Thu, 30 Aug 2007 13:53:11 +0000</pubDate>
		<dc:creator>tonypee</dc:creator>
		
		<category><![CDATA[AS2]]></category>

		<guid isPermaLink="false">http://blog.alegitimatebusiness.com/?p=7</guid>
		<description><![CDATA[I thought I&#8217;d throw up a few things I&#8217;ve been using in AS2 lately on projects, So my next few posts will be old AS2 tricks.
Flash often needs hit the server with variables and load in a response. Using the built in LoadVars and XML Object works, but can be improved on. E4X isnt available [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I&#8217;d throw up a few things I&#8217;ve been using in AS2 lately on projects, So my next few posts will be old AS2 tricks.</p>
<p>Flash often needs hit the server with variables and load in a response. Using the built in LoadVars and XML Object works, but can be improved on. E4X isnt available in AS2 but here&#8217;s a lame relative. Enter stage XMLObj class. You can reading XML as an object eg:</p>
<p>trace( xml._data.root.data.person.name ) &gt;&gt; tony</p>
<p>This is a much faster way to access data. The XMLObj extends the built in XML class but adds the _data property. It can also guess types of the xml data as to save you the time of casting your values such as booleans and numbers.</p>
<p>For example a node such as &lt;data&gt;false&lt;/data&gt; would when accessed by the XML tree would be a string of “false”. if(“false”) evaluates to -true- not -false- meaning you must cast it check String(“false”).toUpperCase() == true. Numbers would need to be casted Number(“65”) otherwise using them will not work as expected, eg. “4” + 4 = 44 not 8.</p>
<p>Sending data to an XML or XMLObj is easily done using a LoadVars as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript"><span style="color: #000000; font-weight: bold;">var</span> xmlo = <span style="color: #000000; font-weight: bold;">new</span> XMLObj<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
xmlo.<span style="color: #006600;">guessType</span> = <span style="color: #000000; font-weight: bold;">true</span>;
xmlo.<span style="color: #0066CC;">ignoreWhite</span> = <span style="color: #000000; font-weight: bold;">true</span>;
xmlo.<span style="color: #0066CC;">onLoad</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>success<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>success<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>._data.<span style="color: #006600;">root</span>.<span style="color: #006600;">people</span>.<span style="color: #006600;">person</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">name</span><span style="color: #66cc66;">&#41;</span>; &amp;gt;&amp;gt; tony
		<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>._data.<span style="color: #006600;">root</span>.<span style="color: #006600;">people</span>.<span style="color: #006600;">person</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">name</span><span style="color: #66cc66;">&#41;</span>; &amp;gt;&amp;gt; tarwin
&nbsp;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
<span style="color: #000000; font-weight: bold;">var</span> vars = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">LoadVars</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
vars.<span style="color: #006600;">id</span> = <span style="color: #cc66cc;">45</span>;
vars.<span style="color: #006600;">sessionId</span> = “e3ed3533232ccD”;
vars.<span style="color: #0066CC;">sendAndLoad</span><span style="color: #66cc66;">&#40;</span>“process.<span style="color: #006600;">aspx</span>”, xmlo, “POST”<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>The LoadVars Object will send your variables to the server then route the data straight into the XMLObj where it is parsed and onLoad is called.</p>
<p>server response:</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;root<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;people<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;person</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;”tony”&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/person<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;person</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;”tarwin”&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/person<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;person</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;”poo”&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/person<span style="font-weight: bold; color: black;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/people<span style="font-weight: bold; color: black;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;cars<span style="font-weight: bold; color: black;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;car</span> <span style="color: #000066;">_type</span>=<span style="color: #ff0000;">&quot;”array”&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/car<span style="font-weight: bold; color: black;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;text<span style="font-weight: bold; color: black;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!--[CDATA[this is a slab of text]]--&gt;</span></span>
	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/text<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/cars<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/root<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

<p>
<a href="http://blog.alegitimatebusiness.com/wp-content/uploads/2007/11/xmlobj.as" title="XMLObj.as">Download XMLObj.as</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alegitimatebusiness.com/2007/08/30/reading-xml-as-an-object-tree-in-as2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ODBC &#038; .NET TableAdapters</title>
		<link>http://blog.alegitimatebusiness.com/2007/08/29/odbc-net-tableadapters/</link>
		<comments>http://blog.alegitimatebusiness.com/2007/08/29/odbc-net-tableadapters/#comments</comments>
		<pubDate>Wed, 29 Aug 2007 15:25:43 +0000</pubDate>
		<dc:creator>tonypee</dc:creator>
		
		<category><![CDATA[.net]]></category>

		<guid isPermaLink="false">http://blog.alegitimatebusiness.com/?p=6</guid>
		<description><![CDATA[When using an ODBC connection the table adapters will not allow you to add variables. you cannot use the @var syntax as with SQL Server. The only syntax available is the same when using variables to a MS Access DB. You must use &#8216;?&#8217; where a variable will go eg.
SELECT * FROM ? where dog [...]]]></description>
			<content:encoded><![CDATA[<p>When using an ODBC connection the table adapters will not allow you to add variables. you cannot use the @var syntax as with SQL Server. The only syntax available is the same when using variables to a MS Access DB. You must use &#8216;?&#8217; where a variable will go eg.</p>
<p>SELECT * FROM ? where dog = &#8216;?&#8217;</p>
<p>The variables are used in the order that you add them to the query. This makes TableAdapters quite restricted and to me, useless&#8230; if they already weren&#8217;t too clunky.</p>
<p>You should use a good old sql query in the page, or create your own DAL as  a class.</p>
<p>A simple ODBC query can be made using a simple function similar to:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp"><span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Data</span>.<span style="color: #0000FF;">Odbc</span>;
&nbsp;
<span style="color: #0600FF;">public</span> OdbcDataReader query<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> queryString<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    OdbcCommand command = <span style="color: #008000;">new</span> OdbcCommand<span style="color: #000000;">&#40;</span>queryString, connection<span style="color: #000000;">&#41;</span>;
    OdbcDataReader result = command.<span style="color: #0000FF;">ExecuteReader</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
    <span style="color: #0600FF;">return</span> result;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>The Returned result can then be bound to a Repeater, DataGrid, etc</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alegitimatebusiness.com/2007/08/29/odbc-net-tableadapters/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using MySql with Visual Web Developer Express</title>
		<link>http://blog.alegitimatebusiness.com/2007/08/29/using-mysql-with-visual-web-developer-express/</link>
		<comments>http://blog.alegitimatebusiness.com/2007/08/29/using-mysql-with-visual-web-developer-express/#comments</comments>
		<pubDate>Wed, 29 Aug 2007 15:07:49 +0000</pubDate>
		<dc:creator>tonypee</dc:creator>
		
		<category><![CDATA[.net]]></category>

		<guid isPermaLink="false">http://blog.alegitimatebusiness.com/?p=5</guid>
		<description><![CDATA[As a reforming PHP MySql developer, one thing i really love in LAMP development is the simplicity and no fuss approach. Mysql is small (22mb download) fast and quite capable of most website datastorage. Also the fact that it doesnt cost $5000.00 per processor&#8230; thats good too.
So it seems like a good choice to use [...]]]></description>
			<content:encoded><![CDATA[<p>As a reforming PHP MySql developer, one thing i really love in LAMP development is the simplicity and no fuss approach. Mysql is small (22mb download) fast and quite capable of most website datastorage. Also the fact that it doesnt cost $5000.00 per processor&#8230; thats good too.</p>
<p>So it seems like a good choice to use the advantages of the .NET framework, with the power of MySql. Is this available for VWD Express users however?The answer is yes!</p>
<p>Due to restrictions on the pluginability (technically speaking) VWD Express cannot install the Native Mysql for .NET connectors (<a href="http://www.mysql.com/products/connector/net/">mysql conector .net</a>) which would give the best performanc. If you use Visual Studio 2005 then this would be the best choice.</p>
<p>To use Mysql with Visual Web Developer 2005 install Mysql ODBC as follows:</p>
<p>1. Download the <a href="http://dev.mysql.com/downloads/connector/odbc/3.51.html">ODBC data drivers </a>.</p>
<p>2. <a href="http://www.sparxsystems.com/EAUserGuide/index.html?setupmysqlodbcdriver.htm">Setup your ODBC connection</a></p>
<p>3. in your config.xml or connection .NET SqlDataSource Object use the mysql connection string found <a href="http://www.connectionstrings.com/">here</a></p>
<p>In your config.xml you will set up a connection similar to this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;connectionstrings<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;add</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;ConnectionString&quot;</span>
	<span style="color: #000066;">connectionString</span>=<span style="color: #ff0000;">&quot;Driver={MySQL ODBC 3.51 Driver};
	Server=localhost;
	Database=test;
	User=root;
	Password=;
	Option=3;&quot;</span>
     <span style="color: #000066;">providerName</span>=<span style="color: #ff0000;">&quot;System.Data.Odbc&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
     <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/add<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/connectionstrings<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.alegitimatebusiness.com/2007/08/29/using-mysql-with-visual-web-developer-express/feed/</wfw:commentRss>
		</item>
		<item>
		<title>using IIS5.1 with multiple sites</title>
		<link>http://blog.alegitimatebusiness.com/2007/08/29/using-iis51-with-multiple-sites/</link>
		<comments>http://blog.alegitimatebusiness.com/2007/08/29/using-iis51-with-multiple-sites/#comments</comments>
		<pubDate>Wed, 29 Aug 2007 07:26:37 +0000</pubDate>
		<dc:creator>tonypee</dc:creator>
		
		<category><![CDATA[.net]]></category>

		<guid isPermaLink="false">http://blog.alegitimatebusiness.com/?p=4</guid>
		<description><![CDATA[Okay, as a starting point for learning .NET i installed Visual Web Developer Express. Even though it gives you the option to test a website with the &#8216;view in browser&#8217; option (which launches a temporary server at some crazy port eg. locahost:1076),  I thought it was essential to be developing on a real IIS [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, as a starting point for learning .NET i installed Visual Web Developer Express. Even though it gives you the option to test a website with the &#8216;view in browser&#8217; option (which launches a temporary server at some crazy port eg. locahost:1076),  I thought it was essential to be developing on a real IIS server. Not setting up my server properly cause me many hours of greif and confusion.</p>
<p>The catch with using IIS5.1 for developing .NET websites is that it only allows you to setup ONE website (domain.. whatever).  As i have setup and developed PHP on Apache Development servers before i thought this would be fine to work in a similar way, and proceeded to setup my different sites (as i did some tests) in a separate folders. Then by using folder browsing i could access the different sites. WRONG!</p>
<p>eg:<br />
d:/website/ ( allow folder browsing to select a site)<br />
d:/website/site1/<br />
d:/website/site2/</p>
<p>and access them as:<br />
http://localhost/<br />
http://localhost/site1/default.aspx<br />
http://localhost/site2/default.aspx</p>
<p>This works fine for Php sites running on Apache as all of you code is custom (or you set a base path). Its wreaks havok with .NET however. Forms authentication in the config.xml errors. the ~/ file addressing errors, which caused me not to use it at first. Every piece of example code that i downloaded had strings of errors. Solution: Virtual Folders</p>
<p>In Explorer you can click on the folder and under properties&gt;web sharing  and select &#8217;share this folder&#8217; then give it an alias. The alias is used like this:</p>
<p>http://localhost/alias/</p>
<p>If you have access this alias and a login box appears you need to change the websites permissions (change it form forms authentication to allow your windows user). This can be  changed by going to control panel &gt; administrative tools &gt; IIS , then under the default website there should be the alias you&#8217;ve created. goto its properties &gt; directory security , and press &#8216;edit&#8217; on anonymous access and allow anonymous access. This may be insecure, but hey&#8230; you dont know anything about servers do you&#8230; so i trust you dont care <img src='http://blog.alegitimatebusiness.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alegitimatebusiness.com/2007/08/29/using-iis51-with-multiple-sites/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://blog.alegitimatebusiness.com/2007/08/26/hello-world/</link>
		<comments>http://blog.alegitimatebusiness.com/2007/08/26/hello-world/#comments</comments>
		<pubDate>Sun, 26 Aug 2007 06:31:14 +0000</pubDate>
		<dc:creator>tonypee</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Well hi&#8230; world
Finally I&#8217;ve decided i should try to give a little back to the world about my travels as a web developer/designer. Travels such as AS2, php &#38; Mysql, but mainly at the moment, my transition to .NET and AS3
I&#8217;ve been Finding it had the scour the internet, slowly getting an understanding of .NET [...]]]></description>
			<content:encoded><![CDATA[<p>Well hi&#8230; world</p>
<p>Finally I&#8217;ve decided i should try to give a little back to the world about my travels as a web developer/designer. Travels such as AS2, php &amp; Mysql, but mainly at the moment, my transition to .NET and AS3</p>
<p>I&#8217;ve been Finding it had the scour the internet, slowly getting an understanding of .NET so i&#8217;m going to endevor to post up all the crazy new things i&#8217;m learning.</p>
<p>peace out world</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alegitimatebusiness.com/2007/08/26/hello-world/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
