<?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>Douglas on Web Applications</title>
	<atom:link href="http://globalwebapplications.com/gwab/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://globalwebapplications.com/gwab</link>
	<description>Douglas Gintz discusses on web application development</description>
	<pubDate>Mon, 23 Aug 2010 04:08:09 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Better Rollover with CSS &#038; jQuery</title>
		<link>http://globalwebapplications.com/gwab/?p=283</link>
		<comments>http://globalwebapplications.com/gwab/?p=283#comments</comments>
		<pubDate>Mon, 23 Aug 2010 04:07:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[JQuery Snippets]]></category>

		<category><![CDATA[JavaScript Snippets]]></category>

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

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

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

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

		<guid isPermaLink="false">http://globalwebapplications.com/gwab/?p=283</guid>
		<description><![CDATA[My third pass at a rollover and my favorite solution by far. This one uses minimal code, avoids flickering while also decreasing load times.
Basically create each image or button with active and over states next to one another. For for our example, side by side. We apply the image as a background, defining the width [...]]]></description>
			<content:encoded><![CDATA[<p>My third pass at a rollover and my favorite solution by far. This one uses minimal code, avoids flickering while also decreasing load times.</p>
<p>Basically create each image or button with active and over states next to one another. For for our example, side by side. We apply the image as a background, defining the width of the space as half our image (so only the active state shows). Then when the use hovers, we reposition the background to show the active state only.</p>
<pre class="javascript">&nbsp;
  $<span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;#teasers div&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">hover</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	  $<span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">css</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'background-position'</span>, <span style="color: #3366CC;">'top right'</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	  $<span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">css</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'background-position'</span>, <span style="color: #3366CC;">'top left'</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://globalwebapplications.com/gwab/?feed=rss2&amp;p=283</wfw:commentRss>
		</item>
		<item>
		<title>Hide &#038; Show Fileds and Labels in EXTJS 3.01</title>
		<link>http://globalwebapplications.com/gwab/?p=275</link>
		<comments>http://globalwebapplications.com/gwab/?p=275#comments</comments>
		<pubDate>Thu, 13 May 2010 01:58:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Developing with EXTJS]]></category>

		<category><![CDATA[extjs 3.01]]></category>

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

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

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

		<guid isPermaLink="false">http://globalwebapplications.com/gwab/?p=275</guid>
		<description><![CDATA[Code to hide and show both a field and label whenever a checkbox is select. Note as of 3.01 just hidden a field will cause its label to be hidden as well.
Before form rendering code add:

xtype:'checkbox',
fieldLabel: '',
labelSeparator: '',
boxLabel: 'Use an existing GCC as a template',
name: 'use-existing-gcc',
id: 'use-existing-gcc',
  onClick:function(el) {
	  if(this.getValue()==true) Ext.getCmp('field-to-toggle').show();
	  else [...]]]></description>
			<content:encoded><![CDATA[<p>Code to hide and show both a field and label whenever a checkbox is select. Note as of 3.01 just hidden a field will cause its label to be hidden as well.</p>
<p>Before form rendering code add:</p>
<pre lang=javascript">
Ext.layout.FormLayout.prototype.trackLabels = true;
</pre>
<p>Checkbox that invokes the action:</p>
<pre lang=javascript">
xtype:'checkbox',
fieldLabel: '',
labelSeparator: '',
boxLabel: 'Use an existing GCC as a template',
name: 'use-existing-gcc',
id: 'use-existing-gcc',
  onClick:function(el) {
	  if(this.getValue()==true) Ext.getCmp('field-to-toggle').show();
	  else Ext.getCmp('field-to-toggle').hide();
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://globalwebapplications.com/gwab/?feed=rss2&amp;p=275</wfw:commentRss>
		</item>
		<item>
		<title>Incredibly Simple Tabs with jQuery</title>
		<link>http://globalwebapplications.com/gwab/?p=269</link>
		<comments>http://globalwebapplications.com/gwab/?p=269#comments</comments>
		<pubDate>Tue, 20 Apr 2010 14:52:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[JQuery Snippets]]></category>

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

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

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

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

		<guid isPermaLink="false">http://globalwebapplications.com/gwab/?p=269</guid>
		<description><![CDATA[Whenever I need inline tabs, I find myself traveling down the same well trod paths. There are dozens of plugins but where they usually fail is in simplifying skinning. Solution:

Create each tab row as a graphic (so all tabs but the selected one in a row would look the same
Add images to page surrounding each [...]]]></description>
			<content:encoded><![CDATA[<p>Whenever I need inline tabs, I find myself traveling down the same well trod paths. There are dozens of plugins but where they usually fail is in simplifying skinning. Solution:</p>
<ol>
<li>Create each tab row as a graphic (so all tabs but the selected one in a row would look the same</li>
<li>Add images to page surrounding each as a DIV</li>
<li>Add a bit of jQuery to hide show appropriate tab &amp; content on click</li>
</ol>
<p>Here's the CSS:</p>
<pre class="css">&nbsp;
&lt;div id=<span style="color: #ff0000;">&quot;tabs&quot;</span>&gt;
&lt;div id=<span style="color: #ff0000;">&quot;speakers&quot;</span>&gt;&lt;img src=<span style="color: #ff0000;">&quot;img/tabs-speakers.gif&quot;</span> <span style="color: #000000; font-weight: bold;">width</span>=<span style="color: #ff0000;">&quot;724&quot;</span> <span style="color: #000000; font-weight: bold;">height</span>=<span style="color: #ff0000;">&quot;41&quot;</span> alt=<span style="color: #ff0000;">&quot;Speakers&quot;</span> /&gt;&lt;/div&gt;
&lt;div id=<span style="color: #ff0000;">&quot;events&quot;</span>&gt;&lt;img src=<span style="color: #ff0000;">&quot;img/tabs-events.gif&quot;</span> <span style="color: #000000; font-weight: bold;">width</span>=<span style="color: #ff0000;">&quot;724&quot;</span> <span style="color: #000000; font-weight: bold;">height</span>=<span style="color: #ff0000;">&quot;41&quot;</span> alt=<span style="color: #ff0000;">&quot;Speakers&quot;</span> /&gt;&lt;/div&gt;
&lt;div id=<span style="color: #ff0000;">&quot;tabs-content&quot;</span>&gt;
&lt;div id=<span style="color: #ff0000;">&quot;speakers-content&quot;</span> class=<span style="color: #ff0000;">&quot;tab-content&quot;</span>&gt;
&nbsp;
Content for speakers
&lt;/div&gt;
&lt;div id=<span style="color: #ff0000;">&quot;events-content&quot;</span> class=<span style="color: #ff0000;">&quot;tab-content&quot;</span>&gt;
&nbsp;
Content for events
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&nbsp;</pre>
<p>Next, add the javascript:</p>
<pre class="javascript"><span style="color: #003366; font-weight: bold;">var</span> tabArray=<span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;speakers&quot;</span>,<span style="color: #3366CC;">&quot;events&quot;</span><span style="color: #66cc66;">&#41;</span>;
$<span style="color: #66cc66;">&#40;</span>document<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">ready</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
   $<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'#events'</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">hide</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
   $<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'#events-content'</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">hide</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
   $<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'#tabs'</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">click</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	   $.<span style="color: #006600;">each</span><span style="color: #66cc66;">&#40;</span>tabArray, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>index, value<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		   $<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'#'</span>+value<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">toggle</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		   $<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'#'</span>+value+<span style="color: #3366CC;">'-content'</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">toggle</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	   <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
   <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</pre>
]]></content:encoded>
			<wfw:commentRss>http://globalwebapplications.com/gwab/?feed=rss2&amp;p=269</wfw:commentRss>
		</item>
		<item>
		<title>Passing Arrays to PHP via AJAX</title>
		<link>http://globalwebapplications.com/gwab/?p=262</link>
		<comments>http://globalwebapplications.com/gwab/?p=262#comments</comments>
		<pubDate>Sun, 04 Apr 2010 19:54:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Developing with EXTJS]]></category>

		<category><![CDATA[JQuery Snippets]]></category>

		<category><![CDATA[JavaScript Snippets]]></category>

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

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

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

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

		<guid isPermaLink="false">http://globalwebapplications.com/gwab/?p=262</guid>
		<description><![CDATA[I've written on processing AJAX queries before but neglected discussing how to pass an array to PHP for processing. This is an example of getting all checked rows in an EXTJS grid and posting them to an awaiting PHP script.
First we have the users confirm they really want to process all checked records:
&#160;
Ext.MessageBox.confirm&#40;'Confirm', 'Are you [...]]]></description>
			<content:encoded><![CDATA[<p>I've written on processing AJAX queries before but neglected discussing how to pass an array to PHP for processing. This is an example of getting all checked rows in an EXTJS grid and posting them to an awaiting PHP script.</p>
<p>First we have the users confirm they really want to process all checked records:</p>
<pre class="javascript">&nbsp;
Ext.<span style="color: #006600;">MessageBox</span>.<span style="color: #000066;">confirm</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'Confirm'</span>, <span style="color: #3366CC;">'Are you sure your want to email login info to all selected users?'</span>, confirmEmailUsers<span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>Now the jQuery method:</p>
<pre class="javascript">&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> confirmEmailUsers<span style="color: #66cc66;">&#40;</span>btn<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
   <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>btn==<span style="color: #3366CC;">'yes'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
	   <span style="color: #003366; font-weight: bold;">var</span> recArray=<span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	   <span style="color: #003366; font-weight: bold;">var</span> ids=<span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	   <span style="color: #003366; font-weight: bold;">var</span> recArray = mailqueueGrid.<span style="color: #006600;">getSelectionModel</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">getSelections</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	   <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i = <span style="color: #CC0000;">0</span> ; i &lt; recArray.<span style="color: #006600;">length</span> ;i++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		  ids<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span> = recArray<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">get</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'id'</span><span style="color: #66cc66;">&#41;</span>;
	   <span style="color: #66cc66;">&#125;</span>
	  $.<span style="color: #006600;">ajax</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>
		type: <span style="color: #3366CC;">&quot;POST&quot;</span>,
		dataType: <span style="color: #3366CC;">'json'</span>,
		url: <span style="color: #3366CC;">'/cpsia/?c=form&amp;m=processqueue'</span>,
		data: <span style="color: #3366CC;">'ids='</span>+ids,
		success: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>msg<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #000066;">alert</span><span style="color: #66cc66;">&#40;</span>msg<span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#125;</span>
	  <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
   <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
<p>Finally, the PHP script to processes it:</p>
<pre class="javascript">&nbsp;
$ids = explode<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;,&quot;</span>,$_POST<span style="color: #66cc66;">&#91;</span><span style="color: #3366CC;">'ids'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
foreach <span style="color: #66cc66;">&#40;</span>$ids <span style="color: #000066; font-weight: bold;">as</span> $id<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
   echo $id .<span style="color: #3366CC;">''</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://globalwebapplications.com/gwab/?feed=rss2&amp;p=262</wfw:commentRss>
		</item>
		<item>
		<title>EXTJS 3 Combo in Window Bug Fix</title>
		<link>http://globalwebapplications.com/gwab/?p=259</link>
		<comments>http://globalwebapplications.com/gwab/?p=259#comments</comments>
		<pubDate>Thu, 25 Mar 2010 16:34:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Developing with EXTJS]]></category>

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

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

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

		<category><![CDATA[z-index]]></category>

		<guid isPermaLink="false">http://globalwebapplications.com/gwab/?p=259</guid>
		<description><![CDATA[Issue:
Often after closing a window containing a from, upon relaunching the combo boxes do not expand correctly. This is a z-index problem. The simplest solution is to add this CSS to your stylesheet:
&#160;
.x-combo-list&#123;z-index:100000 !important;&#125;
&#160;
]]></description>
			<content:encoded><![CDATA[<p>Issue:<br />
Often after closing a window containing a from, upon relaunching the combo boxes do not expand correctly. This is a z-index problem. The simplest solution is to add this CSS to your stylesheet:</p>
<pre class="css">&nbsp;
<span style="color: #6666ff;">.x-combo-list</span><span style="color: #66cc66;">&#123;</span>z-index<span style="color: #3333ff;">:<span style="color: #933;">100000</span></span> !important;<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://globalwebapplications.com/gwab/?feed=rss2&amp;p=259</wfw:commentRss>
		</item>
		<item>
		<title>Read XML Files from Directory &#038; Process</title>
		<link>http://globalwebapplications.com/gwab/?p=251</link>
		<comments>http://globalwebapplications.com/gwab/?p=251#comments</comments>
		<pubDate>Wed, 17 Mar 2010 03:49:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[PHP Snippets]]></category>

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

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

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

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

		<guid isPermaLink="false">http://globalwebapplications.com/gwab/?p=251</guid>
		<description><![CDATA[Read files in a directory. Ignore hidden files. Processed XML based on first couple characters of file name.
&#160;
$xmlDirectory = opendir&#40;$this-&#62;xml_dir&#41;;
while&#40;$entryName = readdir&#40;$xmlDirectory&#41;&#41; &#123;
	$dirArray&#91;&#93; = $entryName;
&#125;
closedir&#40;$xmlDirectory&#41;;
&#160;
$indexCount	= count&#40;$dirArray&#41;;
//Print (&#34;$indexCount files&#60;br&#62;\n&#34;);
sort&#40;$dirArray&#41;;
for&#40;$index=0; $index &#60; $indexCount; $index++&#41; &#123;
	if &#40;substr&#40;&#34;$dirArray[$index]&#34;, 0, 1&#41; != &#34;.&#34;&#41;&#123; // don't list hidden files
		if&#40;substr&#40;&#34;$dirArray[$index]&#34;, 0, 4&#41;=='some'&#41;&#123;
			$this-&#62;somefiletype_path= $this-&#62;xml_dir.$dirArray&#91;$index&#93;;
			$this-&#62;doSomething&#40;&#41;;
		&#125;else&#123;
			//do something else
		&#125;
	&#125;
&#125;
&#160;
]]></description>
			<content:encoded><![CDATA[<p>Read files in a directory. Ignore hidden files. Processed XML based on first couple characters of file name.</p>
<pre class="javascript">&nbsp;
$xmlDirectory = opendir<span style="color: #66cc66;">&#40;</span>$this-&gt;xml_dir<span style="color: #66cc66;">&#41;</span>;
<span style="color: #000066; font-weight: bold;">while</span><span style="color: #66cc66;">&#40;</span>$entryName = readdir<span style="color: #66cc66;">&#40;</span>$xmlDirectory<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	$dirArray<span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> = $entryName;
<span style="color: #66cc66;">&#125;</span>
closedir<span style="color: #66cc66;">&#40;</span>$xmlDirectory<span style="color: #66cc66;">&#41;</span>;
&nbsp;
$indexCount	= count<span style="color: #66cc66;">&#40;</span>$dirArray<span style="color: #66cc66;">&#41;</span>;
<span style="color: #009900; font-style: italic;">//Print (&quot;$indexCount files&lt;br&gt;\n&quot;);</span>
sort<span style="color: #66cc66;">&#40;</span>$dirArray<span style="color: #66cc66;">&#41;</span>;
<span style="color: #000066; font-weight: bold;">for</span><span style="color: #66cc66;">&#40;</span>$index=<span style="color: #CC0000;">0</span>; $index &lt; $indexCount; $index++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>substr<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;$dirArray[$index]&quot;</span>, <span style="color: #CC0000;">0</span>, <span style="color: #CC0000;">1</span><span style="color: #66cc66;">&#41;</span> != <span style="color: #3366CC;">&quot;.&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span> <span style="color: #009900; font-style: italic;">// don't list hidden files</span>
		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>substr<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;$dirArray[$index]&quot;</span>, <span style="color: #CC0000;">0</span>, <span style="color: #CC0000;">4</span><span style="color: #66cc66;">&#41;</span>==<span style="color: #3366CC;">'some'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
			$this-&gt;somefiletype_path= $this-&gt;xml_dir.$dirArray<span style="color: #66cc66;">&#91;</span>$index<span style="color: #66cc66;">&#93;</span>;
			$this-&gt;doSomething<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #009900; font-style: italic;">//do something else</span>
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://globalwebapplications.com/gwab/?feed=rss2&amp;p=251</wfw:commentRss>
		</item>
		<item>
		<title>Convert String to MovieClip in Flash AS3</title>
		<link>http://globalwebapplications.com/gwab/?p=249</link>
		<comments>http://globalwebapplications.com/gwab/?p=249#comments</comments>
		<pubDate>Tue, 16 Mar 2010 23:23:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[ActionScript 3]]></category>

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

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

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

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

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

		<guid isPermaLink="false">http://globalwebapplications.com/gwab/?p=249</guid>
		<description><![CDATA[Pretty straightforward:
&#160;
function doClick&#40;e:Event&#41;:void &#123;
    this&#91;e.target.name&#93;.gotoAndStop&#40;'over'&#41;
&#125;
&#160;
Of course, in the case above you could actually just use:
&#160;
e.currentTarget.gotoAndStop&#40;'over'&#41;
&#160;
]]></description>
			<content:encoded><![CDATA[<p>Pretty straightforward:</p>
<pre class="javascript">&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> doClick<span style="color: #66cc66;">&#40;</span>e:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #000066; font-weight: bold;">void</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">this</span><span style="color: #66cc66;">&#91;</span>e.<span style="color: #006600;">target</span>.<span style="color: #000066;">name</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'over'</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
<p>Of course, in the case above you could actually just use:</p>
<pre class="javascript">&nbsp;
e.<span style="color: #006600;">currentTarget</span>.<span style="color: #006600;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'over'</span><span style="color: #66cc66;">&#41;</span>
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://globalwebapplications.com/gwab/?feed=rss2&amp;p=249</wfw:commentRss>
		</item>
		<item>
		<title>AS3 MovieClip Arrays &#038; Loops</title>
		<link>http://globalwebapplications.com/gwab/?p=246</link>
		<comments>http://globalwebapplications.com/gwab/?p=246#comments</comments>
		<pubDate>Tue, 16 Mar 2010 20:24:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[ActionScript 3]]></category>

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

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

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

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

		<guid isPermaLink="false">http://globalwebapplications.com/gwab/?p=246</guid>
		<description><![CDATA[I'm often tasked with applying the same listeners &#038; properties to multiple MovieClips in Flash. The easiest is to store the MovieClips in an array:
&#160;
var navButtons=&#91;navCompanyMC,navNewsMC...&#93;;
&#160;
Then you can simply iterate over them:
&#160;
var i=1;
for &#40;i in navButtons&#41; &#123;
  doSomethingToClip&#40;navButtons&#91;i&#93;&#41;;
&#125;
&#160;
Sample usage:
&#160;
public function doBuild&#40;&#41;:void &#123;
  var navButtons=&#91;navCompanyMC,navNewsMC...&#93;;
  var i=1;
  for &#40;i in navButtons&#41; &#123;
 [...]]]></description>
			<content:encoded><![CDATA[<p>I'm often tasked with applying the same listeners & properties to multiple MovieClips in Flash. The easiest is to store the MovieClips in an array:</p>
<pre class="javascript">&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> navButtons=<span style="color: #66cc66;">&#91;</span>navCompanyMC,navNewsMC...<span style="color: #66cc66;">&#93;</span>;
&nbsp;</pre>
<p>Then you can simply iterate over them:</p>
<pre class="javascript">&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> i=<span style="color: #CC0000;">1</span>;
<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #66cc66;">&#40;</span>i <span style="color: #000066; font-weight: bold;">in</span> navButtons<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
  doSomethingToClip<span style="color: #66cc66;">&#40;</span>navButtons<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
<p>Sample usage:</p>
<pre class="javascript">&nbsp;
<span style="color: #003366; font-weight: bold;">public</span> <span style="color: #003366; font-weight: bold;">function</span> doBuild<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #000066; font-weight: bold;">void</span> <span style="color: #66cc66;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> navButtons=<span style="color: #66cc66;">&#91;</span>navCompanyMC,navNewsMC...<span style="color: #66cc66;">&#93;</span>;
  <span style="color: #003366; font-weight: bold;">var</span> i=<span style="color: #CC0000;">1</span>;
  <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #66cc66;">&#40;</span>i <span style="color: #000066; font-weight: bold;">in</span> navButtons<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    registerEachButton<span style="color: #66cc66;">&#40;</span>navButtons<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> registerEachButton<span style="color: #66cc66;">&#40;</span>clip:MovieClip<span style="color: #66cc66;">&#41;</span>:<span style="color: #000066; font-weight: bold;">void</span> <span style="color: #66cc66;">&#123;</span>
  clip.<span style="color: #006600;">buttonMode</span>=<span style="color: #003366; font-weight: bold;">true</span>;
  EventManager.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>clip,MouseEvent.<span style="color: #006600;">MOUSE_OVER</span>,doRollOver,<span style="color: #003366; font-weight: bold;">false</span>,<span style="color: #CC0000;">0</span>,<span style="color: #003366; font-weight: bold;">true</span>,<span style="color: #003366; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
  EventManager.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>clip,MouseEvent.<span style="color: #006600;">MOUSE_OUT</span>,doRollOut,<span style="color: #003366; font-weight: bold;">false</span>,<span style="color: #CC0000;">0</span>,<span style="color: #003366; font-weight: bold;">true</span>,<span style="color: #003366; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
  EventManager.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>clip,MouseEvent.<span style="color: #006600;">CLICK</span>,doClick,<span style="color: #003366; font-weight: bold;">false</span>,<span style="color: #CC0000;">0</span>,<span style="color: #003366; font-weight: bold;">true</span>,<span style="color: #003366; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> doRollOver<span style="color: #66cc66;">&#40;</span>e:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #000066; font-weight: bold;">void</span> <span style="color: #66cc66;">&#123;</span>
  <span style="color: #009900; font-style: italic;">//trace(e.target.name)</span>
  e.<span style="color: #006600;">currentTarget</span>.<span style="color: #006600;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'over'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> doRollOut<span style="color: #66cc66;">&#40;</span>e:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #000066; font-weight: bold;">void</span> <span style="color: #66cc66;">&#123;</span>
  trace<span style="color: #66cc66;">&#40;</span>e.<span style="color: #006600;">target</span>.<span style="color: #000066;">name</span><span style="color: #66cc66;">&#41;</span>;
  e.<span style="color: #006600;">currentTarget</span>.<span style="color: #006600;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> doClick<span style="color: #66cc66;">&#40;</span>e:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #000066; font-weight: bold;">void</span> <span style="color: #66cc66;">&#123;</span>
  trace<span style="color: #66cc66;">&#40;</span>e.<span style="color: #006600;">target</span>.<span style="color: #000066;">name</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://globalwebapplications.com/gwab/?feed=rss2&amp;p=246</wfw:commentRss>
		</item>
		<item>
		<title>Cron Jobs in Linux through SSH</title>
		<link>http://globalwebapplications.com/gwab/?p=244</link>
		<comments>http://globalwebapplications.com/gwab/?p=244#comments</comments>
		<pubDate>Thu, 11 Mar 2010 21:17:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[cron job]]></category>

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

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

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

		<guid isPermaLink="false">http://globalwebapplications.com/gwab/?p=244</guid>
		<description><![CDATA[Moving to Mac means finally losing PUTTY for the native Terminal. 
1. Login:
&#160;
ssh myuser@mydomain.com
&#160;
2. Edit crontab:
&#160;
crontab -e
&#160;
3. Add 1 or more cron jobs:
&#160;
10 */2 * * * /var/www/html/somedir/?c=import
10 */14 * * * /var/www/html/somedir/?c=import
&#160;
4. Save: Use keystrokes ctrl + e
5. Type "y" to accept changes
6. Ignore next screen and just click Enter
7. Check to see if [...]]]></description>
			<content:encoded><![CDATA[<p>Moving to Mac means finally losing PUTTY for the native Terminal. </p>
<p>1. Login:</p>
<pre class="javascript">&nbsp;
ssh myuser@mydomain.<span style="color: #006600;">com</span>
&nbsp;</pre>
<p>2. Edit crontab:</p>
<pre class="javascript">&nbsp;
crontab -e
&nbsp;</pre>
<p>3. Add 1 or more cron jobs:</p>
<pre class="javascript">&nbsp;
<span style="color: #CC0000;">10</span> *<span style="color: #0066FF;">/<span style="color: #CC0000;">2</span> * * * /<span style="color: #003366; font-weight: bold;">var</span>/www/html/somedir/</span>?c=<span style="color: #003366; font-weight: bold;">import</span>
<span style="color: #CC0000;">10</span> *<span style="color: #0066FF;">/<span style="color: #CC0000;">14</span> * * * /<span style="color: #003366; font-weight: bold;">var</span>/www/html/somedir/</span>?c=<span style="color: #003366; font-weight: bold;">import</span>
&nbsp;</pre>
<p>4. Save: Use keystrokes ctrl + e<br />
5. Type "y" to accept changes<br />
6. Ignore next screen and just click Enter<br />
7. Check to see if new job is listed:</p>
<pre class="javascript">&nbsp;
crontab -l
&nbsp;</pre>
<p>Here's a quick format reference:<br />
at that interval.<br />
* * * * * command to be executed<br />
- - - - -<br />
| | | | |<br />
| | | | +----- day of week (0 - 6) (Sunday=0)<br />
| | | +------- month (1 - 12)<br />
| | +--------- day of month (1 - 31)<br />
| +----------- hour (0 - 23)<br />
+------------- min (0 - 59) </p>
]]></content:encoded>
			<wfw:commentRss>http://globalwebapplications.com/gwab/?feed=rss2&amp;p=244</wfw:commentRss>
		</item>
		<item>
		<title>Flash AS3 - Calling a Method in a Parent Class</title>
		<link>http://globalwebapplications.com/gwab/?p=241</link>
		<comments>http://globalwebapplications.com/gwab/?p=241#comments</comments>
		<pubDate>Thu, 11 Mar 2010 01:28:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[ActionScript 3]]></category>

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

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

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

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

		<guid isPermaLink="false">http://globalwebapplications.com/gwab/?p=241</guid>
		<description><![CDATA[When loading a movie in a movie, here's an easy way to call a method within a parent class:
&#160;
  if&#40;this.parent != null&#41;&#123;
    var parentObject:Object = this.parent as Object;
    parentObject.doShowMain&#40;&#41;
  &#125;
&#160;
]]></description>
			<content:encoded><![CDATA[<p>When loading a movie in a movie, here's an easy way to call a method within a parent class:</p>
<pre class="javascript">&nbsp;
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">parent</span> != <span style="color: #003366; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> parentObject:Object = <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">parent</span> <span style="color: #000066; font-weight: bold;">as</span> Object;
    parentObject.<span style="color: #006600;">doShowMain</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://globalwebapplications.com/gwab/?feed=rss2&amp;p=241</wfw:commentRss>
		</item>
	</channel>
</rss>
