<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>rtraction - London, Ontario - Web Design, Web Development and Strategic Consulting &#187; Jeremy</title>
	<atom:link href="http://www.rtraction.com/blog/author/jeremy/feed" rel="self" type="application/rss+xml" />
	<link>http://www.rtraction.com/blog</link>
	<description>rtraction blog - Web Design, Web Development and Strategic Consulting</description>
	<lastBuildDate>Fri, 25 Nov 2011 15:08:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Flash&#8217;s ScrollPane component</title>
		<link>http://www.rtraction.com/blog/devit/flashs-scrollpane-component.html</link>
		<comments>http://www.rtraction.com/blog/devit/flashs-scrollpane-component.html#comments</comments>
		<pubDate>Mon, 21 Dec 2009 15:55:44 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Devit!]]></category>

		<guid isPermaLink="false">http://www.rtraction.com/blog/?p=1306</guid>
		<description><![CDATA[I&#8217;m not a huge fan of flash components.  I&#8217;ve run into too many instances of incompatibilities between version and components themselves.  However the ScrollPane component is just too useful to pass up.  The thought of having to build my own basic UI components also seems like a waste of time.
This article is being written because [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.rtraction.com/blog/wp-content/uploads/2009/12/scrollpane.gif" rel="lightbox[1306]"><img class="alignright size-full wp-image-1310" title="scrollpane" src="http://www.rtraction.com/blog/wp-content/uploads/2009/12/scrollpane.gif" alt="scrollpane" width="219" height="343" align="right" /></a>I&#8217;m not a huge fan of flash components.  I&#8217;ve run into too many instances of incompatibilities between version and components themselves.  However the ScrollPane component is just too useful to pass up.  The thought of having to build my own basic UI components also seems like a waste of time.</p>
<p>This article is being written because the documentation on this component is not spectacular and can be quite ambiguous to the new actionscript programmer.  I ran into trouble in the methodology of how ScrollPane wants you to work.</p>
<p>Normally the <em>addChild</em> method is used to embed one MovieClip in another.  That was the method I assumed would work for the scrollpane.  However after getting the error <em>&#8220;Error #2006: The supplied index is out of bounds.&#8221;</em> I realized that was not how it worked.</p>
<p>To simplify, use:</p>
<pre>scrollPaneInstance.source = movieClipContainer;</pre>
<p>NOT:</p>
<pre>scrollPaneInstance.addChild(movieClipContainer);</pre>
<p>Due to the fact I&#8217;m not a huge fan of the components that come with Flash I&#8217;m wondering if anyone has found any other ScrollPane type components that are lightweight and open source. <a href="http://blog.greensock.com/tweenlite/">TweenLite</a> is an example of a lightweight alternative to the built in flash library for tweening.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rtraction.com/blog/devit/flashs-scrollpane-component.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Growing Vines in After Effects</title>
		<link>http://www.rtraction.com/blog/designbynumbers/growing-vines-in-after-effects-cs3.html</link>
		<comments>http://www.rtraction.com/blog/designbynumbers/growing-vines-in-after-effects-cs3.html#comments</comments>
		<pubDate>Mon, 08 Jun 2009 13:17:39 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[DesignbyNumbers]]></category>

		<guid isPermaLink="false">http://www.rtraction.com/blog/?p=276</guid>
		<description><![CDATA[Recently we had a project where the design required growing vines, a popular analogy for growth.  I had used masks before to create the grow effect but was never really happy with the results or the lack of flexibility with that method.  I searched the internet and found a number of different ways to do [...]]]></description>
			<content:encoded><![CDATA[<p>Recently we had a project where the design required growing vines, a popular analogy for growth.  I had used masks before to create the grow effect but was never really happy with the results or the lack of flexibility with that method.  I searched the internet and found a number of different ways to do it but still it didn&#8217;t have the look I wanted so I modified one of those techniques to get what I needed. </p>
<p>I&#8217;m using After Effects CS3 in this tutorial.</p>
<p>The most versatile solution I found comes from the stroke effect.  The stroke effect mimics a brush stroke following along a mask path.  You can animate the start and end points as well as the thickness.  This would have worked fine, but I didn&#8217;t like how the stroke maintained the same thickness along the length of the path.  I wanted the think point at the top of the vine, getting thicker as it grew upwards.<span id="more-276"></span></p>
<p>To do this I used the stroke effect multiple times linked with some expressions for simple manipulation.</p>
<ol>
<li>Create a new composition for your vine.</li>
<li>Next create a solid in the dimensions of your composition.</li>
<li>Using the pen tool, draw a mask on your solid.  If you don&#8217;t close your mask its mode should be set to none by default.  Otherwise, right click on your path and select Mask &gt; Mode &gt; None</li>
<li>Apply the stroke effect.  Effects &gt; Generate &gt; Stroke</li>
<li>Increase the size of the brush size on this stroke - it becomes more obvious without having to hide the mask.  Then play with the Start &amp; End options on the effect control to see your vine grow and shrink. So far, it&#8217;s looking good but we don&#8217;t have that point of where the vine starts.  To do that we&#8217;re going to use multiple instances of the stroke effect.</li>
<li>Select the stroke effect you just added and duplicate it a number of times.  The more instances you use, the smoother the gradation from point to full size.  For the purposes of this demonstration we&#8217;ll use 5 instances.</li>
<li>For each instance of the Stroke effect make sure you have your Mask selected in the Path drop down.  I kept the default mask name of Mask 1.</li>
<li>For the top instance only, select On Transparent from the Paint Style drop down.  This ensures we can add any background we want.  Make sure all the other instances are set to &#8220;On Original Image&#8221; otherwise each succeeding instance will overwrite the last.<br />
We don&#8217;t want to have to modify every single effect if we need to modify width or how gradual the point is.  This is where expressions come to help out.  First we need to add the controls that we will use to control the expressions.</p>
<p><a href="http://www.rtraction.com/blog/wp-content/uploads/2009/05/vine-2.gif" rel="lightbox[276]"><img class="aligncenter size-full wp-image-285" title="vine-2" src="http://www.rtraction.com/blog/wp-content/uploads/2009/05/vine-2.gif" alt="vine-2" width="365" height="532" /></a></li>
<li>Add 3 sliders.  Effect &gt;Expression Controls &gt; Slider Control.</li>
<li>Rename these controls to stroke end, stroke offset, stroke width.The stroke end control will control the end point of all instances of the stroke effect.<br />
Stroke offset will control how far apart each instance will be from the next.  This will allow us to modify how gradual the vine goes to a point.<br />
Stroke width will control the overall width of our vine.</p>
<p style="text-align: left;">The basic idea is to use multipliers of the slider control.</p>
<p><img class="aligncenter size-large wp-image-281" title="vine-11" src="http://www.rtraction.com/blog/wp-content/uploads/2009/05/vine-11-650x527.gif" alt="vine-11" width="650" height="527" /></li>
<li> Expand out the effects of your vine solid in our composition timeline.  Expand the first stroke effect so you can see all it&#8217;s properties and then click on &#8220;Brush Size&#8221; to select it.</li>
<li>We need to add an expression to this property.  Use the shortcut ALT + Shift + = or go to the menu Animation &gt; Add Expression.</li>
<li>Use the following expression: effect(&#8220;width&#8221;)(&#8220;Slider&#8221;) * 0.1This is basically saying  get the value of width custom slider we added and multiply it by 0.2.  Using a small decimal number gives us more control with the slider.  If the slider is set to 10 then our width will be 1 (10 * 1).</li>
<li>Repeat steps 12-13 for the remaining stroke effect instances.  However increase the multiplier as you go.  For example stroke effect 2 would be effect(&#8220;width&#8221;)(&#8220;Slider&#8221;) * 0.2.</li>
<li>Go back to our first stroke effect and select the property &#8220;End&#8221;.  Add an expression using ALT + Shift + =.</li>
<li>Add the following expression: effect(&#8220;end&#8221;)(&#8220;Slider&#8221;) - (effect(&#8220;offset&#8221;)(&#8220;Slider&#8221;) * 0.1)What we&#8217;re saying is to subtract our multiplier (0.1) from the end custom slider.  This will make each successive stroke be slightly less than our end custom slider.  In order to adjust the amount of the multiplier we muliply that by our offset custom slider.  That will uniformly increase or decrease that value.<a href="http://www.rtraction.com/blog/wp-content/uploads/2009/05/vine-3.gif" rel="lightbox[276]"><img class="aligncenter size-large wp-image-283" title="vine-3" src="http://www.rtraction.com/blog/wp-content/uploads/2009/05/vine-3-650x221.gif" alt="vine-3" width="650" height="221" /></a></li>
<li>Repeat this for each successive stroke effect, incrementing the multipler (0.2, 0.3, 0.4, etc&#8230;)</li>
<li>Take a moment to play with our custom sliders to see the effect.</li>
<li>Now we can animate our vine by using the &#8220;end custom slider&#8221;.<a href="http://www.rtraction.com/blog/wp-content/uploads/2009/05/vine-4.gif" rel="lightbox[276]"><img class="aligncenter size-large wp-image-282" title="vine-4" src="http://www.rtraction.com/blog/wp-content/uploads/2009/05/vine-4-650x479.gif" alt="vine-4" width="650" height="479" /></a></li>
</ol>
<p>You can tell right away would should probably add more instances of our stroke effect to achieve a smoother transition.  With the way the expressions are set up you should be able to add more instances without having to reanimate.  Just add extra instances with appropriate multipliers (you may have noticed that I setup the multiplier to be a tenth of the instance number. eg. instance 1 was 0.1)</p>
<p>Have fun animating your new vine.</p>
<p>Checkout the finished video below - vine effect starts at about 30 seconds.</p>
<p><span class="youtube">
<iframe title="YouTube video player" class="youtube-player" type="text/html" width="425" height="344" src="http://www.youtube.com/embed/ib0VH9TxLJo?color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;loop=&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0&amp;rel=1" frameborder="0"></iframe>
</span><p><a href="http://www.youtube.com/watch?v=ib0VH9TxLJo">www.youtube.com/watch?v=ib0VH9TxLJo</a></p></p>
<p><strong>About the author</strong><br />
<img class="size-full wp-image-318" title="Jeremy" src="http://www.rtraction.com/blog/wp-content/uploads/2009/06/jeremy.gif" alt="Jeremy" hspace="10" vspace="8" width="45" height="60" align="left" /><span style="font-size: 11px; padding-top: 5px; display: block;" title="Jeremy"><a href="http://www.rtraction.com/about-us/team-bios.htm#jeremy">Jeremy</a> describes his favourite work moment with rtraction as the time the weekly team meetings were renamed to &#8220;Cake&#8221; to help improve morale. The initial &#8220;cake&#8221; was a resounding success with three employees contributing unsolicited desserts. Jeremy has a love hate relationship with computers , and in contemplative moments he has been known to muse on the fact that his life&#8217;s work is in reality a long string of 1&#8217;s and 0&#8217;s.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rtraction.com/blog/designbynumbers/growing-vines-in-after-effects-cs3.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>10 Essential Drupal modules</title>
		<link>http://www.rtraction.com/blog/devit/10-essential-drupal-modules.html</link>
		<comments>http://www.rtraction.com/blog/devit/10-essential-drupal-modules.html#comments</comments>
		<pubDate>Mon, 23 Mar 2009 20:44:50 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Devit!]]></category>

		<guid isPermaLink="false">http://www.rtraction.com/blog/?p=177</guid>
		<description><![CDATA[It has taken some time to find the Drupal modules that really work well for us.  Drupal.org can be a little hard to navigate for newcomers, making it hard to decipher what&#8217;s really important.  It would be great if Drupal would publish a most downloaded module list.
In that light, we thought we would post a [...]]]></description>
			<content:encoded><![CDATA[<p>It has taken some time to find the Drupal modules that really work well for us.  <a href="http://drupal.org/">Drupal.org</a> can be a little hard to navigate for newcomers, making it hard to decipher what&#8217;s really important.  It would be great if Drupal would publish a most downloaded module list.</p>
<p>In that light, we thought we would post a list of the 10 Drupal modules we use on pretty much every project.  These work best for our web clients and we think they are essential to any Drupal install. (NOTE: this refers to Drupal 6.x modules)</p>
<ol>
<li><a href="http://drupal.org/project/pathauto" target="_blank"><strong>Pathauto</strong> </a>- Having custom URLs is essential to ease of use from the clients point of view.  Even if it is arguable whether more descriptive URLs help with search engine ranking, the usability benefit of having custom URLs trumps all.</li>
<li><a href="http://drupal.org/project/wysiwyg" target="_blank"><strong>WYSIWYG API</strong></a> &#8211; As coders, we would be more comfortable entering content with clean code.  But for most clients this is unrealistic.  TinyMCE has become the WYSIWYG editor of choice for us.  Using the WYSIWYG API we can set up unique profiles for different user groups and have as much (or as little) functionality available as the job requires.  The WYSIWYG API also supports a host of other editors including FCKEditor, jWYSIWYG, markItUp, NicEdit and Whizzywig.</li>
<li><strong><a href="http://drupal.org/project/scheduler" target="_blank">Scheduler </a>- </strong>Scheduler is most useful on blogs or news oriented sites where users may be preparing stories weeks in advance.  This adds a couple of fields to a node that specify the start and end dates.  This module is dependent on the Drupal <em>cron</em> module running regularly so take that into account.</li>
<li><a href="http://drupal.org/project/imce" target="_blank"><strong>IMCE</strong> </a>- An image browser.  This module allows the user to navigate through files on the server in specific directories configured by the administrator.  This module is essential for use with WYSIWYG in order to add images easily to any content area. <em><strong>NOTE</strong>: for proper integration with TinyMCE you will need to use the IMCE Wysiwyg API Bridge.
<p></em></li>
<li><a href="http://drupal.org/project/imce" target="_blank"><strong>SMTP Authentication Support</strong></a> &#8211; This may not be required on every setup, but in our hosting environment the default PHP mail function is disabled.  That means we need to use SMTP to send mail.  The core Drupal install doesn&#8217;t support SMTP for sending mail, but with this module you will be able to enter a server address as well as authentication details if required.</li>
<li><a href="http://drupal.org/project/admin_menu" target="_blank"><strong>Administration Menu</strong></a> &#8211; This is a great one for Drupal newbies.  When logged in as an administrator you will get a thin black menu at the top of your site.  This allows you to navigate to any area of the site.  This comes in especially handy in the early stages of developing a template when the menu system may not be built yet.  <em><strong>NOTE:</strong> Take into account that the admin menu shifts your whole design down a couple pixels.  We have found this can interfere with background images that are lined up with content.  Add a slightly modified style on body.admin-menu to compensate.
<p></em></li>
<li><a href="http://drupal.org/project/xmlsitemap"><strong>XML Sitemap</strong></a> &#8211; Provides a complete sitemap in the standardized XML format specific for consumption by search engines.  Currently it can automatically send (with cron) to Google, Yahoo, Microsoft Live and Ask.com.</li>
<li><a href="http://drupal.org/project/webform"><strong>Webform</strong> </a>- This allows us to create forms with custom fields.  We frequently find that clients want &#8220;just one more field&#8221; than the default Drupal contact form provides. This module is essential any time you are looking for feedback from the user.  Form submission can be emailed to multiple addresses as well as stored in the database.  You can even download an Excel document with the data.</li>
<li><a href="http://drupal.org/project/spamspan"><strong>SpamSpan</strong> </a>- This module provides email obfuscation.  It is important to prevent email harvesting bots from grabbing emails from content on the site.  We try to use contact forms for most emailing, but it is inevitable that a client will enter an email somewhere on the site.</li>
<li><strong><a href="http://drupal.org/project/views">Views </a></strong>- It looks like at least a basic version of this module is going to be included in Drupal 7 core.  Views allows you to display any collection of nodes in a variety of ways.  It also provides a deep level of templating to customize specifically how different aspects of the view shows up.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.rtraction.com/blog/devit/10-essential-drupal-modules.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Canvas to replace Flash?  Not likely.</title>
		<link>http://www.rtraction.com/blog/devit/canvas-to-replace-flash-not-likely.html</link>
		<comments>http://www.rtraction.com/blog/devit/canvas-to-replace-flash-not-likely.html#comments</comments>
		<pubDate>Mon, 16 Mar 2009 15:35:14 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Devit!]]></category>

		<guid isPermaLink="false">http://www.rtraction.com/blog/?p=168</guid>
		<description><![CDATA[
Came across an interesting article that talks about a new element that was introduced in recent browser releases.  The canvas tag.  In this article they are suggesting that the options provided with the canvas tag are the same as those which Flash offers.
The largest hurdle canvas has in replacing flash is performance.  [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-173 alignright" style="float: right" title="flash" src="http://www.rtraction.com/blog/wp-content/uploads/2009/03/flash.jpg" alt="Is this the end of Flash?" width="250" height="167" /></p>
<p>Came across an interesting article that talks about a new element that was introduced in recent browser releases.  The canvas tag.  In this article they are suggesting that the options provided with the canvas tag are the same as those which Flash offers.</p>
<p>The largest hurdle canvas has in replacing flash is performance.  A flash SWF file is compiled.  That means it&#8217;s a binary file that only the Flash player (and compatible players) can understand.  Canvas on the other hand is controlled exclusively by Javascript, a scripted runtime language.  That means that the code is interpreted and run at the time the page is viewed.</p>
<p>Take a look at this article which starts the discussion: <a href="http://stairwellblog.com/2009/03/is-canvas-the-end-of-flash/">Is Canvas the End of Flash?</a></p>
<p>However, although canvas may not replace flash, it does have many niche uses.  One problem it is looking to solve is that of font limitations.  Take a look at <a href="http://typeface.neocracy.org/">typeface.js</a>, a library that replaces text with fonts other than the few web safe fonts we&#8217;ve used for years.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rtraction.com/blog/devit/canvas-to-replace-flash-not-likely.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Flash overlaps lightbox, menus or popups</title>
		<link>http://www.rtraction.com/blog/devit/flash-overlaps-lightbox-menus-or-popups.html</link>
		<comments>http://www.rtraction.com/blog/devit/flash-overlaps-lightbox-menus-or-popups.html#comments</comments>
		<pubDate>Mon, 09 Mar 2009 22:23:55 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Devit!]]></category>

		<guid isPermaLink="false">http://www.rtraction.com/blog/?p=161</guid>
		<description><![CDATA[With Flash animation &#38; video clips becoming a staple of modern web designs there are frequent instances where an HTML element will overlap your flash clip.  This could be a lightbox, drop down menu or modal popup window.  There is a fairly simple fix for this.  Set the WMODE attribute to true.

&#60;object classid=&#34;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&#34; codebase=&#34;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0&#34; width=&#34;900&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>With Flash animation &amp; video clips becoming a staple of modern web designs there are frequent instances where an HTML element will overlap your flash clip.  This could be a lightbox, drop down menu or modal popup window.  There is a fairly simple fix for this.  Set the WMODE attribute to true.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>object classid<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;</span> codebase<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0&quot;</span> width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;900&quot;</span> height<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1000&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;test&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>param name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;movie&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;rtraction_animation.swf&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>param name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;quality&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;high&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>param name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;wmode&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;transparent&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>embed src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;rtraction_animation.swf&quot;</span> wmode<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;transparent&quot;</span> quality<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;high&quot;</span> pluginspage<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;application/x-shockwave-flash&quot;</span> width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;900&quot;</span> height<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1000&quot;</span><span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;&amp;</span>lt<span style="color: #339933;">;/</span>embed<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Notice how wmode is an extra param tag for the object tag and just an attribute for the embed tag.</p>
<p>That&#8217;s great if you&#8217;re coding the HTML directly but due to the IE Flash ActiveX bug many people began using Javascript libraries to embed flash.  The syntax is quite simple for the 2 most popular Javascript Flash libraries AC_FL_RunContent and the open source SWFObject 2.0.</p>
<p><strong>AC_FL_RunContent</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">AC_FL_RunContent<span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'codebase'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'width'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'900'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'height'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'1000'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'title'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'test'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'src'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'rtraction_animation'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'quality'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'high'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'pluginspage'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'movie'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'rtraction_animation'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'wmode'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'transparent'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701">AC_FL_RunContent</a> is Adobe&#8217;s Javascript library for dynamically embedding Flash.  You&#8217;ll notice each this function equires the name of the option with the value right after.  We just added wmode and transparent as parameters at the end of the function.</p>
<p><strong>SWFObject</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">swfobject.<span style="color: #660066;">embedSWF</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;rtraction_animation.swf&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;rtraction_animation&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;300&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;120&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;9.0.0&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;expressInstall.swf&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>wmode<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;transparent&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>id<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;rtraction_animation&quot;</span><span style="color: #339933;">,</span><span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;rtraction_animation&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This version is our preferred which uses the open source <a href="http://code.google.com/p/swfobject/">SWFObject 2.0</a> library.  Add the option parameter wmode and set it to transparent.  The Javascript library generates the proper tags on the fly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rtraction.com/blog/devit/flash-overlaps-lightbox-menus-or-popups.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>first-child, last-child for menus</title>
		<link>http://www.rtraction.com/blog/devit/first-child-last-child-for-menus.html</link>
		<comments>http://www.rtraction.com/blog/devit/first-child-last-child-for-menus.html#comments</comments>
		<pubDate>Tue, 18 Nov 2008 16:09:02 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Devit!]]></category>

		<guid isPermaLink="false">http://www.rtraction.com/blog/devit/first-child-last-child-for-menus.html</guid>
		<description><![CDATA[Menus can be range from simple text to complicated visual effects.Â  When it comes to the most used and popular menus one of the most common things we do on our sites is add a separator character.
For example:
Home &#124; Products &#124; Contact Us &#124; About Us
CSS seems like it should be the simplest solution.  [...]]]></description>
			<content:encoded><![CDATA[<p>Menus can be range from simple text to complicated visual effects.Â  When it comes to the most used and popular menus one of the most common things we do on our sites is add a separator character.</p>
<p>For example:</p>
<p><code>Home | Products | Contact Us | About Us</code></p>
<p>CSS seems like it should be the simplest solution.  Add a border-left: 1px solid #000.  However the first element of this menu should not have this border.  CSS 2.1 has given us the first-child and last-child selectors.  This would be the perfect solution other than the fact that Internet Explorer 6 does not support these selectors (<a href="http://www.quirksmode.org/css/contents.html">CSS and browser content and compatibility</a>).  IE7 is incrementally better supporting just the first-child selector.</p>
<p>Until we finally can let go of IE6 support (perhaps when IE8 comes out?), we will need to find another solution.  The easiest is to add the class &#8220;first&#8221; to the first element of the menu and &#8220;last&#8221; to the last element of the menu.  This will allow us to target styles specifically for those menu items.</p>
<p>Now that we develop a number of our sites in Drupal, we have had to come up with a solution for it.  If developing in Drupal 6 then the work is already done for you.  Drupal 6 now includes first and last classes on all menus.  Drupal 5 only includes the first and last classes on primary and secondary links and not for menus displayed in blocks.</p>
<p>Using theme overides you can customize your site to add first and last classes.  Take a look at the following article on <a href="http://drupal.org/node/138656">Have &#8220;first&#8221; and &#8220;last&#8221; classes on menu blocks</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rtraction.com/blog/devit/first-child-last-child-for-menus.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixed cell widths in tables</title>
		<link>http://www.rtraction.com/blog/devit/fixed-cell-widths-in-tables.html</link>
		<comments>http://www.rtraction.com/blog/devit/fixed-cell-widths-in-tables.html#comments</comments>
		<pubDate>Wed, 12 Nov 2008 15:20:58 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Devit!]]></category>

		<guid isPermaLink="false">http://www.rtraction.com/blog/devit/fixed-cell-widths-in-tables.html</guid>
		<description><![CDATA[We recently ran into a situation where we needed multiple tables to appear as a single table.Â  To make sure each column lined up, we needed to set the width of each cell to a set pixel amount.
The first attempt added a width to the &#60;td&#62; as follows:

&#60;td style=&#34;width: 150px&#34;&#62;some content goes here&#60;/td&#62;

However, by nature, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.rtraction.com/blog/wp-content/uploads/2008/11/table.gif" title="Table" alt="Table" align="right" />We recently ran into a situation where we needed multiple tables to appear as a single table.Â  To make sure each column lined up, we needed to set the width of each cell to a set pixel amount.</p>
<p>The first attempt added a width to the &lt;td&gt; as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;td style=&quot;width: 150px&quot;&gt;some content goes here&lt;/td&gt;</pre></div></div>

<p>However, by nature, table cells will always resize to accommodate the content that is placed in them.  That is what they were designed to do.  The cell will maintain its 150 pixel width as long as the content is smaller than the specified width.</p>
<p>The solution is to add a div inside each cell.  It adds some extra markup, but will ensure that the cell will not resize beyond the specified width.  Divs can be set to specific dimensions, and will stay as such even if the content will not fit inside.</p>
<p>So our table cell code now becomes:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;td&gt;&lt;div style=&quot;width: 150px&quot;&gt;some content goes here&lt;/div&gt;&lt;/td&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.rtraction.com/blog/devit/fixed-cell-widths-in-tables.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Optimization</title>
		<link>http://www.rtraction.com/blog/devit/php-optimization.html</link>
		<comments>http://www.rtraction.com/blog/devit/php-optimization.html#comments</comments>
		<pubDate>Fri, 24 Oct 2008 14:27:43 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Devit!]]></category>

		<guid isPermaLink="false">http://www.rtraction.com/blog/devit/php-optimization.html</guid>
		<description><![CDATA[Every now and  then, you run into a situation where you have a large amount of code executing  to create a complex page.Â  This can lead to response times for web page requests  that are not adequate for your client. Everyone should know by now that some  basic coding standards and [...]]]></description>
			<content:encoded><![CDATA[<p>Every now and  then, you run into a situation where you have a large amount of code executing  to create a complex page.Â  This can lead to response times for web page requests  that are not adequate for your client. Everyone should know by now that some  basic coding standards and some simple caching can go a long way to prevent slow  page load times. Sometimes, however, those simple steps are just not enough.Â  Be  sure that pages only load the code they require to display information.Â  Also,  be sure that you have set up some caching on your website (this also helps with  heavy traffic loads).Â  Another thing to remember: to find out where any  bottlenecks might be hiding, it is important to run some benchmarks on your  code.Â  Sometimes a simple database call that might be executed multiple times on  a page can be running very inefficiently and drastically affecting all of your  load times.</p>
<p>One tool that  can be useful is <a title="http://www.xdebug.org/ Debugger and Profiler Tool for PHP" href="http://www.xdebug.org/" target="_blank">XDebug</a> (which we previously  talked about <a title="http://www.rtraction.com/blog/devit/debugging-php-with-xdebug.html XDebug" href="http://www.rtraction.com/blog/devit/debugging-php-with-xdebug.html" target="_blank">here</a>). One thing not covered in our previous blog article is  the ability to perform benchmark analysis on data captured with XDebug.Â  Using a  tool called <a title="http://sourceforge.net/projects/wincachegrind/ WinCacheGrind - Viewer for XDebug2 output files" href="http://sourceforge.net/projects/wincachegrind/" target="_blank">WinCacheGrind</a>, you can analyze the cachegrind profile file  output by XDebug. This will allow you to target and eliminate or reduce  functions that negatively impact your websiteâ€™s performance.Â  If you are hosting  your site with <a title="http://www.apache.org/ The Apache Software Foundation" href="http://www.apache.org/" target="_blank">Apache</a>, another notable option  is to set up Alternative PHP Cache (APC).Â  You will need to verify all your  websiteâ€™s functionality is working properly with APC enabled.Â  Our experience is  that APC provides a great reduction in load times when configured  properly.</p>
<p>Last but not least, be sure to think about performance when writing your code.Â  There is a great article with 40 optimization tips over at reinholdweber.com.Â  Click <a title="40 PHP Optimization Tips" href="http://reinholdweber.com/?p=3" target="_blank">here</a> to check out the optimization tips and feel free to comment with any other performance tools or tips you or your company have found useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rtraction.com/blog/devit/php-optimization.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sorting 2-dimensional arrays in PHP (multi-dimensional array)</title>
		<link>http://www.rtraction.com/blog/devit/sorting-2-dimensional-arrays-in-php-multi-dimensional-array.html</link>
		<comments>http://www.rtraction.com/blog/devit/sorting-2-dimensional-arrays-in-php-multi-dimensional-array.html#comments</comments>
		<pubDate>Wed, 10 Sep 2008 08:31:51 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Devit!]]></category>

		<guid isPermaLink="false">http://www.rtraction.com/blog/devit/sorting-2-dimensional-arrays-in-php-multi-dimensional-array.html</guid>
		<description><![CDATA[There have been numerous occasions where we have retrieved the result of an array and yet still needed to do some kind of sorting.Â  Up until now it seemed like there was no answer.Â  The answer was found with the function array_multisort.Â  The names of some PHP functions can be quite misleading but this one [...]]]></description>
			<content:encoded><![CDATA[<p>There have been numerous occasions where we have retrieved the result of an array and yet still needed to do some kind of sorting.Â  Up until now it seemed like there was no answer.Â  The answer was found with the function <em>array_multisort</em>.Â  The names of some PHP functions can be quite misleading but this one does what it says.</p>
<p>The trick to using this function is that it sorts based on columns.Â  The normal layout of a database table returned into an array is with each row of the table is a seperate element of an array.Â  The 2nd dimension of the array has the table row names as the keys with the value attached.</p>
<p><img src="http://www.rtraction.com/blog/wp-content/uploads/2008/09/table-array.gif" alt="Database table turned into array" /></p>
<p>So there is our table represented in an array with each element as a separate row.Â  To sort we need an array for each column, in this case <em>fruit </em>and <em>color</em>.Â  We use the following code to accomplish this.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$query_result</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
Â    <span style="color: #000088;">$fruit</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fruit'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
Â    <span style="color: #000088;">$color</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'color'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>It seems quite unintuitive but essentially each column is a separate array with the row number being the key.  Now we are able to plug this new data into the array_multisort function to sort our existing array (NOTE: the new column based arrays we created are specifically for the purpose of sorting)</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">array_multisort</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$color</span><span style="color: #339933;">,</span> SORT_DESC<span style="color: #339933;">,</span> <span style="color: #000088;">$fruit</span><span style="color: #339933;">,</span> SORT_ASC<span style="color: #339933;">,</span> <span style="color: #000088;">$query_result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Basically you list the order of columns you want to search by.  In this case we&#8217;re sorting by color descending first and then by fruit ascending.  The last parameter is the multi-dimensional array that you want to sort.</p>
<p>Seems like a convoluted way of a simple sort.  It&#8217;s always best to do all sorting and querying in the database but for the few situations that just isn&#8217;t possible, we have a solution using <em>array_multisort</em> in PHP.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rtraction.com/blog/devit/sorting-2-dimensional-arrays-in-php-multi-dimensional-array.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>LightWindow IE6 bug &#8211; image size (resizeTo)</title>
		<link>http://www.rtraction.com/blog/devit/lightwindow-image-sizing-bug-in-ie6-on-first-click-of-gallery.html</link>
		<comments>http://www.rtraction.com/blog/devit/lightwindow-image-sizing-bug-in-ie6-on-first-click-of-gallery.html#comments</comments>
		<pubDate>Fri, 05 Sep 2008 14:42:06 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Devit!]]></category>

		<guid isPermaLink="false">http://www.rtraction.com/blog/devit/lightwindow-image-sizing-bug-in-ie6-on-first-click-of-gallery.html</guid>
		<description><![CDATA[LightWindow is an advanced &#8220;lightbox&#8221; JavaScript component that can be used for a wide range of media. We were simply trying to use it as an image gallery.  What we ran into is that every once in a while when clicking on a link to trigger the slideshow, LightWindow would fail to size the image [...]]]></description>
			<content:encoded><![CDATA[<p><a title="LightWindow" href="http://www.stickmanlabs.com/lightwindow/" target="_blank">LightWindow</a> is an advanced &#8220;lightbox&#8221; JavaScript component that can be used for a wide range of media. We were simply trying to use it as an image gallery.  What we ran into is that every once in a while when clicking on a link to trigger the slideshow, LightWindow would fail to size the image properly in IE6.  This only seemed to happen in IE6 though reading through others experiences it seems like it may happen in IE7 as well although we never came across any problems with IE7.</p>
<p>When you run into a problem with someone elses tool it can be very difficult to solve the problem.  After an exhaustive search we were able to find the solution posted on a german blog at <a title="trilodge lightwindow fix" href="http://www.trilodge.de/blog/2007/11/07/lightwindow-image-load-failure-fixed/" target="_blank">www.trilodge.de</a>.  Although we don&#8217;t speak german it was obvious this was the solution to our problem.</p>
<p>Although this solution is already available from www.trilodge.de we know this will help any other developers who run into this issue as its hard to find the german solution being the blog is in another language.</p>
<p>The problem happens in the image loader.  It seems to think the image has loaded when it has not.  Therefore it is unable to get an accurate size.</p>
<p>To fix replace:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// We have to do this instead of .onload</span>
<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">checkImage</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> PeriodicalExecuter<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'lightwindow_image_'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">naturalWidth</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">&quot;undefined&quot;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'lightwindow_image_'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">naturalWidth</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">checkImage</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003366; font-weight: bold;">var</span> imageHeight <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'lightwindow_image_'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getHeight</span><span style="color: #009900;">&#40;</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>imageHeight <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">resizeTo</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">resizeTo</span>.<span style="color: #660066;">height</span> <span style="color: #339933;">=</span> imageHeight<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">resizeTo</span>.<span style="color: #660066;">width</span> <span style="color: #339933;">+=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'lightwindow_image_'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getWidth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">imageCount</span><span style="color: #339933;">--;</span>
&nbsp;
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'lightwindow_image_'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setStyle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
			height<span style="color: #339933;">:</span> <span style="color: #3366CC;">'100%'</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span> <span style="color: #3366CC;">'100%'</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">imageCount</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">this</span>._processWindow<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> i<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>With this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// We have to do this instead of .onload</span>
<span style="color: #003366; font-weight: bold;">var</span> ie <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">all</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">?</span><span style="color: #CC0000;">1</span><span style="color: #339933;">:</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">checkImage</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> PeriodicalExecuter<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>ie<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//THE BROWSER IS IE</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'lightwindow_image_'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">complete</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'lightwindow_image_'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">naturalWidth</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">&quot;undefined&quot;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'lightwindow_image_'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">naturalWidth</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">checkImage</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #003366; font-weight: bold;">var</span> imageHeight <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'lightwindow_image_'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getHeight</span><span style="color: #009900;">&#40;</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>imageHeight <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">resizeTo</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">resizeTo</span>.<span style="color: #660066;">height</span> <span style="color: #339933;">=</span> imageHeight<span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">resizeTo</span>.<span style="color: #660066;">width</span> <span style="color: #339933;">+=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'lightwindow_image_'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getWidth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">imageCount</span><span style="color: #339933;">--;</span>
&nbsp;
			$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'lightwindow_image_'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setStyle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
				height<span style="color: #339933;">:</span> <span style="color: #3366CC;">'100%'</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span> <span style="color: #3366CC;">'100%'</span>
			<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">imageCount</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000066; font-weight: bold;">this</span>._processWindow<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #006600; font-style: italic;">//alert('IE has been detected')</span>
		<span style="color: #009900;">&#125;</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;">//NOT IE, PROBABLY FF, OPERA, OTHER</span>
		<span style="color: #006600; font-style: italic;">//this line works for all other browsers</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'lightwindow_image_'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">complete</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'lightwindow_image_'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">naturalWidth</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">&quot;undefined&quot;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'lightwindow_image_'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">naturalWidth</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">checkImage</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #003366; font-weight: bold;">var</span> imageHeight <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'lightwindow_image_'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getHeight</span><span style="color: #009900;">&#40;</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>imageHeight <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">resizeTo</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">resizeTo</span>.<span style="color: #660066;">height</span> <span style="color: #339933;">=</span> imageHeight<span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">resizeTo</span>.<span style="color: #660066;">width</span> <span style="color: #339933;">+=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'lightwindow_image_'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getWidth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">imageCount</span><span style="color: #339933;">--;</span>
&nbsp;
			$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'lightwindow_image_'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setStyle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
				height<span style="color: #339933;">:</span> <span style="color: #3366CC;">'100%'</span><span style="color: #339933;">,</span> width<span style="color: #339933;">:</span> <span style="color: #3366CC;">'100%'</span>
			<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">imageCount</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000066; font-weight: bold;">this</span>._processWindow<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> i<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>If you have any other suggestions or ran into any other problems feel free to post them below and we would be happy to update the post to help others.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rtraction.com/blog/devit/lightwindow-image-sizing-bug-in-ie6-on-first-click-of-gallery.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

