<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Fitchett</title>
	
	<link>http://www.fitchett.me</link>
	<description>Giving back to the community!</description>
	<lastBuildDate>Tue, 03 Nov 2009 07:19:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Fitchett" /><feedburner:info uri="fitchett" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Flex / Flash Builder – Inline Conditional, If Then, Code</title>
		<link>http://feedproxy.google.com/~r/Fitchett/~3/NmWpNIutzws/</link>
		<comments>http://www.fitchett.me/index.php/development/flex-development/flex-flash-builder-inline-conditional-if-then-code/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 01:05:15 +0000</pubDate>
		<dc:creator>Michael Fitchett</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Condition]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[If Then]]></category>
		<category><![CDATA[Inline]]></category>

		<guid isPermaLink="false">http://www.fitchett.me/?p=267</guid>
		<description><![CDATA[Inline conditionals, coding, if then&#8217;s whatever you want to call it is soooo easy yet has been a pain in the royal _ _ _ for me to find maybe its the search terms I have been Google&#8217;ing I don&#8217;t know.


Here is a very simple example of how to use an inline conditional to show/hide [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-280" title="inline-condition-example-ss" src="http://www.fitchett.me/wp-content/uploads/2009/11/inline-condition-example-ss.png" alt="inline-condition-example-ss" width="90" height="90" />Inline conditionals, coding, if then&#8217;s whatever you want to call it is soooo easy yet has been a pain in the royal _ _ _ for me to find maybe its the search terms I have been Google&#8217;ing I don&#8217;t know.</p>
<p>
<span id="more-267"></span><br />
Here is a very simple example of how to use an inline conditional to show/hide a button if a check box is selected (checked).</p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_0" width="300" height="200">
      <param name="movie" value="http://www.fitchett.me/wp-content/uploads/2009/11/inlinecodeexample.swf" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://www.fitchett.me/wp-content/uploads/2009/11/inlinecodeexample.swf" width="300" height="200">
      <!--<![endif]-->
        Flex Inline Condition Example
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<p>The button has a visible property with the value set to a conditional statement that says if the check box is selected then show the button if it is not then hide the button by setting the value true or false.</p>
<p><code>visible="{(cbShowButton.selected == true) ? true : false}" </code></p>
<p>If this is your first time looking at an inline condition here is an image I have put together to explain in a little more detail and help you digest it a little easier</p>
<div id="attachment_266" class="wp-caption alignnone" style="width: 451px"><img class="size-full wp-image-266 " title="inline-condition-example" src="http://www.fitchett.me/wp-content/uploads/2009/11/inline-condition-example.png" alt="Flex / Flash Builder Inline Condition Example" width="441" height="165" /><p class="wp-caption-text">Flex / Flash Builder Inline Condition Example</p></div>
<p>The &#8220;?&#8221; is what ends the condition and the &#8220;:&#8221; acts as an else.</p>
<p>Yes, there are several ways of showing and hiding a button based on another components value. However I find this way to work out really well because you dont need to preset the button&#8217;s visible property to false before running the application. It detects that the check box is not selected at run time and hides the button. Of course you could just pass the check box selected value which is true or false anways but some or most cases you wont be checking againts a true or false value.</p>
<p>Inline conditions really shine when used with data grids. For example so you have a list of people attending an event and you want to show male or female by an icon you can easily accomplish this using an inline condition to check and see if the datagrid column value is male or female and set the image source to to the appropriate path.</p>
<p><code>&lt;mx:Image source="{(data.colGender == 'male') ? 'assets/male.png' : 'assets/female.png'}"/&gt;</code></p>
<p>We can also add to this condition by using a comma for example:</p>
<p><code>&lt;mx:Image source="{(data.colGender == 'male', data.colAge &gt; 21) ? 'assets/male.png' : 'assets/female.png'}"/&gt;</code></p>
<p>Download Flex inline conditional example project here: <a class="downloadlink" href="http://www.fitchett.me/wp-content/plugins/download-monitor/download.php?id=6" title="Version1.0 downloaded 116 times" >Flex Inline Condition - Example Project (116)</a></p>
<img src="http://feeds.feedburner.com/~r/Fitchett/~4/NmWpNIutzws" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.fitchett.me/index.php/development/flex-development/flex-flash-builder-inline-conditional-if-then-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.fitchett.me/index.php/development/flex-development/flex-flash-builder-inline-conditional-if-then-code/</feedburner:origLink></item>
		<item>
		<title>Flex &amp; MS SQL Server – Performance Refactoring Part 1</title>
		<link>http://feedproxy.google.com/~r/Fitchett/~3/x1XEciJd5tg/</link>
		<comments>http://www.fitchett.me/index.php/development/flex-ms-sql-server-performance-refactoring/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 12:34:53 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[MS SQL Server]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Refactoring]]></category>

		<guid isPermaLink="false">http://www.fitchett.me/?p=206</guid>
		<description><![CDATA[Hello! Hows it going? Alright the guy who has to go to the restroom, go now, make some popcorn and come back. Good now that were all cozy i&#8217;m going to explain this series.
I&#8217;m going to in a series of posts walk you through the initial steps of what I like to call Performance Refactoring. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-233" title="config" src="http://www.fitchett.me/wp-content/uploads/2009/06/config.png" alt="config" width="256" height="256" />Hello! Hows it going? Alright the guy who has to go to the restroom, go now, make some popcorn and come back. Good now that were all cozy i&#8217;m going to explain this series.</p>
<p>I&#8217;m going to in a series of posts walk you through the initial steps of what I like to call Performance Refactoring. I refer to it as such because I am not going to concentrate on just the code, just the app, just the web server etc.  We&#8217;re going to look at it all.  This is necessary with today&#8217;s technologies for a lot of reasons, but for enterprise level applications to not do performance checking can be deadly.</p>
<p><span id="more-206"></span></p>
<p>So on that ominous note!<br />
Here is a break down of the parts we&#8217;ll be going over in this series.</p>
<ol>
<li>Gathering Metrics</li>
<li>Interpreting Metrics (This one comes with the bonus feature &#8220;WMI and You&#8221;)  Of course since everyone wants real world examples I will also show you how to use gathered data to figure out your drives load capacity, and theoretical saturation point.</li>
<li>Aggregating Metrics (Or The Cleanup)</li>
<li>Building a display module to graph gathered metrics.</li>
<li>Using metrics to identify bottle necks.</li>
<li>Hardware and code or love hate relationship.</li>
<li>Refactoring SQL</li>
<li>Analyzing Query execution plans.</li>
<li>Understanding cardinality, cost based execution and your app.</li>
<li>Code Optimization.</li>
</ol>
<p>Whew! We got a lot to cover in the next few weeks so might as well get started.<br />
So the first step is going to be gathering metrics.  Now for a lot of people I am going to applogize now, these series are going to use a lot of windows technologies.  I would recommend that if your using Linux or Solaris that you investigate Nagios, although the methodologies I lay forward should still apply.</p>
<p>One of the common tools used in Performance evaluation on Windows Servers (and in fact is available on XP and Vista) is called perfmon.  If you&#8217;ve never used go to START &gt; RUN or press WIN + R on the keyboard and type perfmon.</p>
<p>Perfmon is a graphical manager that ties into the Win32 Raw Performance classes.  It pulls all the counter data it collects and &#8220;cooks&#8221; it for you displaying it in a nice easy to see graph.  Feel free to Right click and look at all the nice counters available to you.</p>
<p>Now for this exercise I am going to focus on only 3: Processor::Total Time, LogicalDisk::TransferPerSec and PhysicalDisk::TransferPerSec.  These are not the only important ones but they will do for now.</p>
<p>So seeing this information is extremely helpful to diagnose system problems.  However, what if you want to test the system and record the results?  Well you can save it to a log I suppose.  However, lets go further.  What if you want to persist those results and save them for comparrison to see if your changes are positive, negative, or somewhere in between?  Heck what if you want to make it viewable and in a web application where you could log on and compare different builds or scripts?  Now were talking!</p>
<p>All right so the secret to getting this whole thing to work is about picking the right ODBC provider.  You want a system DSN and a SQL Server client, not a native SQL server.  Also for future reference you can setup the ODBC connection to point to a different server so you can have multiple remote systems sending to one core server, granted of course that you have security rights.</p>
<p>All right, so here is the chain of events to follow to get this whole thing setup. now these instructions are for Windows 2003 Server, 2008 and vista are a little different in Perfmon but the core logic stays the same:</p>
<ol>
<li> Create Empty Database in SQL</li>
<li>Start &gt; Control Panel &gt; Administrative Tools &gt; Data Sources</li>
<li>System DSN</li>
<li>Add</li>
<li>SQL Server (Not Native Client)</li>
<li>Name / Desc what you want</li>
<li>Select your server &gt; Next</li>
<li>Client Config No Dynamic. Set 1433</li>
<li>Ok &gt; Next</li>
<li>Change Default DB to empty database you made</li>
<li>Next &gt; Test data Source &gt; Ok</li>
<li>Run OR WIN + R &gt; Enter Perfmon</li>
<li>Counter Logs &gt; Right Click “New Log Settings”</li>
<li>Type Name</li>
<li>Add Objects (Processor, Memory, Physical Disk)</li>
<li>Run As (Administrator and set password)</li>
<li>Log Files Tab &gt; Log File Type = SQL Database &gt; Configure</li>
<li>System DSN select the ODBC connection you configured.</li>
<li>Click Ok</li>
<li>If New Log doesn’t turn green left click and hit Run</li>
<li>Database Schema
<ol>
<li>a. CounterDetails = Counter Names / Types (CounterID)</li>
<li>b. counterData = Counter Values / Time (CounterID)</li>
</ol>
</li>
</ol>
<p>All right, thats it. You now have a database that is collecting server metrics for you.  This means you could go off and load test that server and have recorded hard numerical value to use when your boss says &#8220;Hey when I have 2000 users on my site is it slowing down??&#8221; or my personal favorite &#8220;Can we support Project X with  antiquated hardware Y?&#8221;</p>
<p>Now if you got this setup you can start to answer that question.  We&#8217;ll cover more of the basics in the next part!</p>
<img src="http://feeds.feedburner.com/~r/Fitchett/~4/x1XEciJd5tg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.fitchett.me/index.php/development/flex-ms-sql-server-performance-refactoring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.fitchett.me/index.php/development/flex-ms-sql-server-performance-refactoring/</feedburner:origLink></item>
		<item>
		<title>Flex Assets/File Manager – ASP VBScript – Version 1.0</title>
		<link>http://feedproxy.google.com/~r/Fitchett/~3/yDWDQPD4BDY/</link>
		<comments>http://www.fitchett.me/index.php/development/flex-development/flex-file-asset-manager-asp-vbscript-v1/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 01:12:15 +0000</pubDate>
		<dc:creator>Michael Fitchett</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://www.fitchett.me/?p=208</guid>
		<description><![CDATA[
I recently built a JavaScript file manager but I wanted more control and better usability instead of expanding on the JavaScript version I decided to build it using Flex. Because Flex doesn’t have file system commands (that I know of) I had to use a server side language. We use VBScript at our company so [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-medium wp-image-218 alignright" title="Flex Asset Manager Interface" src="http://www.fitchett.me/wp-content/uploads/2009/06/ss-main-interface-300x225.jpg" alt="ss-main-interface" width="300" height="225" /></p>
<p class="MsoNormal">I recently built a JavaScript file manager but I wanted more control and better usability instead of expanding on the JavaScript version I decided to build it using Flex. Because Flex doesn’t have file system commands (that I know of) I had to use a server side language. We use VBScript at our company so I used that for the backend. I will be expanding this to other languages the next one to be released will be .NET C# as that seems to be what people polled for.</p>
<p><span id="more-208"></span></p>
<p class="MsoNormal"><strong>Screen Shots</strong></p>
<p class="MsoNormal"><strong></strong><br />

<div class="ngg-galleryoverview" id="ngg-gallery-1-208">


	
	<!-- Thumbnails -->
		
	<div id="ngg-image-4" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.fitchett.me/wp-content/gallery/flex-asset-manager-10/ss-thumbnail-view.jpg" title=" " class="shutterset_flex-asset-manager-10" >
				<img title="ss-thumbnail-view" alt="ss-thumbnail-view" src="http://www.fitchett.me/wp-content/gallery/flex-asset-manager-10/thumbs/thumbs_ss-thumbnail-view.jpg" width="100" height="75" />
			</a>
		</div>
	</div>
	 		
	<div id="ngg-image-2" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.fitchett.me/wp-content/gallery/flex-asset-manager-10/ss-list-view.jpg" title=" " class="shutterset_flex-asset-manager-10" >
				<img title="ss-list-view" alt="ss-list-view" src="http://www.fitchett.me/wp-content/gallery/flex-asset-manager-10/thumbs/thumbs_ss-list-view.jpg" width="100" height="75" />
			</a>
		</div>
	</div>
	 		
	<div id="ngg-image-3" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.fitchett.me/wp-content/gallery/flex-asset-manager-10/ss-live-search.jpg" title=" " class="shutterset_flex-asset-manager-10" >
				<img title="ss-live-search" alt="ss-live-search" src="http://www.fitchett.me/wp-content/gallery/flex-asset-manager-10/thumbs/thumbs_ss-live-search.jpg" width="100" height="75" />
			</a>
		</div>
	</div>
	 		
	<div id="ngg-image-6" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.fitchett.me/wp-content/gallery/flex-asset-manager-10/ss-zoom.jpg" title=" " class="shutterset_flex-asset-manager-10" >
				<img title="ss-zoom" alt="ss-zoom" src="http://www.fitchett.me/wp-content/gallery/flex-asset-manager-10/thumbs/thumbs_ss-zoom.jpg" width="100" height="75" />
			</a>
		</div>
	</div>
	 		
	<div id="ngg-image-5" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.fitchett.me/wp-content/gallery/flex-asset-manager-10/ss-upload.jpg" title=" " class="shutterset_flex-asset-manager-10" >
				<img title="ss-upload" alt="ss-upload" src="http://www.fitchett.me/wp-content/gallery/flex-asset-manager-10/thumbs/thumbs_ss-upload.jpg" width="100" height="75" />
			</a>
		</div>
	</div>
	 		
	<div id="ngg-image-1" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.fitchett.me/wp-content/gallery/flex-asset-manager-10/ss-delete.jpg" title=" " class="shutterset_flex-asset-manager-10" >
				<img title="ss-delete" alt="ss-delete" src="http://www.fitchett.me/wp-content/gallery/flex-asset-manager-10/thumbs/thumbs_ss-delete.jpg" width="100" height="75" />
			</a>
		</div>
	</div>
	 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>

<br />
<strong>How it works:</strong></p>
<p class="MsoNormal">The Flex app makes an HTTPService GET request to an ASP VBScript file that sits on the server the script checks to see if any files exist in the directory specified if files do exist it outputs XML with nodes for each of the files along with some additional information such as file size, extension and so on. Once that data is returned to Flex it then parses and display it like any good file manager.</p>
<p class="MsoNormal">
<p class="MsoNormal"><strong>Download &amp; Use it!<span style="font-weight: normal;"> </span></strong></p>
<ol>
<li><span><span><span> </span></span></span>You can download version 1.0 here <a class="downloadlink" href="http://www.fitchett.me/wp-content/plugins/download-monitor/download.php?id=5" title="Version1.0 downloaded 205 times" >Flex Assets Manager (205)</a> you will need make sure that you extract it to the root of your website.</li>
<li><span><span><span> </span></span></span>Once you have extracted it, open up the “config.asp” file and change the strSystemPath to have the correct system path (based on your setup).</li>
<li>Download <a href="http://www.vistaico.com/download/VistaICO-File-Icons.zip">http://www.vistaico.com/download/VistaICO-File-Icons.zip</a> these File icons from Vista Icons and extract them to “/asset-manager/assets/”. I would have included them but I don’t want to get into any copyright issues.</li>
<li>That’s it upload everything and run the “example.asp”</li>
</ol>
<p class="MsoListParagraph">
<p class="MsoNormal"><strong>To Launch the Flex Asset Manager you can do the following:</strong></p>
<blockquote>
<p class="MsoNormal">&lt;a href=&#8221;javascript:launchFlexAssetManager(&#8217;<strong>/asset-manager/uploads/</strong>&#8216;,<strong>&#8216;myForm.myFieldId</strong>&#8216;)&#8221;&gt;</p>
</blockquote>
<ul>
<li>“/asset-manager/uploads/” would be the path to the directory that you want the Assets Manager to look in.</li>
<li>“myForm.myFieldId” would be your form id and your form field id. This is used so after you select an item in the Assets Manager it will populate your form field with the file name.</li>
</ul>
<p class="MsoNormal">If you look at the “example.asp” code you will see everything you need to use it within in a page.</p>
<p class="MsoNormal">
<p class="MsoNormal"><strong>Key &amp; Mouse Commands</strong></p>
<p class="MsoNormal">
<ul>
<li>[E] Enlarges Images</li>
<li>[Delete] Deletes the File (a confirmation box will pop-up)</li>
<li>[Double-Click] Selects the file (same as clicking the use but more common)</li>
</ul>
<p class="MsoListParagraph">
<p class="MsoNormal">
<p class="MsoNormal">Well that’s it for now hope you like it.  Shoot me any comments you have if you need help you can also post them.</p>
<img src="http://feeds.feedburner.com/~r/Fitchett/~4/yDWDQPD4BDY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.fitchett.me/index.php/development/flex-development/flex-file-asset-manager-asp-vbscript-v1/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.fitchett.me/index.php/development/flex-development/flex-file-asset-manager-asp-vbscript-v1/</feedburner:origLink></item>
		<item>
		<title>Adobe Flex – Filter XML Data using E4X and RegExp</title>
		<link>http://feedproxy.google.com/~r/Fitchett/~3/24OLqmaAC9Y/</link>
		<comments>http://www.fitchett.me/index.php/development/adobe-flex-filter-xml-data-using-e4x-and-regexp/#comments</comments>
		<pubDate>Sat, 09 May 2009 08:20:35 +0000</pubDate>
		<dc:creator>Michael Fitchett</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[E4X]]></category>
		<category><![CDATA[Filter]]></category>
		<category><![CDATA[RegExp]]></category>

		<guid isPermaLink="false">http://www.fitchett.me/?p=177</guid>
		<description><![CDATA[
Here is an example
Here is the code for the example

?View Code XML&#60;!--
=====================================================================================
	Get data using HTTPService from fitchett.me RSS Feed
=====================================================================================
--&#62;
&#160;
&#60;!--
=====================================================================================
	Script
=====================================================================================
--&#62;
&#160;
		&#60;![CDATA[
&#160;
			private function init():void
			{
				//Once all of the components have loaded send the HTTPService request
				myData.send();
			}
&#160;
			private function dataLoaded():void
			{
				//Once the data has loaded populate the DataGrid and TextArea with the Results.
				myDataGrid.dataProvider = myData.lastResult.channel.item;
			}
&#160;
			private function search():void
			{
				try
				{
					var reg:RegExp = new RegExp(tbSearch.text.toLowerCase());
					myDataGrid.dataProvider = myData.lastResult.channel.item.(reg.test(title.toLowerCase()))
				}
				catch(err:Error)
				{
					//Do [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-177"></span><!--noteaser--><br />
Here is an example</p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_1" width="500" height="380" align="center">
      <param name="movie" value="http://www.fitchett.me/wp-content/uploads/2009/05/flex_e4x_example.swf" />
      <param name="align" value="center" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://www.fitchett.me/wp-content/uploads/2009/05/flex_e4x_example.swf" width="500" height="380" align="center">
      <!--<![endif]-->
        <p>The Flash plugin is required to view this object.</p>
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<p>Here is the code for the example</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p177code2'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1772"><td class="code" id="p177code2"><pre class="xml" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">=====================================================================================</span>
<span style="color: #808080; font-style: italic;">	Get data using HTTPService from fitchett.me RSS Feed</span>
<span style="color: #808080; font-style: italic;">=====================================================================================</span>
<span style="color: #808080; font-style: italic;">--&gt;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">=====================================================================================</span>
<span style="color: #808080; font-style: italic;">	Script</span>
<span style="color: #808080; font-style: italic;">=====================================================================================</span>
<span style="color: #808080; font-style: italic;">--&gt;</span>
&nbsp;
		<span style="color: #339933;">&lt;![CDATA[</span>
&nbsp;
<span style="color: #339933;">			private function init():void</span>
<span style="color: #339933;">			{</span>
<span style="color: #339933;">				//Once all of the components have loaded send the HTTPService request</span>
<span style="color: #339933;">				myData.send();</span>
<span style="color: #339933;">			}</span>
&nbsp;
<span style="color: #339933;">			private function dataLoaded():void</span>
<span style="color: #339933;">			{</span>
<span style="color: #339933;">				//Once the data has loaded populate the DataGrid and TextArea with the Results.</span>
<span style="color: #339933;">				myDataGrid.dataProvider = myData.lastResult.channel.item;</span>
<span style="color: #339933;">			}</span>
&nbsp;
<span style="color: #339933;">			private function search():void</span>
<span style="color: #339933;">			{</span>
<span style="color: #339933;">				try</span>
<span style="color: #339933;">				{</span>
<span style="color: #339933;">					var reg:RegExp = new RegExp(tbSearch.text.toLowerCase());</span>
<span style="color: #339933;">					myDataGrid.dataProvider = myData.lastResult.channel.item.(reg.test(title.toLowerCase()))</span>
<span style="color: #339933;">				}</span>
<span style="color: #339933;">				catch(err:Error)</span>
<span style="color: #339933;">				{</span>
<span style="color: #339933;">					//Do Nothing...</span>
<span style="color: #339933;">				}</span>
<span style="color: #339933;">				finally</span>
<span style="color: #339933;">				{</span>
<span style="color: #339933;">					//Do Nothing...</span>
<span style="color: #339933;">				}</span>
<span style="color: #339933;">			}</span>
&nbsp;
<span style="color: #339933;">		]]&gt;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">=====================================================================================</span>
<span style="color: #808080; font-style: italic;">	Display Components</span>
<span style="color: #808080; font-style: italic;">=====================================================================================</span>
<span style="color: #808080; font-style: italic;">--&gt;</span></pre></td></tr></table></div>

<p>You can download the project source here <a class="downloadlink" href="http://www.fitchett.me/wp-content/plugins/download-monitor/download.php?id=4" title="Version1.0 downloaded 716 times" >Flex E4X Example (716)</a></p>
<p>For those of  you wondering how this example was done without reading the code read on…</p>
<p><strong>Getting the Data</strong></p>
<ol>
<li>Flex gets the XML data from  the RSS feed using the HTTPService</li>
<li>Once the data has successfully  loaded the data is then passed into the DataGrid</li>
</ol>
<p><strong>Filtering the Data using E4X and RegExp</strong></p>
<ol>
<li>When a user types into the  textbox a change action is triggered triggering the search() function</li>
<li>The search() function then  runs code that creates a new RegExp variable named “reg”with the “tbsearch.text.toLowerCase()”being passed in as the string.</li>
<li>The DataGrid provider is then … umm iono man it’s just magic to me at this point.</li>
<li>And poof everything works!</li>
</ol>
<p>Ok maybe I do know.</p>
<p>5. Since we are using E4X we parse the XML using the new RegExp we  just created.</p>
<p>As always ping me if you have questions with a comment or feel  free to e-mail me <a href="mailto:michael@fitchett.me">michael@fitchett.me</a></p>
<img src="http://feeds.feedburner.com/~r/Fitchett/~4/24OLqmaAC9Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.fitchett.me/index.php/development/adobe-flex-filter-xml-data-using-e4x-and-regexp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.fitchett.me/index.php/development/adobe-flex-filter-xml-data-using-e4x-and-regexp/</feedburner:origLink></item>
		<item>
		<title>Resize IFRAME Based on Content – Cross Domain</title>
		<link>http://feedproxy.google.com/~r/Fitchett/~3/cO1MWp34d1c/</link>
		<comments>http://www.fitchett.me/index.php/development/javascript/resize-iframe-based-on-content-cross-domain/#comments</comments>
		<pubDate>Fri, 01 May 2009 02:00:41 +0000</pubDate>
		<dc:creator>Michael Fitchett</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[cross domain]]></category>
		<category><![CDATA[IFRAME]]></category>
		<category><![CDATA[iframe code]]></category>
		<category><![CDATA[resize iframe based on content]]></category>
		<category><![CDATA[resize iframe to fit content]]></category>

		<guid isPermaLink="false">http://www.fitchett.me/?p=150</guid>
		<description><![CDATA[You will find a lot on this topic but no real solid answers. I looked around and ended up piecing this solution together. Yes that&#8217;s right it CAN be done! Well sorta&#8230;

Put this in between your &#60;HEAD&#62; tags or in your scripts include file

?View Code JAVASCRIPT1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
&#60;script type=&#34;text/javascript&#34;&#62;
//Lookup Cookie by Name and Return Value
function readCookie&#40;name&#41; &#123;
	var [...]]]></description>
			<content:encoded><![CDATA[<div style="height:155px;"><img src="http://www.fitchett.me/wp-content/uploads/2009/04/window-150x150.png" alt="window" title="window" width="150" height="150" class="alignright size-thumbnail wp-image-247" />You will find a lot on this topic but no real solid answers. I looked around and ended up piecing this solution together. <strong>Yes that&#8217;s right it CAN be done!</strong> Well sorta&#8230;</div>
<p><span id="more-150"></span></p>
<p>Put this in between your <strong>&lt;HEAD&gt;</strong> tags or in your scripts include file</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p150code6'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1506"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
</pre></td><td class="code" id="p150code6"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #006600; font-style: italic;">//Lookup Cookie by Name and Return Value</span>
<span style="color: #003366; font-weight: bold;">function</span> readCookie<span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> nameEQ <span style="color: #339933;">=</span> <span style="color: #000066;">name</span> <span style="color: #339933;">+</span> <span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;=&amp;</span>quot<span style="color: #339933;">;;</span>
	<span style="color: #003366; font-weight: bold;">var</span> ca <span style="color: #339933;">=</span> document.<span style="color: #660066;">cookie</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">';'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> ca.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> c <span style="color: #339933;">=</span> ca<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>c.<span style="color: #660066;">charAt</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #3366CC;">' '</span><span style="color: #009900;">&#41;</span> c <span style="color: #339933;">=</span> c.<span style="color: #660066;">substring</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">,</span>c.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>c.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span>nameEQ<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span> c.<span style="color: #660066;">substring</span><span style="color: #009900;">&#40;</span>nameEQ.<span style="color: #660066;">length</span><span style="color: #339933;">,</span>c.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//Set iFrame Height based on &amp;quot;kofax-iframe-height&amp;quot; value</span>
<span style="color: #003366; font-weight: bold;">function</span> setIFrameHeightToCookie<span style="color: #009900;">&#40;</span>cookieValue<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> formHeight <span style="color: #339933;">=</span> readCookie<span style="color: #009900;">&#40;</span>cookieValue<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> iFrame <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'iFrame'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">//</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>formHeight <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		iFrame.<span style="color: #660066;">height</span> <span style="color: #339933;">=</span> parseInt<span style="color: #009900;">&#40;</span>formHeight<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #CC0000;">30</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> 
	<span style="color: #000066; font-weight: bold;">else</span>
	<span style="color: #009900;">&#123;</span>
		iFrame.<span style="color: #660066;">height</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'600px'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p> </p>
<p>Add the following to the source page inside of the IFRAME</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p150code7'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1507"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code" id="p150code7"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">innerHeight</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> window.<span style="color: #660066;">scrollMaxY</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #006600; font-style: italic;">// Firefox</span>
	yWithScroll <span style="color: #339933;">=</span> window.<span style="color: #660066;">innerHeight</span> <span style="color: #339933;">+</span> window.<span style="color: #660066;">scrollMaxY</span><span style="color: #339933;">;</span>
	xWithScroll <span style="color: #339933;">=</span> window.<span style="color: #660066;">innerWidth</span> <span style="color: #339933;">+</span> window.<span style="color: #660066;">scrollMaxX</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">body</span>.<span style="color: #660066;">scrollHeight</span> <span style="color: #339933;">&gt;</span> document.<span style="color: #660066;">body</span>.<span style="color: #660066;">offsetHeight</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// all but Explorer Mac</span>
	yWithScroll <span style="color: #339933;">=</span> document.<span style="color: #660066;">body</span>.<span style="color: #660066;">scrollHeight</span><span style="color: #339933;">;</span>
	xWithScroll <span style="color: #339933;">=</span> document.<span style="color: #660066;">body</span>.<span style="color: #660066;">scrollWidth</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// works in Explorer 6 Strict, Mozilla (not FF) and Safari</span>
	yWithScroll <span style="color: #339933;">=</span> document.<span style="color: #660066;">body</span>.<span style="color: #660066;">offsetHeight</span><span style="color: #339933;">;</span>
	xWithScroll <span style="color: #339933;">=</span> document.<span style="color: #660066;">body</span>.<span style="color: #660066;">offsetWidth</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
document.<span style="color: #660066;">cookie</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;page-height=&quot;</span> <span style="color: #339933;">+</span> yWithScroll  <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;; expires=01/01/2999 10:00:00; path=/;domain=.yourdomain.com&quot;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Create the IFRAME</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p150code8'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1508"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p150code8"><pre class="html" style="font-family:monospace;">&lt;iframe id=&quot;iFrame&quot; src=&quot;http://www.yourdomain.com&quot; width=&quot;100%&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; allowtransparency=&quot;true&quot; onload=&quot;setIFrameHeightToCookie('page-height');&quot;&gt;&lt;/iframe&gt;</pre></td></tr></table></div>

<p>I searched all over and as a last resort I decided to use a cookie to pass the height over. Since we are working across domains trying to use JavaScript to access another frame is out of the question. You will get a security error that there seems to be no way around. </p>
<p>If you have a better solution please post it in the comments section below and I will update the post. </p>
<p>Hope this helps! It did for me.</p>
<img src="http://feeds.feedburner.com/~r/Fitchett/~4/cO1MWp34d1c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.fitchett.me/index.php/development/javascript/resize-iframe-based-on-content-cross-domain/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.fitchett.me/index.php/development/javascript/resize-iframe-based-on-content-cross-domain/</feedburner:origLink></item>
		<item>
		<title>Adobe Flex – ASP.NET Web Service Send E-mail</title>
		<link>http://feedproxy.google.com/~r/Fitchett/~3/wcJDA7tmDW0/</link>
		<comments>http://www.fitchett.me/index.php/development/adobe-flex-aspnet-web-service-send-e-mail/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 07:57:16 +0000</pubDate>
		<dc:creator>Michael Fitchett</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Web Service]]></category>
		<category><![CDATA[Action Script 3.0]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[E-mail]]></category>
		<category><![CDATA[SMTP]]></category>

		<guid isPermaLink="false">http://www.fitchett.me/?p=124</guid>
		<description><![CDATA[Before we get started download &#8220;One Headlight&#8221; by the Wallflowers. Yea its a bit old but still rocks!  
Now that have some music jamming in the background lets get started.
We need an ASP.NET web service if you don&#8217;t already have one create it; if you do then great. This example code is in C# [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.fitchett.me/wp-content/uploads/2009/04/flex-email-application.png" alt="flex-email-application" title="flex-email-application" width="225" height="170" class="alignright size-full wp-image-249" />Before we get started download &#8220;One Headlight&#8221; by the Wallflowers. Yea its a bit old but still rocks! <img src='http://www.fitchett.me/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Now that have some music jamming in the background lets get started.</p>
<p>We need an ASP.NET web service if you don&#8217;t already have one create it; if you do then great. This example code is in C# it can easily be done in VB as well.</p>
<p><strong>1.</strong> Let&#8217;s add an import to the top</p>
<pre class="brush: csharp;">
using System.Web.Mail;
</pre>
<p> <span id="more-124"></span><br />
<strong>1a.</strong> Put &#8220;One Headlight&#8221; on repeat.</p>
<p><strong>2. </strong>Now we need to create the web service function that sends the emails</p>
<pre class="brush: csharp;">[WebMethod]
public string sendEmail(string strMailTo, string strMailFrom, string strMailSubject, string strMailBody)
{
     //create the mail message
     MailMessage mail = new MailMessage();

     //set the addresses
     mail.From = new MailAddress(strMailFrom);
     mail.To.Add(strMailTo);

     //set the content
     mail.Subject = strMailSubject;
     mail.Body = strMailBody;
     mail.IsBodyHtml = true;

     //send the message
     SmtpClient smtp = new SmtpClient(&amp;quot;127.0.0.1&amp;quot;);
     smtp.Send(mail);

     //return message
     return &amp;quot;Message Sent!&amp;quot;;
}
</pre>
<p> </p>
<p> </p>
<p><strong>3.</strong> Test it by running the web service in debug mode.</p>
<p>Click on the sendMail link and you should see something like this</p>
<p> </p>
<div id="attachment_138" class="wp-caption aligncenter" style="width: 473px"><img class="size-full wp-image-138" title="screenshot-sendemail-webservice" src="http://www.fitchett.me/wp-content/uploads/2009/04/screenshot-sendemail-webservice.jpg" alt="Screen Shot - Web Service - sendMail Function" width="463" height="228" /><p class="wp-caption-text">Screen Shot - Web Service - sendMail Function</p></div>
<p> </p>
<p> </p>
<p>fill it out and click Invoke. You need to make sure you have a SMTP server running on your machine. If you don&#8217;t you will get an error. I doubt you will be running it locally so you can upload it to your server and carry on to step 4.</p>
<p><strong>4.</strong> Now that we have our web service function built we need to link it up in Adobe Flex. Make sure to replace &#8220;yourPassedValue&#8221; with some string value that you are passing from somewhere like a text field. If you want it to be static then remove the open and close Flex code tags &#8220;{}&#8221; and just type the string.</p>
<pre class="brush: xml;">
&lt;mx:WebService id=&quot;yourWebServiceID&quot; wsdl=&quot;http://www.domain.com/&lt;b style=&quot;color:black;background-color:#ff66ff&quot;&gt;Service&lt;/b&gt;.asmx?WSDL&quot; showBusyCursor=&quot;true&quot;&gt;
       &lt;mx:operation name=&quot;sendEmail&quot;&gt;
           &lt;mx:request&gt;
                  &lt;strMailTo&gt;{yourPassedValue}&lt;/strMailTo&gt;
                  &lt;strMailFrom&gt;{yourPassedValue}&lt;/strMailFrom&gt;
                  &lt;strMailSubject&gt;{yourPassedValue}&lt;/strMailSubject&gt;
                  &lt;strMailBody&gt;{yourPassedValue}&lt;/strMailBody&gt;
           &lt;/mx:request&gt;
      &lt;/mx:operation&gt;
&lt;/mx:WebService&gt;
</pre>
<p>5.  Now all that&#8217;s left is to add this to an action like a button click event</p>
<pre class="brush: jscript;">
yourWebServiceID.sendEmail.send();
</pre>
<p>That&#8217;s it. I added an example below if it errors out its because the max relays have been reached. I will update it soon with a notification. I will also provide the source.</p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_2" width="500" height="300" align="center">
      <param name="movie" value="http://www.fitchett.me/wp-content/uploads/2009/04/sendemailexample.swf" />
      <param name="align" value="center" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://www.fitchett.me/wp-content/uploads/2009/04/sendemailexample.swf" width="500" height="300" align="center">
      <!--<![endif]-->
        <p>The Flash plugin is required to view this object.</p>
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<img src="http://feeds.feedburner.com/~r/Fitchett/~4/wcJDA7tmDW0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.fitchett.me/index.php/development/adobe-flex-aspnet-web-service-send-e-mail/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.fitchett.me/index.php/development/adobe-flex-aspnet-web-service-send-e-mail/</feedburner:origLink></item>
		<item>
		<title>Adobe Flex – Format Date &amp; Time (inside of a DataGrid too)</title>
		<link>http://feedproxy.google.com/~r/Fitchett/~3/TlruOpnxH-A/</link>
		<comments>http://www.fitchett.me/index.php/development/adobe-flex-format-date-time-inside-of-a-datagrid-too/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 02:51:11 +0000</pubDate>
		<dc:creator>Michael Fitchett</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Date]]></category>
		<category><![CDATA[Format]]></category>
		<category><![CDATA[Time]]></category>

		<guid isPermaLink="false">http://www.fitchett.me/?p=102</guid>
		<description><![CDATA[This is probably one of the easier things to do in Flex. Yea you could probably find out how to do this by reading the Adobe Flex Documentation but who wants to read that when you have Google at your fingertips.
What the Adobe Flex Documentation wont tell you is how to format your date and [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.fitchett.me/wp-content/uploads/2009/04/flex-format-date-time.png" alt="flex-format-date-time" title="flex-format-date-time" width="289" height="201" class="alignright size-full wp-image-252" />This is probably one of the easier things to do in Flex. Yea you could probably find out how to do this by reading the Adobe Flex Documentation but who wants to read that when you have Google at your fingertips.</p>
<p>What the Adobe Flex Documentation wont tell you is how to format your date and time inside of a DataGrid or other components.  No worries I do!</p>
<p>Here is how you format a date pulled in as XML, E4X or whatever&#8230;</p>
<p>First you will need a <strong>DateFormatter</strong></p>
<pre class="brush: xml;">
&lt;mx:DateFormatter id=&quot;formatDateTime&quot; formatString=&quot;MM/DD/YY&quot; /&gt;
</pre>
<p> <br />
<span id="more-102"></span><br />
the <strong>formatString </strong>will determine how your date &amp; time is formatted. I have created a pattern chart below that&#8217;s a little easier to read then the one on Adobe&#8217;s Flex Documentation.</p>
<table border="0" cellspacing="0" cellpadding="5" width="100%">
<tbody>
<tr>
<td width="15%" bgcolor="#333333"><span class="style1"><span style="color: #ffffff;"><strong>Pattern</strong></span></span></td>
<td width="85%" bgcolor="#333333"><span class="style1"><span style="color: #ffffff;"><strong>Example</strong></span></span></td>
</tr>
<tr>
<td><strong>Year</strong></td>
<td> </td>
</tr>
<tr>
<td bgcolor="#F5F5F5">YY</td>
<td bgcolor="#F5F5F5"><span class="style2"><span style="color: #808080;">09 (Year Number Short)</span></span></td>
</tr>
<tr>
<td>YYY</td>
<td><span class="style2"><span style="color: #808080;">2009 (Year Number Full)</span></span></td>
</tr>
<tr>
<td bgcolor="#F5F5F5">YYYY</td>
<td bgcolor="#F5F5F5"><span class="style2"><span style="color: #808080;">02009 (I have no clue why you would need this)</span></span></td>
</tr>
<tr>
<td><strong>Month</strong></td>
<td> </td>
</tr>
<tr>
<td bgcolor="#F5F5F5">M</td>
<td bgcolor="#F5F5F5"><span class="style2"><span style="color: #808080;">7 (Month Number Short)</span></span></td>
</tr>
<tr>
<td>MM</td>
<td><span class="style2"><span style="color: #808080;">07 (Month Number Full)</span></span></td>
</tr>
<tr>
<td bgcolor="#F5F5F5">MMM</td>
<td bgcolor="#F5F5F5"><span class="style2"><span style="color: #808080;">Jul (Month Name Short)</span></span></td>
</tr>
<tr>
<td>MMMM</td>
<td><span class="style2"><span style="color: #808080;">July (Month Name Full)</span></span></td>
</tr>
<tr>
<td bgcolor="#F5F5F5"><strong>Day</strong></td>
<td bgcolor="#F5F5F5"> </td>
</tr>
<tr>
<td>D</td>
<td><span class="style2"><span style="color: #808080;">4 (Day Number Short)</span></span></td>
</tr>
<tr>
<td bgcolor="#F5F5F5">DD</td>
<td bgcolor="#F5F5F5"><span class="style2"><span style="color: #808080;">04 (Day Number Full)</span></span></td>
</tr>
<tr>
<td><strong>Day Name</strong></td>
<td> </td>
</tr>
<tr>
<td bgcolor="#F5F5F5">E</td>
<td bgcolor="#F5F5F5"><span class="style2"><span style="color: #808080;">1 (Day Number Short)</span></span></td>
</tr>
<tr>
<td>EE</td>
<td><span class="style2"><span style="color: #808080;">01 (Day Number Full)</span></span></td>
</tr>
<tr>
<td bgcolor="#F5F5F5">EEE</td>
<td bgcolor="#F5F5F5"><span class="style2"><span style="color: #808080;">Mon (Day Name Short)</span></span></td>
</tr>
<tr>
<td>EEEE</td>
<td><span class="style2"><span style="color: #808080;">Monday (Day Name Full)</span></span></td>
</tr>
<tr>
<td bgcolor="#F5F5F5">A</td>
<td bgcolor="#F5F5F5"><span class="style2"><span style="color: #808080;">AM/PM</span></span></td>
</tr>
<tr>
<td>J</td>
<td><span class="style2"><span style="color: #808080;">Hour in day (0-23)</span></span></td>
</tr>
<tr>
<td bgcolor="#F5F5F5">H</td>
<td bgcolor="#F5F5F5"><span class="style2"><span style="color: #808080;">Hour in day (1-24)</span></span></td>
</tr>
<tr>
<td>K</td>
<td><span class="style2"><span style="color: #808080;">Hour in AM/PM (0-11)</span></span></td>
</tr>
<tr>
<td bgcolor="#F5F5F5">L</td>
<td bgcolor="#F5F5F5"><span class="style2"><span style="color: #808080;">Hour in AM/PM(1-12)</span></span></td>
</tr>
<tr>
<td>N</td>
<td><span class="style2"><span style="color: #808080;">3 (Minutes)</span></span></td>
</tr>
<tr>
<td bgcolor="#F5F5F5">NN</td>
<td bgcolor="#F5F5F5"><span class="style2"><span style="color: #808080;">03 (Minutes)</span></span></td>
</tr>
<tr>
<td>SS</td>
<td><span class="style2"><span style="color: #808080;">30 (Seconds)</span></span></td>
</tr>
</tbody>
</table>
<p>OK now on to applying it to a date with funky database formatting </p>
<pre class="brush: jscript;">
formatDateTime.format(yourDateTimeObjectAsString);
</pre>
<p> </p>
<p>For playing around purposes I created an example in Flex, change the pattern to alter the date and time</p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_3" width="500" height="300" align="center">
      <param name="movie" value="http://www.fitchett.me/wp-content/uploads/2009/04/flex_datetime_formatter_demo.swf" />
      <param name="align" value="center" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://www.fitchett.me/wp-content/uploads/2009/04/flex_datetime_formatter_demo.swf" width="500" height="300" align="center">
      <!--<![endif]-->
        <p>The Flash plugin is required to view this object.</p>
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<p> </p>
<p>Almost forgot!, To use the format inside of a DataGrid you need to add</p>
<pre class="brush: xml;">
&lt;mx:DateFormatter id=&quot;formatDateTime&quot; formatString=&quot;MM/DD/YY&quot; /&gt;
</pre>
<p>to your DataGrid inside of a VBox or HBox along with your label so it looks something like this</p>
<pre class="brush: xml;">
&lt;mx:DataGridColumn headerText=&quot;Date&quot;&gt;
     &lt;mx:itemRenderer&gt;
          &lt;mx:Component&gt;
               &lt;mx:VBox&gt;
                    &lt;mx:DateFormatter id=&quot;formatDateTime&quot; formatString=&quot;MM/DD/YY&quot; /&gt;
                    &lt;mx:Label text=&quot;{formatDateTime.format(data.myDate) }/&gt;
</pre>
<img src="http://feeds.feedburner.com/~r/Fitchett/~4/TlruOpnxH-A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.fitchett.me/index.php/development/adobe-flex-format-date-time-inside-of-a-datagrid-too/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<feedburner:origLink>http://www.fitchett.me/index.php/development/adobe-flex-format-date-time-inside-of-a-datagrid-too/</feedburner:origLink></item>
		<item>
		<title>Adobe Flex – Filter XML data using E4X</title>
		<link>http://feedproxy.google.com/~r/Fitchett/~3/ax1hLLlFqyY/</link>
		<comments>http://www.fitchett.me/index.php/development/flex-development/quick-tip-filtering-your-xml-data-inside-of-flex-using-e4x/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 07:44:05 +0000</pubDate>
		<dc:creator>Michael Fitchett</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[E4X]]></category>
		<category><![CDATA[Quick Tip]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.fitchett.me/?p=82</guid>
		<description><![CDATA[You have imported your data using either an HTTPService, Web Service or some other means. Great! now how do you filter and sort the data? Using E4X of course! Lets get started.
1st. Switch the resultFormat on your HTTPService or Web Service by adding the following property resultFormat=&#8221;e4x&#8221; to your tag:

&#60;!-- HTTPService --&#62;
&#60;mx:HTTPService id='data' resultFormat=&#34;e4x&#34;/&#62;
&#60;!-- Web Service [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.fitchett.me/wp-content/uploads/2009/03/find1-150x150.png" alt="find1" title="find1" width="150" height="150" class="alignright size-thumbnail wp-image-256" />You have imported your data using either an HTTPService, Web Service or some other means. Great! now how do you filter and sort the data? Using E4X of course! Lets get started.</p>
<p>1st. Switch the resultFormat on your HTTPService or Web Service by adding the following property <strong>resultFormat=&#8221;e4x&#8221;</strong> to your tag:</p>
<pre class="brush: xml;">
&lt;!-- HTTPService --&gt;
&lt;mx:HTTPService id='data' resultFormat=&quot;e4x&quot;/&gt;
&lt;!-- Web Service --&gt;
&lt;mx:WebService id=&quot;wsData&quot; wsdl=&quot;http://www.domain.com/Service.asmx?WSDL&quot; showBusyCursor=&quot;true&quot;&gt;
      &lt;mx:operation name=&quot;getData&quot; resultFormat=&quot;e4x&quot;&gt;
</pre>
<p><span id="more-82"></span><br />
2nd. Now that we are returning the XML data in E4x format we can now use E4x to filter the data. Here is a quick example of how you would filter the data in a DataGrid:</p>
<pre class="brush: xml;">
&lt;!-- HTTPService --&gt;
&lt;mx:DataGrid dataProvider=&quot;{data.lastResult.root.item(somenode != null)}&quot;/&gt;
&lt;!-- Return One Record/Row/Result--&gt;
&lt;mx:DataGrid dataProvider=&quot;{data.lastResult.root.item(somenode != null)[0]}&quot;/&gt;
&lt;!-- Web Service --&gt;
&lt;mx:DataGrid dataProvider=&quot;{wsData. getData.lastResult.root.item(somenode != null)}&quot;/&gt;
&lt;!-- Return One Record/Row/Result--&gt;
&lt;mx:DataGrid dataProvider=&quot;{wsData. getData.lastResult.root.item(somenode != null)[0]}&quot;/&gt;
</pre>
<p>This is just one way of doing it, you have tons of different options. It all really depends on your project; typically, I bind the data to an XMLListCollection then filter the data by changing the source with the filter code and running refresh on the XMLListCollection.</p>
<img src="http://feeds.feedburner.com/~r/Fitchett/~4/ax1hLLlFqyY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.fitchett.me/index.php/development/flex-development/quick-tip-filtering-your-xml-data-inside-of-flex-using-e4x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.fitchett.me/index.php/development/flex-development/quick-tip-filtering-your-xml-data-inside-of-flex-using-e4x/</feedburner:origLink></item>
		<item>
		<title>Adobe Flex – Scale images without making them pixelated using Smooth Image component</title>
		<link>http://feedproxy.google.com/~r/Fitchett/~3/uzRfMAg2u9c/</link>
		<comments>http://www.fitchett.me/index.php/development/adobe-flex-smooth-image-component/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 07:05:30 +0000</pubDate>
		<dc:creator>Michael Fitchett</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Great Resources]]></category>
		<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Component]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[Resize]]></category>
		<category><![CDATA[Smooth Image]]></category>

		<guid isPermaLink="false">http://www.fitchett.me/?p=69</guid>
		<description><![CDATA[
Here is an example, Focus on the bird and the branch he is standing on and play with the slider.
 
&#8220;Cool so how do I implement this into my website?&#8221; &#8211; Its simple follow the steps below:
1. Download the component here�and place it in a directory called &#8220;custom&#8221; in your src directory.
2. Add the following code [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-69"></span><!--noteaser--><br />
Here is an example, Focus on the bird and the branch he is standing on and play with the slider.</p>
<p>
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_4" width="500" height="300" align="center">
      <param name="movie" value="http://www.fitchett.me/wp-content/uploads/2009/03/resize_image_demo.swf" />
      <param name="align" value="center" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://www.fitchett.me/wp-content/uploads/2009/03/resize_image_demo.swf" width="500" height="300" align="center">
      <!--<![endif]-->
        <p>The Flash plugin is required to view this object.</p>
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
<br />
 </p>
<p><strong>&#8220;Cool so how do I implement this into my website?&#8221;</strong> &#8211; Its simple follow the steps below:</p>
<p>1. Download the component here <a class="downloadlink" href="http://www.fitchett.me/wp-content/plugins/download-monitor/download.php?id=2" title="Version1.0 downloaded 523 times" >SmoothImage (523)</a> and place it in a directory called &#8220;custom&#8221; in your src directory.</p>
<p>2. Add the following code to your &lt;application&gt; tag:</p>
<pre class="brush: xml;">
xmlns:custom=&quot;custom.*&quot;
</pre>
<p> </p>
<p>3. To use it simply type &#8220;&lt;custom:SmoothImage&#8221; you should see it show up as soon as you start to type cus.</p>
<p>That&#8217;s it neat huh.</p>
<img src="http://feeds.feedburner.com/~r/Fitchett/~4/uzRfMAg2u9c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.fitchett.me/index.php/development/adobe-flex-smooth-image-component/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.fitchett.me/index.php/development/adobe-flex-smooth-image-component/</feedburner:origLink></item>
		<item>
		<title>Adobe Flex – Scale down your video without making it pixelated using Smooth Video Display component</title>
		<link>http://feedproxy.google.com/~r/Fitchett/~3/vCfKTB7vvWo/</link>
		<comments>http://www.fitchett.me/index.php/development/adobe-flex-smooth-video-display-component/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 01:18:53 +0000</pubDate>
		<dc:creator>Michael Fitchett</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Component]]></category>
		<category><![CDATA[SmoothVideoDisplay]]></category>
		<category><![CDATA[VideoDisplay]]></category>

		<guid isPermaLink="false">http://www.fitchett.me/?p=61</guid>
		<description><![CDATA[Do your movies look like this because you set the size of the VideoDisplay component to a different size than your source movie?:

Well no need to panic, some cool programmer dude wrote this component &#8220;SmoothVideoDisplay&#8221; (I think that&#8217;s what its called I&#8217;m too lazy to google it.) which fixes that problem so your video will [...]]]></description>
			<content:encoded><![CDATA[<div style="height:220px;"><img src="http://www.fitchett.me/wp-content/uploads/2009/03/bad-video.png" alt="bad-video" title="bad-video" width="290" height="220" class="alignright size-full wp-image-262" />Do your movies look like this because you set the size of the VideoDisplay component to a different size than your source movie?:</div>
<p><span id="more-61"></span></p>
<p>Well no need to panic, some cool programmer dude wrote this component &#8220;SmoothVideoDisplay&#8221; (I think that&#8217;s what its called I&#8217;m too lazy to google it.) which fixes that problem so your video will look like this:</p>
<div id="attachment_60" class="wp-caption alignnone" style="width: 490px"><img class="size-full wp-image-60" title="with-smooth-video" src="http://www.fitchett.me/wp-content/uploads/2009/03/with-smooth-video.jpg" alt="with-smooth-video" width="480" height="269" /><p class="wp-caption-text">No jagged edges!</p></div>
<p>It uses Flash&#8217;s video smoothing component which apparently for some reason or another was not made an option in Flex&#8217;s VideoDisplay component. Maybe it was another rush thing or something.</p>
<p>Here is what you have to do to set it up:</p>
<p>1. Download the component here <a class="downloadlink" href="http://www.fitchett.me/wp-content/plugins/download-monitor/download.php?id=1" title="Version1.0 downloaded 378 times" >SmoothVideoDisplay (378)</a> and extract the SmoothVideoDisplay.as file your &#8220;src&#8221; directory under a new directory &#8220;custom&#8221;</p>
<p>2. Add the following to your &lt;application&gt; at the top of your Flex application:</p>
<pre class="brush: xml;">
xmlns:custom=&quot;custom.*&quot;
</pre>
<p> </p>
<p>3. Now to use it all you have to do is start typing &#8220;&lt;custom:SmoothVideoDisplay&gt;&#8221;</p>
<p>That&#8217;s it simple huh.</p>
<p>Thanks to who ever wrote this component I love it and use it on all of my video based Flex projects.</p>
<img src="http://feeds.feedburner.com/~r/Fitchett/~4/vCfKTB7vvWo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.fitchett.me/index.php/development/adobe-flex-smooth-video-display-component/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.fitchett.me/index.php/development/adobe-flex-smooth-video-display-component/</feedburner:origLink></item>
	</channel>
</rss>
