<?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"
	>

<channel>
	<title>Jake Churchill</title>
	<atom:link href="http://reynacho.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://reynacho.com</link>
	<description>... on Flex, ColdFusion, FarCry, and much more ...</description>
	<pubDate>Sat, 08 Nov 2008 04:30:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Flex Metadata - Default Property Values</title>
		<link>http://reynacho.com/2008/11/07/flex-metadata-default-property-values/</link>
		<comments>http://reynacho.com/2008/11/07/flex-metadata-default-property-values/#comments</comments>
		<pubDate>Sat, 08 Nov 2008 04:27:49 +0000</pubDate>
		<dc:creator>Jake Churchill</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://reynacho.com/?p=144</guid>
		<description><![CDATA[Until now I have never needed to do a lot with meta data except making items bindable or creating custom events.  Recently I wanted to create a limitation on a custom property.  Here&#8217;s the code:
private var _iconPosition:String = "left";
[Bindable]
public function set iconPosition( value:String ):void
{
	_iconPosition = value;
}
public function get iconPosition():String
{
	return _iconPosition;
}
In order to add [...]]]></description>
			<content:encoded><![CDATA[<p>Until now I have never needed to do a lot with meta data except making items bindable or creating custom events.  Recently I wanted to create a limitation on a custom property.  Here&#8217;s the code:</p>
<p><code>private var _iconPosition:String = "left";<br />
[Bindable]<br />
public function set iconPosition( value:String ):void<br />
{<br />
	_iconPosition = value;<br />
}<br />
public function get iconPosition():String<br />
{<br />
	return _iconPosition;<br />
}</code></p>
<p>In order to add default values you have to make the property inspectable.  This affects the compiler and provides code hints for the property.  See the <a href="http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&#038;file=metadata_141_11.html">Live Docs</a> for a full description of &#8220;Inspectable&#8221;.    In my example, I wanted to simply limit my &#8220;iconPosition&#8221; property to either left or right.  Here is the updated code:</p>
<p><code>private var _iconPosition:String = "left";<br />
[Bindable]<br />
<strong>[Inspectable(enumeration="left,right")]</strong><br />
public function set iconPosition( value:String ):void<br />
{<br />
	_iconPosition = value;<br />
}<br />
public function get iconPosition():String<br />
{<br />
	return _iconPosition;<br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://reynacho.com/2008/11/07/flex-metadata-default-property-values/feed/</wfw:commentRss>
		</item>
		<item>
		<title>VPN Network Routing Step-by-Step</title>
		<link>http://reynacho.com/2008/11/03/vpn-network-routing-step-by-step/</link>
		<comments>http://reynacho.com/2008/11/03/vpn-network-routing-step-by-step/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 20:55:37 +0000</pubDate>
		<dc:creator>Jake Churchill</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://reynacho.com/?p=126</guid>
		<description><![CDATA[Here is a quick step-by-step tutorial on VPN routing.  The purpose is to give you access to the VPN network and the local network at the same time (by default it locks you out of your local network and you can only access the remote network).
Step 1:  Create a VPN connection
Frankly, if you [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick step-by-step tutorial on VPN routing.  The purpose is to give you access to the VPN network and the local network at the same time (by default it locks you out of your local network and you can only access the remote network).</p>
<p><strong>Step 1:  Create a VPN connection</strong></p>
<p>Frankly, if you can&#8217;t get this far, you should probably turn back now or seek additional help.</p>
<p><strong>Step 2:  Modify gateway usage</strong><br />
<span id="more-126"></span><br />
Go to the Networking tab of the connection properties and select &#8220;IPv4&#8243;:<br />
<img src="http://reynacho.com/wp-content/uploads/2008/11/networking.jpg" alt="" title="networking" class="alignnone" /></p>
<p>Next, click the &#8220;Properties&#8221; button:<br />
<img src="http://reynacho.com/wp-content/uploads/2008/11/ipv4_properties.jpg" alt="" title="ipv4_properties" class="alignnone" /></p>
<p>Next click the &#8220;Advanced&#8221; button:<br />
<img src="http://reynacho.com/wp-content/uploads/2008/11/advanced.jpg" alt="" title="advanced" class="alignnone" /></p>
<p>Uncheck, the &#8220;Use default gateway on remote network&#8221; and &#8220;automatic metric&#8221;  If I remember correctly, the automatic metric is new in Vista and will not appear in Windows XP.  If that is the case, just uncheck the &#8220;Use default gateway on remote network&#8221;</p>
<p><strong>Step 3: Save the connection and/or connect to the network</strong></p>
<p>The final thing to do is to re-route traffic using one of 2 scripts.  The Widows XP version of this script works without much (or any) tweaking.  Depending on your network you might need to modify the name of the connection:</p>
<p>Toward the bottom of the script in section that loops over all the connections you will see this:</p>
<p><strong>if instr(data(n), “PPP adapter”) then&#8230;</strong></p>
<p>The text “PPP adapter” might need to be modified for your connection (i.e. &#8220;PPP adapter CFWT&#8221;)</p>
<p>The Windows Vista version of this script is essentially the same except I&#8217;ve modified the search criteria slightly.  It no longer looks for &#8220;IP Address&#8221; because Vista can use IP version 4 AND version 6 the text is &#8220;IPv4 Address&#8221;.  The Vista version also has 2 files, the route_fix.vbs file which does the actual routing and a route_fix.bat.  The purpose of the two files is that elevated privileges are necessary to modify routing in Vista.  Right click on the .bat file and select &#8220;Run as Administrator&#8221; and it will in turn run the .vbs file as administrator.  </p>
<p><strong>Note:</strong>  The .bat file assumes that you have placed the files together in a folder on your desktop called &#8220;batch files&#8221;.  If that needs to change you&#8217;ll need to edit the .bat file with the appropriate path.  </p>
<p>Here are those scripts:</p>
<ul>
<li><a href='http://reynacho.com/wp-content/uploads/2008/11/route_fix.zip'>Route Fix (XP version)</a></li>
<li>
<a href='http://reynacho.com/wp-content/uploads/2008/11/route_fix_vista1.zip'>Route Fix (Vista version)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://reynacho.com/2008/11/03/vpn-network-routing-step-by-step/feed/</wfw:commentRss>
		</item>
		<item>
		<title>VPN Connection Route Fix (Windows Vista)</title>
		<link>http://reynacho.com/2008/11/03/vpn-connection-route-fix-windows-vista/</link>
		<comments>http://reynacho.com/2008/11/03/vpn-connection-route-fix-windows-vista/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 20:24:39 +0000</pubDate>
		<dc:creator>Jake Churchill</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://reynacho.com/?p=122</guid>
		<description><![CDATA[I quickly found out that my script for creating a route does not work in Windows Vista (well it sort of did).  One additional piece of information is that when you are creating the connection click on the &#8220;Networking tab&#8221;, select &#8220;Internet Protocol Version 4 (TCP/IPv4)&#8221; and click &#8220;Properties.&#8221;  In the new window, [...]]]></description>
			<content:encoded><![CDATA[<p>I quickly found out that my script for creating a route does not work in Windows Vista (well it sort of did).  One additional piece of information is that when you are creating the connection click on the &#8220;Networking tab&#8221;, select &#8220;Internet Protocol Version 4 (TCP/IPv4)&#8221; and click &#8220;Properties.&#8221;  In the new window, click &#8220;Advanced&#8221; and be sure to uncheck &#8220;Use default gateway on remote network&#8221;.</p>
<p>Here is an updated script for use on windows Vista.  I will be modifying the original post with this information as well.</p>
<p><a href='http://reynacho.com/wp-content/uploads/2008/11/route_fix_vista1.zip'>Download It</a></p>
<p><strong>UPDATE:</strong>  Here&#8217;s a step by step on how to handle the networking:  <a href="http://reynacho.com/2008/11/03/vpn-network-routing-step-by-step/">http://reynacho.com/2008/11/03/vpn-network-routing-step-by-step/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://reynacho.com/2008/11/03/vpn-connection-route-fix-windows-vista/feed/</wfw:commentRss>
		</item>
		<item>
		<title>VPN Connection Route Fix</title>
		<link>http://reynacho.com/2008/10/15/vpn-connection-route-fix/</link>
		<comments>http://reynacho.com/2008/10/15/vpn-connection-route-fix/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 16:03:55 +0000</pubDate>
		<dc:creator>Jake Churchill</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://reynacho.com/?p=115</guid>
		<description><![CDATA[At my last job I had the option to work from home on occasion but I rarely did it because working over a VPN is a pain.  When you connect to a VPN network, by default it disables your local network connection.  End result, you can&#8217;t check your personal email while connected to [...]]]></description>
			<content:encoded><![CDATA[<p>At my last job I had the option to work from home on occasion but I rarely did it because working over a VPN is a pain.  When you connect to a VPN network, by default it disables your local network connection.  End result, you can&#8217;t check your personal email while connected to the VPN.  That was simply not an option for me so a co-worker (<a href="http://stillnetstudios.com">Ryan Stille</a>) came up with a genious way to re-route your internet traffic so VPN traffic went through the VPN without disabling your local network.  That script looks something like this:</p>
<p><code># re-route VPN traffic<br />
route add 10.0.0.0 MASK 255.255.255.0 192.168.1.15 metric 1</code></p>
<p>The problem with this is that you have to connect to the VPN, then open up a command prompt, find the IP address that was given to you by the VPN and use that instead of &#8220;192.168.1.15&#8243;.  </p>
<p>Here&#8217;s some code for a more graceful VBS script that will do the job for you:</p>
<p><code>Dim ipAddy<br />
ipAddy = GetIPAddress()<br />
<span></span><br />
If ipAddy &lt;&gt; "" then<br />
	FixRouteForRDP(ipAddy)<br />
End If<br />
<span></span><br />
<span></span><br />
Function FixRouteForRDP(ipAddy)<br />
	set sh = createobject("wscript.shell")<br />
	set fso = createobject("scripting.filesystemobject")<br />
<span></span><br />
	Set Env = sh.Environment("PROCESS")<br />
	workfile = fso.gettempname<br />
	sh.run "%comspec% /c route add 10.0.0.0 MASK 255.255.255.0 " &amp; ipAddy &amp; " metric 1"<br />
End Function<br />
<span></span><br />
<span></span><br />
Function GetIPAddress()<br />
	set sh = createobject("wscript.shell")<br />
	set fso = createobject("scripting.filesystemobject")<br />
<span></span><br />
	Set Env = sh.Environment("PROCESS")<br />
	if Env("OS") = "Windows_NT" then<br />
		workfile = fso.gettempname<br />
		sh.run "%comspec% /c ipconfig &gt; " &amp; workfile,0,true<br />
	else<br />
		'winipcfg in batch mode sends output to<br />
		'filename winipcfg.out<br />
		 workfile = "winipcfg.out"<br />
		sh.run "winipcfg /batch" ,0,true<br />
	end if<br />
	set sh = nothing<br />
	set ts = fso.opentextfile(workfile)<br />
	data = split(ts.readall,vbcr)<br />
	ts.close<br />
	set ts = nothing<br />
	fso.deletefile workfile<br />
	set fso = nothing<br />
	arIPAddress = ""<br />
<span></span><br />
	for n = 0 to ubound(data)<br />
		if instr(data(n), "PPP adapter") then<br />
			for m = n to ubound(data)<br />
				if instr(data(m),"IP Address") then<br />
					parts = split(data(m),":")<br />
					if trim(parts(1)) &lt;&gt; "0.0.0.0" then<br />
						arIPAddress = trim(cstr(parts(1)))<br />
					end if<br />
				end if<br />
			next<br />
		end if<br />
	next<br />
<span></span><br />
	If (arIPAddress &lt;&gt; "") then<br />
		GetIPAddress = arIPAddress<br />
	Else<br />
		MsgBox "The VPN does not appear to be connected", vbExclamation, "Error"<br />
		GetIPAddress = ""<br />
	End IF<br />
End Function</code></p>
<p><a href='http://reynacho.com/wp-content/uploads/2008/11/route_fix.zip'>Download It</a></p>
<p>This basically looks up the IP address and runs the route command for you.  Note, that in the for loop toward the bottom (if instr(data(n), &#8220;PPP adapter&#8221;) then), the text &#8220;PPP adapter&#8221; might need to be replaced by whatever your VPN connection is called.  For a basic VPN connection, this should work.</p>
<p><strong>UPDATE:</strong>  Here’s a step by step on how to handle the networking:  <a href="http://reynacho.com/2008/11/03/vpn-network-routing-step-by-step/">http://reynacho.com/2008/11/03/vpn-network-routing-step-by-step/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://reynacho.com/2008/10/15/vpn-connection-route-fix/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SQLite Administrator Recommendation</title>
		<link>http://reynacho.com/2008/09/16/sqlite-administrator-recommendation/</link>
		<comments>http://reynacho.com/2008/09/16/sqlite-administrator-recommendation/#comments</comments>
		<pubDate>Tue, 16 Sep 2008 19:18:28 +0000</pubDate>
		<dc:creator>Jake Churchill</dc:creator>
		
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://reynacho.com/?p=113</guid>
		<description><![CDATA[I&#8217;ve been doing a lot of work with SQLite and AIR lately and I recently came across a post from Eric Feminella which has helped me tremendously.
The SQLiteadmin program can be downloaded at the end of this page:  SQLite Administrator - International Milestone Beta
Instructions for installing on Windows:  Unzip and run   [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing a lot of work with SQLite and AIR lately and I recently came across a post from <a href="http://www.ericfeminella.com/blog/category/sqlite/">Eric Feminella</a> which has helped me tremendously.</p>
<p>The SQLiteadmin program can be downloaded at the end of this page:  <a href="http://sqliteadmin.orbmu2k.de/">SQLite Administrator - International Milestone Beta</a></p>
<p>Instructions for installing on Windows:  Unzip and run <img src='http://reynacho.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>This is currently only available for Windows so sorry to all you Mac users (including myself)</p>
]]></content:encoded>
			<wfw:commentRss>http://reynacho.com/2008/09/16/sqlite-administrator-recommendation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flex Graduated Slider</title>
		<link>http://reynacho.com/2008/08/15/flex-graduated-slider/</link>
		<comments>http://reynacho.com/2008/08/15/flex-graduated-slider/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 19:07:15 +0000</pubDate>
		<dc:creator>Jake Churchill</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://reynacho.com/?p=110</guid>
		<description><![CDATA[I ran across this problem recently&#8230;  
I needed to create a slider that didn&#8217;t change in a uniform way.  It was different for each third of the slider.  The first third changed evenly from 0 - 25,000.  The second third from 25,000 - 100,000.  The last third from 100,000 - [...]]]></description>
			<content:encoded><![CDATA[<p>I ran across this problem recently&#8230;  </p>
<p>I needed to create a slider that didn&#8217;t change in a uniform way.  It was different for each third of the slider.  The first third changed evenly from 0 - 25,000.  The second third from 25,000 - 100,000.  The last third from 100,000 - 10,000,000.  </p>
<p>Here are the basic steps that I took:</p>
<ol>
<li>Create a slider with minimum 0 and maximum 10,000,000</li>
<li>Create a handler for the change event</li>
<li>Write a whole lot of math in the change event</li>
</ol>
<p>I&#8217;ll let you read over the application code at the link below.  Here&#8217;s a really quick view of the function that handles the slider changing:</p>
<p><code>private function handleSliderChange():void<br />
{<br />
	var thumbPercentage:Number = slider.value / slider.maximum;<br />
	var newTextInputText:String = '';<br />
	var multiplier:Number;<br />
	if( thumbPercentage &lt;= GraduatedSlider.ONE_THIRD )<br />
	{<br />
		newTextInputText = numberFormatter.format((thumbPercentage / GraduatedSlider.ONE_THIRD) * GraduatedSlider.SLIDER_ONE_THIRD_VALUE);<br />
	}<br />
	else if( thumbPercentage &gt; GraduatedSlider.ONE_THIRD &amp;&amp; thumbPercentage &lt;= GraduatedSlider.TWO_THIRDS )<br />
	{<br />
		multiplier = ((GraduatedSlider.TWO_THIRDS - thumbPercentage) / GraduatedSlider.ONE_THIRD);<br />
		newTextInputText = numberFormatter.format((((thumbPercentage / GraduatedSlider.TWO_THIRDS) * GraduatedSlider.SLIDER_TWO_THIRDS_VALUE) - (multiplier * GraduatedSlider.SLIDER_ONE_THIRD_VALUE)));<br />
	}<br />
	else<br />
	{<br />
		multiplier = ((thumbPercentage - GraduatedSlider.TWO_THIRDS) / GraduatedSlider.ONE_THIRD);<br />
		//trace(multiplier);<br />
		newTextInputText = numberFormatter.format(((multiplier * GraduatedSlider.SLIDER_FULL_VALUE) + ((1 - multiplier) * GraduatedSlider.SLIDER_TWO_THIRDS_VALUE)));<br />
	}<br />
	this.sliderValue = newTextInputText;<br />
	slider.dataTipFormatFunction = sliderDataTip;<br />
	setTextInputValue();<br />
}</code></p>
<p><a target="_blank" href="http://reynacho.com/dev/GraduatedSlider/bin/GraduatedSlider.html">View Application</a>&nbsp;&nbsp;&nbsp;&nbsp;     <a target="_blank" href="http://reynacho.com/dev/GraduatedSlider/bin/srcview/source/GraduatedSlider.mxml.html">View Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://reynacho.com/2008/08/15/flex-graduated-slider/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flex Menu Expanding Over HTML content</title>
		<link>http://reynacho.com/2008/08/12/flex-menu-expanding-over-html-content/</link>
		<comments>http://reynacho.com/2008/08/12/flex-menu-expanding-over-html-content/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 18:32:30 +0000</pubDate>
		<dc:creator>Jake Churchill</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://reynacho.com/?p=98</guid>
		<description><![CDATA[I&#8217;ve recently been tasked with figuring this out so I thought I&#8217;d share my results with everyone.  
The Problem:
Create a Flash/Flex horizontal menu that will overlap the content below it.  We don&#8217;t know how big the menu might get or what kind of content might end up below it.  We do know [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently been tasked with figuring this out so I thought I&#8217;d share my results with everyone.  </p>
<p><strong>The Problem:</strong></p>
<p>Create a Flash/Flex horizontal menu that will overlap the content below it.  We don&#8217;t know how big the menu might get or what kind of content might end up below it.  We do know that layering HTML and Flash does not always work as expected based on which browser you use.  Sure, you can use the wmode=&#8221;transparent&#8221; and put the flash on top of the HTML, but it doesn&#8217;t allow you to hover over or click items under the flash.  </p>
<p><strong>The Solution:</strong></p>
<p>Use Flex to interface with Javascript to change the SWF Object as needed based on events being listened to inside that same SWF Object.  See <a href="http://reynacho.com/2008/08/12/flex-calls-to-javascript/">http://reynacho.com/2008/08/12/flex-calls-to-javascript/</a> for a tutorial on how to get Flex to call javascript functions.</p>
<p>Read on for the code and example&#8230;<br />
<span id="more-98"></span><br />
I went ahead and modified the index.template.html file inside my html-template directory in the Flex project.  By the way see <a href="http://reynacho.com/2008/08/12/flex-modify-your-default-build-template/">http://reynacho.com/2008/08/12/flex-modify-your-default-build-template/</a> for an idea of how to modify your default build template if you need (and you will need to for this).</p>
<p>First, add wmode=&#8221;transparent&#8221; (see the link above because that&#8217;s the example I use there).<br />
Next, make whatever modification you&#8217;d like to make javascript functions available (I added them to the end of the index.template.html file right before the </body></html> tags:</p>
<p><code>&lt;script language="Javascript"&gt;<br />
	function changeHeight(newHeight) {<br />
		var flashObj = document.getElementById('MenuTest');<br />
		//alert(flashObj.height);<br />
		flashObj.height = newHeight;<br />
		//alert(flashObj.height);<br />
		return flashObj.height;<br />
	}<br />
	function menuClick(menuLabel) {<br />
		alert("You clicked " + menuLabel);<br />
	}<br />
&lt;/script&gt;</code></p>
<p>Next I modified the AC_OETags.js file to print out the SWF Object inside a div with some styling that is necessary.  This is in the AC_Generateobj() function at approximately line 162 in that file:</p>
<p><code>function AC_Generateobj(objAttrs, params, embedAttrs)<br />
{<br />
    var str = '';<br />
    <strong>str += '&lt;div id="f-new" style="position:absolute;z-index:9999;left:0px;top:0px;"&gt;\n';</strong><br />
    if (isIE &amp;&amp; isWin &amp;&amp; !isOpera)<br />
    {<br />
  		str += '&lt;object ';<br />
  		for (var i in objAttrs)<br />
  			str += i + '="' + objAttrs[i] + '" ';<br />
  		str += '&gt;';<br />
  		for (var i in params)<br />
  			str += '&lt;param name="' + i + '" value="' + params[i] + '" /&gt; ';<br />
  		str += '&lt;/object&gt;';<br />
    } else {<br />
  		str += '&lt;embed ';<br />
  		for (var i in embedAttrs)<br />
  			str += i + '="' + embedAttrs[i] + '" ';<br />
  		str += '&gt; &lt;/embed&gt;';<br />
    }<br />
   <strong> str += '&lt;/div&gt;';</strong><br />
    document.write(str);<br />
}</code></p>
<p>Finally, I created the menubar with event listeners to manage calls to the javascript functions.  Here is the example:</p>
<p><a target="_blank" href="http://reynacho.com/dev/MenuTest/bin/MenuTest.html">http://reynacho.com/dev/MenuTest/bin/MenuTest.html</a></p>
<p>(Right click on the menubar to view the Flex source)</p>
]]></content:encoded>
			<wfw:commentRss>http://reynacho.com/2008/08/12/flex-menu-expanding-over-html-content/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flex - Modify your default build template</title>
		<link>http://reynacho.com/2008/08/12/flex-modify-your-default-build-template/</link>
		<comments>http://reynacho.com/2008/08/12/flex-modify-your-default-build-template/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 18:17:59 +0000</pubDate>
		<dc:creator>Jake Churchill</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://reynacho.com/?p=103</guid>
		<description><![CDATA[Modifying your default build template is quite simple.  There is a template file that is used when building your project.  It should reside in the html-template directory at the root of your project in Flex Builder.  In Flex Builder 3, the template is named &#8220;index.template.html&#8221;.
Let&#8217;s say you want to modify default parameters [...]]]></description>
			<content:encoded><![CDATA[<p>Modifying your default build template is quite simple.  There is a template file that is used when building your project.  It should reside in the html-template directory at the root of your project in Flex Builder.  In Flex Builder 3, the template is named &#8220;index.template.html&#8221;.</p>
<p>Let&#8217;s say you want to modify default parameters in the flash object (one I use is wmode=&#8221;transparent&#8221; for flex widgets).  You would add this to the AC_FL_RunContent() function call (around line 80) and to the noscript block (around line 101).  95% of people hitting the page will hit the AC_FL_RunContent() call so here&#8217;s an example of how to modify that:</p>
<p><span id="more-103"></span></p>
<p><strong>Original:</strong></p>
<p><code>AC_FL_RunContent(<br />
	"src", "${swf}",<br />
	"width", "${width}",<br />
	"height", "${height}",<br />
	"align", "middle",<br />
	"id", "${application}",<br />
	"quality", "high",<br />
	"bgcolor", "${bgcolor}",<br />
	"name", "${application}",<br />
	"allowScriptAccess","sameDomain",<br />
	"type", "application/x-shockwave-flash",<br />
	"pluginspage", "http://www.adobe.com/go/getflashplayer",<br />
);</code></p>
<p><strong>Modified:</strong></p>
<p><code>AC_FL_RunContent(<br />
	"src", "${swf}",<br />
	"width", "${width}",<br />
	"height", "${height}",<br />
	"align", "middle",<br />
	"id", "${application}",<br />
	"quality", "high",<br />
	"bgcolor", "${bgcolor}",<br />
	"name", "${application}",<br />
	"allowScriptAccess","sameDomain",<br />
	"type", "application/x-shockwave-flash",<br />
	"pluginspage", "http://www.adobe.com/go/getflashplayer",<br />
	<strong>"wmode", "transparent"</strong><br />
);</code></p>
]]></content:encoded>
			<wfw:commentRss>http://reynacho.com/2008/08/12/flex-modify-your-default-build-template/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flex calls to Javascript</title>
		<link>http://reynacho.com/2008/08/12/flex-calls-to-javascript/</link>
		<comments>http://reynacho.com/2008/08/12/flex-calls-to-javascript/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 18:10:57 +0000</pubDate>
		<dc:creator>Jake Churchill</dc:creator>
		
		<category><![CDATA[Flex]]></category>

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

		<guid isPermaLink="false">http://reynacho.com/?p=100</guid>
		<description><![CDATA[Flex is great!  Javascript can be great!  What if two great things got together?
This is a simple code hint which shows how to call javascript functions from Flex and pass data back and forth:
MXML Button:
&#60;mx:Button
	id		=	"button"
	label	=	"Click Me!"
	click	=	"handleButtonClick(event:MouseEvent)
	/&#62;
Flex Function:
private function handleButtonClick(event:MouseEvent):void
{
	var functionName:String = "handleButtonClick";
        var returnData:String = ExternalInterface.call(f, [...]]]></description>
			<content:encoded><![CDATA[<p>Flex is great!  Javascript can be great!  What if two great things got together?</p>
<p>This is a simple code hint which shows how to call javascript functions from Flex and pass data back and forth:</p>
<p><strong>MXML Button:</strong></p>
<p><code>&lt;mx:Button<br />
	id		=	"button"<br />
	label	=	"Click Me!"<br />
	click	=	"handleButtonClick(event:MouseEvent)<br />
	/&gt;</code></p>
<p><strong>Flex Function:</strong></p>
<p><code>private function handleButtonClick(event:MouseEvent):void<br />
{<br />
	var functionName:String = "handleButtonClick";<br />
        var returnData:String = ExternalInterface.call(f, "You clicked the button!");<br />
}</code></p>
<p><strong>Javascript Function:</strong></p>
<p><code>function handleButtonClick(message)<br />
{<br />
	alert(message);<br />
}</code></p>
<p>That&#8217;s really all there is to it.  the ExternalInterface.call() handles everything for you.</p>
<p>By the way, if you wanted to actually return data from the javascript function, you&#8217;d just do a standard return and it&#8217;d be available in the returnData variable in Flex:</p>
<p><code>function handleButtonClick(message)<br />
{<br />
	alert(message);<br />
	<strong>return "success";</strong><br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://reynacho.com/2008/08/12/flex-calls-to-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Custom Object Parsing Function</title>
		<link>http://reynacho.com/2008/08/08/custom-object-parsing-function/</link>
		<comments>http://reynacho.com/2008/08/08/custom-object-parsing-function/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 16:16:59 +0000</pubDate>
		<dc:creator>Jake Churchill</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://reynacho.com/?p=85</guid>
		<description><![CDATA[I have been doing some work with AIR and SQLite recently and came across and issue that had to be solved.  The issue was that most everything is a VARCHAR in SQLite and I was not able to insert apostrophes (&#8217;) into any string field because that is the string delimiter.  
A quick [...]]]></description>
			<content:encoded><![CDATA[<p>I have been doing some work with AIR and SQLite recently and came across and issue that had to be solved.  The issue was that most everything is a VARCHAR in SQLite and I was not able to insert apostrophes (&#8217;) into any string field because that is the string delimiter.  </p>
<p>A quick Google search revealed that escaping an apostrophe is as simple as putting two of them together (i.e. &#8220;Jake&#8217;s Blog&#8221; becomes &#8220;Jake&#8217;&#8217;s Blog&#8221;).  Quotation marks remain the same.</p>
<p>Now that I knew what the solution was, I had to implement it.  I had about 10 custom VO objects, all with different numbers and kinds of properties.  I needed a way to dig into each of them and do a quick string replace on String properties only.<br />
<span id="more-85"></span><br />
I was able to make use of flash.utils.describeType and XML/XMLList to make this happen.  Here&#8217;s the function:</p>
<p><code>public function escapeStrings( value:Object ):Object<br />
{<br />
    // get object details<br />
    var objectDescription:XML = flash.utils.describeType(value);<br />
    // get object properties as XMLList<br />
    var objectProperties:XMLList = new XMLList(objectDescription.accessor);<br />
    // create a new object to store modified data in<br />
    var newVal:Object = new Object();<br />
    //<br />
    // loop over all properties<br />
    for( var x:uint = 0; x &lt; objectProperties.length(); x++ )<br />
    {<br />
        // if the property is a string, escape single ticks<br />
        if( objectDescription.accessor[x].@type == "String" )<br />
        {<br />
            newVal[objectDescription.accessor[x].@name] = String(value[objectDescription.accessor[x].@name]).replace('\",'\'\");<br />
        }<br />
        // otherwise just grab the value of the property as it is<br />
        else<br />
        {<br />
        newVal[objectDescription.accessor[x].@name] = value[objectDescription.accessor[x].@name];<br />
        }<br />
    }<br />
    // return new value<br />
    return newVal;<br />
}</code></p>
<p>Basically, grab the XML returned from flash.utils.describeType and then create an XMLList of the accessors (properties).  From there it&#8217;s a simple loop over that XMLList and a string replace.  </p>
<p>WAIT!  This is returning an Object, what happened to my custom Class?</p>
<p>That is one thing that I felt was not worth the time in the scope of this project to actually return the correct data type.  Here is a quick way around this&#8230;</p>
<p><code>var myVO:PositionVO = new PositionVO( "W", "Waiter", null );<br />
var o:Object = escapeStrings( myVO );<br />
myVO = new PositionVO( o.abbreviation, o.label, o.positionVO );</code></p>
<p>Finally, here&#8217;s what the class looks like if you didn&#8217;t have an idea from the code above:</p>
<p><code>package test<br />
{<br />
    [Bindable]<br />
    public class PositionVO<br />
    {<br />
        public var abbreviation:String;<br />
        public var label:String;<br />
        public var positionID:String;<br />
        // constructor<br />
        public function PositionVO ( abbreviation:String,label:String,positionID:String)<br />
        {<br />
            this.abbreviation	=	abbreviation;<br />
            this.label		= 	label;<br />
            this.positionID 	=	positionID;<br />
        }<br />
    }<br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://reynacho.com/2008/08/08/custom-object-parsing-function/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
