<?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>FlyPaper</title>
	<atom:link href="http://flypaper.stickysideup.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://flypaper.stickysideup.com</link>
	<description>Things that tend to stick</description>
	<lastBuildDate>Wed, 17 Mar 2010 16:41:22 +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>Staying in the Base Path.</title>
		<link>http://flypaper.stickysideup.com/?p=41</link>
		<comments>http://flypaper.stickysideup.com/?p=41#comments</comments>
		<pubDate>Wed, 17 Mar 2010 16:22:11 +0000</pubDate>
		<dc:creator>Dirty Kalb</dc:creator>
				<category><![CDATA[Code and Code Related Accessories]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://flypaper.stickysideup.com/?p=41</guid>
		<description><![CDATA[It’s not all about baseball but base paths can be a pain.&#160; Here’s a simple way to mange the base paths and help to keep code simple and document relative.&#160; Especially helpful when using Server.Transfer to move people to different pages in your site. 
//This goes in the &#60;head&#62; section of your Master Page 
&#60;base [...]]]></description>
			<content:encoded><![CDATA[<p>It’s not all about baseball but base paths can be a pain.&#160; Here’s a simple way to mange the base paths and help to keep code simple and document relative.&#160; Especially helpful when using Server.Transfer to move people to different pages in your site. </p>
<pre style="width: 529px; height: 193px" class="csharpcode"><span class="rem">//This goes in the &lt;head&gt; section of your Master Page </span>
&lt;<span class="kwrd">base</span> href=<span class="str">&quot;&lt;%= BaseUrl %&gt;Public/&quot;</span> /&gt;
 <span class="rem">//this goes in the Maste Page Code Behind    </span>
<span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">string</span> BaseUrl
{
    get { <span class="kwrd">string</span> basePath = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority)  + HttpContext.Current.Request.ApplicationPath;
    <span class="kwrd">if</span> (!basePath.EndsWith(<span class="str">&quot;/&quot;</span>)) basePath = basePath + <span class="str">&quot;/&quot;</span>;
    <span class="kwrd">return</span> basePath;
    }
}</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
]]></content:encoded>
			<wfw:commentRss>http://flypaper.stickysideup.com/?feed=rss2&amp;p=41</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Down and dirty jQuery birthdate tester.</title>
		<link>http://flypaper.stickysideup.com/?p=40</link>
		<comments>http://flypaper.stickysideup.com/?p=40#comments</comments>
		<pubDate>Wed, 17 Mar 2010 16:17:53 +0000</pubDate>
		<dc:creator>Dirty Kalb</dc:creator>
				<category><![CDATA[Code and Code Related Accessories]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://flypaper.stickysideup.com/?p=40</guid>
		<description><![CDATA[I have been working on eliminating the need for error handling and messages for a project I’m doing.&#160; The project is for an alcohol company so I had to create a birthday checker.&#160; In doing so I came across many reasons to raise error messages,&#160; thinking about how much I hate writing them, I decided [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working on eliminating the need for error handling and messages for a project I’m doing.&#160; The project is for an alcohol company so I had to create a birthday checker.&#160; In doing so I came across many reasons to raise error messages,&#160; thinking about how much I hate writing them, I decided to suppress the use of any characters that would not easily translate into a date.&#160; Thankfully jQuery allows me to do some simple keypress testing so you don’t even see the characters on page before they are suppressed.&#160;
<pre style="width: 569px; height: 226px" class="csharpcode">

 $(document).ready(function() {
       <span class="rem">// I use .net controls to build my forms you can replace &quot;#&lt;%= DOBMonth.ClientID %&gt;&quot; </span>

<span class="rem">       //with the ID of your form elements. the process textbox function consumes the element, the next element in the set, and a max length (when to skip tothe next box).</span>
        processTextbox($(<span class="str">&quot;#&lt;%= DOBMonth.ClientID %&gt;&quot;</span>), $(<span class="str">&quot;#&lt;%= DOBDay.ClientID %&gt;&quot;</span>), 2);
        processTextbox($(<span class="str">&quot;#&lt;%= DOBDay.ClientID %&gt;&quot;</span>), $(<span class="str">&quot;#&lt;%= DOBYear.ClientID %&gt;&quot;</span>), 2);
        processTextbox($(<span class="str">&quot;#&lt;%= DOBYear.ClientID %&gt;&quot;</span>), $(<span class="str">&quot;#&lt;%= validateDOB.ClientID %&gt;&quot;</span>), 4);
    });

    function processTextbox(element, nextElement, length) {
        <span class="rem">//clear the current element</span>
        setBlankValue(element);
        <span class="rem">//only numbers!!</span>
        filterKeys(element);
        <span class="rem">//set focus on next element when MaxLength == true</span>
        focusOnNext(element, nextElement, length);
    }

    function setBlankValue(element) {
        element.focus(function() {
            element.val(<span class="str">&quot;&quot;</span>);
        });
    }

    function filterKeys(element) {
        element.keydown(function(<span class="kwrd">event</span>) {
            <span class="rem">//alert(event.keyCode);</span>
            <span class="rem">// Allow only backspace and delete </span>
            <span class="kwrd">if</span> (<span class="kwrd">event</span>.keyCode == 46 || <span class="kwrd">event</span>.keyCode == <img src='http://flypaper.stickysideup.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> {
                <span class="rem">// let it happen, don't do anything </span>
            }
            <span class="kwrd">else</span> {
                <span class="rem">// Check to see if the key pressed is a number</span>
                <span class="kwrd">if</span> (!(<span class="kwrd">event</span>.keyCode &gt;= 48 &amp;&amp; <span class="kwrd">event</span>.keyCode &lt;= 57 || <span class="kwrd">event</span>.keyCode &gt;= 96 &amp;&amp; <span class="kwrd">event</span>.keyCode &lt;= 105)) {
                    <span class="rem">//stop the keypress event if it isn't</span>
                    <span class="kwrd">event</span>.preventDefault();
                }
            }
        });

        <span class="rem">/*</span>
<span class="rem">        //alternative method uses keyup instead of keydown.</span>
<span class="rem">        //this test happens after the text is input into the box, so incorrect keypresses are momentarilly visible.</span>
<span class="rem">        element.keyup(function(event) {</span>
<span class="rem">        //alert(element.val());</span>
<span class="rem">        var base = element.val().substr(0, element.val().length - 1);</span>
<span class="rem"></span>
<span class="rem">            var last = element.val().substr(element.val().length - 1, element.val().length);</span>
<span class="rem">        if (last &lt; '0' || last &gt; '9') {</span>
<span class="rem">        element.val(base);</span>
<span class="rem">        }</span>
<span class="rem">        alert(base + ' - ' + last);</span>
<span class="rem">           </span>
<span class="rem">        });</span>
<span class="rem">        </span>
<span class="rem">        */</span>
    }

    function focusOnNext(element, nextElement, length) {
        element.keyup(function() {
            <span class="kwrd">if</span> (element.val().length == length) {
                nextElement.focus();
            }
        });
    }
</pre>
<p>Happy Coding!<br />
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style></p>
]]></content:encoded>
			<wfw:commentRss>http://flypaper.stickysideup.com/?feed=rss2&amp;p=40</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>And Now For Something Completely Different</title>
		<link>http://flypaper.stickysideup.com/?p=17</link>
		<comments>http://flypaper.stickysideup.com/?p=17#comments</comments>
		<pubDate>Tue, 09 Mar 2010 13:55:06 +0000</pubDate>
		<dc:creator>Dirty Kalb</dc:creator>
				<category><![CDATA[Random Stuff]]></category>

		<guid isPermaLink="false">http://flypaper.stickysideup.com/?p=17</guid>
		<description><![CDATA[So, there have been a lot of newsworthy earthquakes this year.&#160; Something must be wrong with the planet right?!&#160;&#160; Well as it turns out, according to USGS data, we are seemingly on track to have a normal seismic year. 
http://earthquake.usgs.gov/earthquakes/eqarchives/year/eqstats.php
]]></description>
			<content:encoded><![CDATA[<p>So, there have been a lot of newsworthy earthquakes this year.&#160; Something must be wrong with the planet right?!&#160;&#160; Well as it turns out, according to USGS data, we are seemingly on track to have a normal seismic year. </p>
<p><a title="http://earthquake.usgs.gov/earthquakes/eqarchives/year/eqstats.php" href="http://earthquake.usgs.gov/earthquakes/eqarchives/year/eqstats.php">http://earthquake.usgs.gov/earthquakes/eqarchives/year/eqstats.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://flypaper.stickysideup.com/?feed=rss2&amp;p=17</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Damn you Firefox for steppin on my loveley JQuery</title>
		<link>http://flypaper.stickysideup.com/?p=16</link>
		<comments>http://flypaper.stickysideup.com/?p=16#comments</comments>
		<pubDate>Fri, 19 Feb 2010 17:52:05 +0000</pubDate>
		<dc:creator>Dirty Kalb</dc:creator>
				<category><![CDATA[Code and Code Related Accessories]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://flypaper.stickysideup.com/?p=16</guid>
		<description><![CDATA[So,&#160; jquery is awesome.&#160;&#160; But it has it’s setbacks.&#160; Like say you randomly want to position a div off screen for a swoop in from the right,&#160; pretty simple animate call to get it back to the stage $(‘#obj”).animate({“right”: “+=1000px”}, 800); 
But now lets say you want to make the nifty animation be invisible and [...]]]></description>
			<content:encoded><![CDATA[<p>So,&#160; jquery is awesome.&#160;&#160; But it has it’s setbacks.&#160; Like say you randomly want to position a div off screen for a swoop in from the right,&#160; pretty simple animate call to get it back to the stage $(‘#obj”).animate({“right”: “+=1000px”}, 800); </p>
<p>But now lets say you want to make the nifty animation be invisible and fade in while it makes it’s way merrily across the screen.&#160; Again should be simple $(‘#obj”).fadeIn(0); on $(document).ready and then&#160; $(‘#obj”).fadeIn(800); when you shoot the moon,&#160; but the issue is that you need to hide the object very specifically when you do this or Firefox you’ll need to make sure your object doesn’t leave the DOM (display:none;) by using the fadeOut JQ .&#160; So instead of fadeOut,&#160; you need to implement the .animate() so the object doesn’t sneak off the DOM&#160; $(‘#obj”).animate({“opacity”: “0”}, 0); </p>
<p>Happy Coding.</p>
]]></content:encoded>
			<wfw:commentRss>http://flypaper.stickysideup.com/?feed=rss2&amp;p=16</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parsing Hashtags in Flash</title>
		<link>http://flypaper.stickysideup.com/?p=13</link>
		<comments>http://flypaper.stickysideup.com/?p=13#comments</comments>
		<pubDate>Fri, 19 Feb 2010 16:14:41 +0000</pubDate>
		<dc:creator>Dirty Kalb</dc:creator>
				<category><![CDATA[Code and Code Related Accessories]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://flypaper.stickysideup.com/?p=13</guid>
		<description><![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: [...]]]></description>
			<content:encoded><![CDATA[<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Today I helped a friend with some top secret mission to parse his twitter in flash.&#160; So here’s how it works:</p>
<p>First, you’ll need to borrow this package from <a href="http://inflagrantedelicto.memoryspiral.com/2010/01/parsing-tweets-with-the-twitterstring-class/">In Flagrante Delicto</a>&#160; (you won’t need the mxml or flex but his demo is great if you are lookin’ for that kind o’ thing).</p>
<p>Now for my assumptions: 1, you can build an AS 3 Flash doc with a dynamic html text box.&#160; 2. You already have a string for your twitter feed XML.</p>
<p>Set yourself up with a as3 flash doc and add a dynamic text field, name it textArea.</p>
<p>You’ll need the following code:</p>
<p>&#160;</p>
<pre style="width: 569px; height: 222px" class="csharpcode">package
{
    import flash.display.MovieClip;
    import flash.events.Event;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.Event;
    import flash.xml.XMLDocument;
    import TwitterString;

    <span class="kwrd">public</span> <span class="kwrd">class</span> Main extends MovieClip
    {
        <span class="kwrd">private</span> var twitterXML:XML; <span class="rem">// This holds the xml data</span>
        <span class="kwrd">private</span> var twitterScriptPath:String;
        <span class="kwrd">private</span> var myTwitterID:String;

        <span class="kwrd">public</span> function Main()
        {
            <span class="rem">// Put your Twitter username here:</span>
            myTwitterID = <span class="str">&quot;YER_ID&quot;</span>; 

            <span class="rem">// Put the path to your script to get the XML feed here:</span>
            twitterScriptPath = <span class="str">&quot;http://www.YERSITE.com/YerFile&quot;</span>;

            loadTwitterXML();
        }

        <span class="kwrd">private</span> function loadTwitterXML():<span class="kwrd">void</span>
        {
            var urlLoader:URLLoader = <span class="kwrd">new</span> URLLoader();
            <span class="rem">// When all the junk has been pulled in from the url, we'll fire finishedLoadingXML:</span>
            urlLoader.addEventListener(Event.COMPLETE, finishLoadingXML);

            urlLoader.load(<span class="kwrd">new</span> URLRequest(twitterScriptPath + <span class="str">&quot;?twitterId=&quot;</span> + myTwitterID));
            <span class="rem">//You can mess with the security sandbox error (or to test locally) by swapping the next line with the one above</span>
            <span class="rem">//urlLoader.load(new URLRequest(&quot;http://twitter.com/statuses/user_timeline/YER_USERNAME.xml&quot;));        </span>

        }

        <span class="kwrd">private</span> function finishLoadingXML(e:Event):<span class="kwrd">void</span>
        {
            e.target.removeEventListener(Event.COMPLETE, finishLoadingXML);

            <span class="rem">// Populate the xml object with the xml data:</span>

            var XMLTwitterDoc:XMLDocument = <span class="kwrd">new</span> XMLDocument();
            var twitterFeed:String;

            XMLTwitterDoc.parseXML(e.target.data);
            twitterXML = <span class="kwrd">new</span> XML(XMLTwitterDoc); 

            showTwitterStatus();
        }

        <span class="kwrd">private</span> function showTwitterStatus():<span class="kwrd">void</span>
        {
            trace(<span class="str">&quot;showTwitterStatus&quot;</span>);

            <span class="rem">// Prep the text field to hold our latest Twitter update:</span>
            twitter_txt.wordWrap = <span class="kwrd">true</span>;
            twitter_txt.autoSize = TextFieldAutoSize.LEFT;

            <span class="rem">// Populate the text field with the first element in the status.text nodes:</span>
            var textString:String = twitterXML.status.text[0].toString();

            trace(TwitterString.instance.parseTweet(textString));
            twitter_txt.htmlText = TwitterString.instance.parseTweet(textString);        

        }
    }
}
    <span class="kwrd">public</span> <span class="kwrd">class</span> Main extends MovieClip

    {

        <span class="kwrd">private</span> var twitterXML:XML; <span class="rem">// This holds the xml data</span>
        <span class="kwrd">private</span> var twitterScriptPath:String;
        <span class="kwrd">private</span> </pre>
<p>So that’s about it,&#160; other than it being a good idea to save the data in a flash stored object so you don’t overhit the twitter API.&#160; </p>
]]></content:encoded>
			<wfw:commentRss>http://flypaper.stickysideup.com/?feed=rss2&amp;p=13</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Notes: Importing and displaying images via Binary ByteArray</title>
		<link>http://flypaper.stickysideup.com/?p=9</link>
		<comments>http://flypaper.stickysideup.com/?p=9#comments</comments>
		<pubDate>Tue, 09 Feb 2010 16:49:12 +0000</pubDate>
		<dc:creator>Dirty Kalb</dc:creator>
				<category><![CDATA[Code and Code Related Accessories]]></category>
		<category><![CDATA[Byte Array]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://flypaper.stickysideup.com/?p=9</guid>
		<description><![CDATA[After weeks of sickening trial and error, I have finally figured out a method of importing and displaying ByteArrays as images.
&#160;
To do this, you’ll need the base64 converter library created by the folks at Dynamic Flash available here.
We will continue this under the assumption that you are familiar with class paths and importing external classes.
On [...]]]></description>
			<content:encoded><![CDATA[<p>After weeks of sickening trial and error, I have finally figured out a method of importing and displaying ByteArrays as images.</p>
<p>&#160;</p>
<p>To do this, you’ll need the base64 converter library created by the folks at <a href="http://dynamicflash.com/">Dynamic Flash</a> available <a href="http://sharepoint:48370/personal/jkalb/Personal%20Documents/Base64-1.1.0.zip">here</a>.</p>
<p>We will continue this under the assumption that you are familiar with class paths and importing external classes.</p>
<p>On to the code:</p>
<p>The full source code is available here: <a href="http://flypaper.stickysideup.com/downloads/BytaArrayToImage.zip">BytaArrayToImage.zip</a>.</p>
<p>There are many methods to get your data, however for this example, we will be using a predetermined ByteArray in an XML file along with some parameters to tell the image where to go and how big to be. This is a very simplified proof of concept, but it will open the door to better things.</p>
<pre style="width: 529px; height: 247px" class="csharpcode">package {
    import flash.display.MovieClip;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.*;
    import flash.display.Loader;
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.utils.ByteArray;
    import com.dynamicflash.util.Base64;
    import flash.xml.XMLDocument;

    <span class="kwrd">public</span> <span class="kwrd">class</span> ByteArrayToImage extends MovieClip  {

        <span class="rem">//xml doc object</span>
        <span class="kwrd">public</span> <span class="kwrd">var</span> mainXML:XML;
        <span class="kwrd">public</span> <span class="kwrd">var</span> theImage:Loader;
        <span class="rem">//loader for images.</span>
        <span class="kwrd">var</span> imageLoader:Loader;

        <span class="kwrd">public</span> <span class="kwrd">function</span> ByteArrayToImage(){
            init();
        }

        <span class="kwrd">private</span> <span class="kwrd">function</span> init(){
            digestXML();
        }

        <span class="kwrd">private</span> <span class="kwrd">function</span> digestXML(){
            <span class="rem">//build a loader object for the XML file</span>
            <span class="kwrd">var</span> loader:URLLoader = <span class="kwrd">new</span> URLLoader();
            <span class="rem">//load the file</span>
            loader.load(<span class="kwrd">new</span> URLRequest(<span class="str">&quot;testXML.xml&quot;</span>));
            <span class="rem">//once complete, run xmlLoaded function</span>
            loader.addEventListener(Event.COMPLETE, xmlLoaded);
        }

        <span class="kwrd">private</span> <span class="kwrd">function</span> xmlLoaded(evt:Event){
            <span class="rem">//create an XML document  to laod the data into</span>
            <span class="kwrd">var</span> mainXMLDoc:XMLDocument = <span class="kwrd">new</span> XMLDocument(evt.target.data);
            <span class="rem">//load said data</span>
            mainXML = <span class="kwrd">new</span> XML(mainXMLDoc);
            <span class="rem">//parse thru the data and load the images</span>
            <span class="kwrd">for</span> (<span class="kwrd">var</span> i:<span class="kwrd">int</span> = 0; i &lt; mainXML.image.length(); i++){
                <span class="rem">// it is important to notice the use of the base64Decoder class on the image string.  This will not work without it.</span>
                loadImage(mainXML.image[i].@imageId, Base64.decodeToByteArray(mainXML.image[i].imageBytes), mainXML.image[i].@xPos, mainXML.image[i].@yPos, mainXML.image[i].@width);
            }
        }

        <span class="kwrd">private</span> <span class="kwrd">function</span> loadImage(imageName:String, imageArray:ByteArray, xPosition:<span class="kwrd">int</span>, yPosition:<span class="kwrd">int</span>, imageWidth:<span class="kwrd">int</span>):<span class="kwrd">void</span> {

            imageLoader = <span class="kwrd">new</span> Loader();
            imageLoader.loadBytes(imageArray);

            <span class="kwrd">var</span> imageToLoad = mainMC;
            imageToLoad.x = xPosition;
            imageToLoad.y = yPosition;
            imageToLoad.width = imageWidth;
            imageToLoad.scaleY &lt; imageToLoad.scaleX ? imageToLoad.scaleX = imageToLoad.scaleY : imageToLoad.scaleY = imageToLoad.scaleX;
            imageToLoad.addChild(imageLoader);

        }

    }
}</pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
]]></content:encoded>
			<wfw:commentRss>http://flypaper.stickysideup.com/?feed=rss2&amp;p=9</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Workin’ the AddThis</title>
		<link>http://flypaper.stickysideup.com/?p=7</link>
		<comments>http://flypaper.stickysideup.com/?p=7#comments</comments>
		<pubDate>Tue, 09 Feb 2010 16:45:39 +0000</pubDate>
		<dc:creator>Dirty Kalb</dc:creator>
				<category><![CDATA[Code and Code Related Accessories]]></category>
		<category><![CDATA[Add This]]></category>

		<guid isPermaLink="false">http://flypaper.stickysideup.com/?p=7</guid>
		<description><![CDATA[Sites like to be shared lately. Since its so cool, they also like to have a thumbnail, title and description.&#160; All this can be controlled (when using AddThis) by adding a link and some meta tags. 
Here’s an example.
Paste the following in the &#60;head&#62;
&#60;meta name=&#34;title&#34; content=&#34;U.S. Cellular Snowman Game&#34; /&#62; &#60;meta name=&#34;description&#34; content=&#34;U.S. Cellular snowman [...]]]></description>
			<content:encoded><![CDATA[<p>Sites like to be shared lately. Since its so cool, they also like to have a thumbnail, title and description.&#160; All this can be controlled (when using AddThis) by adding a link and some meta tags. </p>
<p>Here’s an example.</p>
<p>Paste the following in the &lt;head&gt;</p>
<p><span style="color: #0000ff">&lt;</span><span style="color: #800000">meta</span> <span style="color: #ff0000">name</span>=<span style="color: #0000ff">&quot;title&quot;</span> <span style="color: #ff0000">content</span>=<span style="color: #0000ff">&quot;U.S. Cellular Snowman Game&quot;</span> <span style="color: #0000ff">/&gt;</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">meta</span> <span style="color: #ff0000">name</span>=<span style="color: #0000ff">&quot;description&quot;</span> <span style="color: #ff0000">content</span>=<span style="color: #0000ff">&quot;U.S. Cellular snowman game description.&quot;</span> <span style="color: #0000ff">/&gt;</span></p>
<p><span style="color: #0000ff"></span><span style="color: #0000ff">&lt;</span><span style="color: #800000">link</span> <span style="color: #ff0000">rel</span>=<span style="color: #0000ff">&quot;image_src&quot;</span> <span style="color: #ff0000">href</span>=<span style="color: #0000ff">&quot;&lt;%= Request.Url.GetLeftPart(UriPartial.Path).Replace(&quot;</span>/<span style="color: #ff0000">Public</span>/<span style="color: #ff0000">PhotoView</span>.<span style="color: #ff0000">aspx</span>&quot;, &quot;&quot;) %&gt;/<span style="color: #ff0000">Content</span>/<span style="color: #ff0000">Images</span>/<span style="color: #ff0000">thumbnail</span>.<span style="color: #ff0000">jpg</span>&quot; <span style="color: #0000ff">/&gt;</span> </p>
<p>The great part about this is you can independently control the output to your social media outlets.</p>
<p>&#160;</p>
<p>Happy Coding</p>
]]></content:encoded>
			<wfw:commentRss>http://flypaper.stickysideup.com/?feed=rss2&amp;p=7</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.ASHX uploads: The end to file size limitation</title>
		<link>http://flypaper.stickysideup.com/?p=6</link>
		<comments>http://flypaper.stickysideup.com/?p=6#comments</comments>
		<pubDate>Tue, 09 Feb 2010 16:45:01 +0000</pubDate>
		<dc:creator>Dirty Kalb</dc:creator>
				<category><![CDATA[Code and Code Related Accessories]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[upload file size limitations]]></category>

		<guid isPermaLink="false">http://flypaper.stickysideup.com/?p=6</guid>
		<description><![CDATA[So you’ve got a great app that uses an ASP Handler to upload images via a HTTPContext Request.&#160; It’s great, it’s fast but it’s limited by .NET’s assumption that all files on the internet should be less than 4 Mb.&#160; Well the answer lies in the web.config.&#160; A short entry will change the world.
Add this [...]]]></description>
			<content:encoded><![CDATA[<p>So you’ve got a great app that uses an ASP Handler to upload images via a HTTPContext Request.&#160; It’s great, it’s fast but it’s limited by .NET’s assumption that all files on the internet should be less than 4 Mb.&#160; Well the answer lies in the web.config.&#160; A short entry will change the world.</p>
<p>Add this to the &lt;system.web&gt; section.</p>
<pre class="csharpcode">  &lt;httpRuntime executionTimeout=<span class="str">&quot;240&quot;</span> maxRequestLength=<span class="str">&quot;10000&quot;</span> /&gt; </pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
]]></content:encoded>
			<wfw:commentRss>http://flypaper.stickysideup.com/?feed=rss2&amp;p=6</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
