<?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>Pixel Acres &#187; Toolbox</title>
	<atom:link href="http://f6design.com/journal/category/toolbox/feed/" rel="self" type="application/rss+xml" />
	<link>http://f6design.com/journal</link>
	<description>Adventures in web and graphic design</description>
	<lastBuildDate>Thu, 11 Mar 2010 02:37:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>FlashScaler now works with SWFObject 2</title>
		<link>http://f6design.com/journal/2008/08/08/flashscaler-now-works-with-swfobject-2/</link>
		<comments>http://f6design.com/journal/2008/08/08/flashscaler-now-works-with-swfobject-2/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 23:23:24 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Toolbox]]></category>

		<guid isPermaLink="false">http://f6design.com/journal/2008/08/08/flashscaler-now-works-with-swfobject-2/</guid>
		<description><![CDATA[One of my readers, Ren&#233;, asked me if my FlashScaler JavaScript class works with SWFObject 2. I&#8217;m happy to say that yes, it does. The demo and download on my original FlashScaler post now include working examples using SWFObject 2.1.
]]></description>
			<content:encoded><![CDATA[<p>One of my readers, Ren&eacute;, asked me if my <a href="http://f6design.com/journal/2006/12/16/scalable-flash-with-scrollbars/#comment-68184">FlashScaler</a> JavaScript class works with SWFObject 2. I&#8217;m happy to say that yes, it does. The demo and download on my original FlashScaler post now include working examples using SWFObject 2.1.</p>
]]></content:encoded>
			<wfw:commentRss>http://f6design.com/journal/2008/08/08/flashscaler-now-works-with-swfobject-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax form validation using FormBuilder</title>
		<link>http://f6design.com/journal/2007/12/14/ajax-form-validation-using-formbuilder/</link>
		<comments>http://f6design.com/journal/2007/12/14/ajax-form-validation-using-formbuilder/#comments</comments>
		<pubDate>Sat, 15 Dec 2007 00:06:00 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[News & Reviews]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Toolbox]]></category>

		<guid isPermaLink="false">http://f6design.com/journal/2007/12/14/ajax-form-validation-using-formbuilder/</guid>
		<description><![CDATA[Over at roScripts there is a nice tutorial explaining how to modify my FormBuilder PHP class so that validation is performed unobtrusively using AJAX. Check it out.
]]></description>
			<content:encoded><![CDATA[<p>Over at roScripts there is a <a href="http://www.roscripts.com/Unobtrusive_Ajax_PHP_form_validation-188.html">nice tutorial</a> explaining how to modify my <a href="http://f6design.com/journal/2007/04/27/formbuilder-html-forms-made-simple/">FormBuilder PHP</a> class so that validation is performed unobtrusively using AJAX. Check it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://f6design.com/journal/2007/12/14/ajax-form-validation-using-formbuilder/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Papervision 3D</title>
		<link>http://f6design.com/journal/2007/07/30/papervision-3d/</link>
		<comments>http://f6design.com/journal/2007/07/30/papervision-3d/#comments</comments>
		<pubDate>Mon, 30 Jul 2007 22:41:03 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Toolbox]]></category>

		<guid isPermaLink="false">http://f6design.com/journal/2007/07/30/papervision-3d/</guid>
		<description><![CDATA[If you work with Flash at all, by now you will have heard of Papervision 3D, the open source project that has turned the Flash world on its head by introducing a 3rd dimension. I had a quick play with Papervision 3D a few months ago and found it surprising easy to pick up. It [...]]]></description>
			<content:encoded><![CDATA[<p><img class="contentImg matte" src='http://f6design.com/journal/wp-content/uploads/2007/07/papervision_logo.jpg' alt='Papervision 3D logo' /></p>
<p>If you work with Flash at all, by now you will have heard of <a href="http://www.papervision3d.org/">Papervision 3D</a>, the open source project that has turned the Flash world on its head by introducing a 3rd dimension. I had a quick play with Papervision 3D a few months ago and found it surprising easy to pick up. It is now in <a href="http://blog.papervision3d.org/2007/07/07/papervision3d-public-beta/">public beta</a> so I decided to dust off my old project and rewrite it in Actionscript 3.</p>
<h3>3D image gallery demo</h3>
<p><img class="contentImg matte" src='http://f6design.com/journal/wp-content/uploads/2007/07/3dgallery.jpg' alt='Papervision 3D Gallery' /></p>
<p>Inspired by Antti Kupila&#8217;s stunning <a href="http://www.anttikupila.com/development/flame-3d-music-in-actionscript-3/">3D interface for last.fm</a>, I created a simple gallery of album covers using Papervision 3D. For the reflections of the album covers I have used Pixelfumes&#8217; <a href="http://pixelfumes.blogspot.com/2006/06/actionscript-3-reflection-class-source.html">Reflection class</a>.</p>
<h4>View demo</h4>
<p><a href="http://f6design.com/journal/projects/3dgallery/" target="_blank">View my 3D image gallery</a></p>
<h4>Download source</h4>
<p>If you&#8217;re curious to see how I put this demo together, take a look at my <a href="http://f6design.com/journal/projects/3dgallery/3dgallery.zip">Flash source files</a>.</p>
<h3>Using Papervision 3D</h3>
<p>The biggest challenge for me was porting my code to Actionscript 3, as it was the first time I had written AS3 code. But as far as Papervision 3D itself, it really is a piece of cake to get your head around. The documentation that comes with Papervision 3D is a bit hard to follow, but if you download the zipped version of Papervision 3D from <a href="http://code.google.com/p/papervision3d/">Google Code</a> it contains a bunch of great examples which help to introduce the basic concepts.</p>
<p>The cool thing about Papervision is how it can be adapted to all kinds of 3D applications. My main interest is in the possibilities for creating 3D application interfaces, but people have also created <a href="http://www.rockonflash.com/blog/?p=37">3D games</a>, <a href="http://www.papervision3d.org/">models</a> and <a href="http://www.rhythmoflines.co.uk/">animations</a>. Expect to see a lot more 3D Flash in the next couple of years!</p>
]]></content:encoded>
			<wfw:commentRss>http://f6design.com/journal/2007/07/30/papervision-3d/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>File download icon</title>
		<link>http://f6design.com/journal/2007/07/19/file-download-icon/</link>
		<comments>http://f6design.com/journal/2007/07/19/file-download-icon/#comments</comments>
		<pubDate>Thu, 19 Jul 2007 12:30:08 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Toolbox]]></category>

		<guid isPermaLink="false">http://f6design.com/journal/2007/07/19/file-download-icon/</guid>
		<description><![CDATA[I spent an hour yesterday sprucing up the &#8216;file download&#8217; icon I use on one of my websites, and I&#8217;m putting my Photoshop file up here for you to use if you like. I&#8217;ve made it very easy to change the color scheme of the icon, or to modify the graphic on its label, so [...]]]></description>
			<content:encoded><![CDATA[<p>I spent an hour yesterday sprucing up the &#8216;file download&#8217; icon I use on one of my websites, and I&#8217;m putting my Photoshop file up here for you to use if you like. I&#8217;ve made it very easy to change the color scheme of the icon, or to modify the graphic on its label, so you&#8217;ll have no trouble adjusting it to suit your own needs.</p>
<p><img src='http://f6design.com/journal/wp-content/uploads/2007/07/file_download_icon_row.jpg' alt='Row of file download icons' /></p>
<h3>Download</h3>
<p><a href="/journal/filedownloadicon/file_icon.zip">Download Photoshop CS2 file</a></p>
<h3>How to use it</h3>
<p>Here is some simple CSS styling you can use to turn an ordinary link into a spiffy looking file download button.</p>
<h4>The HTML:</h4>
<pre><code>&lt;p class="fileDownload"&gt;
    &lt;a href="myfile.pdf"&gt;Download Annual Report (PDF 120Kb)&lt;/a&gt;
&lt;/p&gt;</code></pre>
<h4>The CSS:</h4>
<pre><code>.fileDownload {
    background: transparent url(file_icon.gif) no-repeat left top;
    display: block;
    height: 35px;
    padding-left: 36px;
}</code></pre>
<h4>The final result:</h4>
<style type="text/css" media="screen">
.fileDownload {
    background:transparent url(/journal/filedownloadicon/file_icon.gif) no-repeat left top;
    display: block;
    height: 35px;
    margin-top: 1em;
    padding-left: 36px;
}
</style>
<p class="fileDownload">
    <a href="#">Download Annual Report (PDF 120Kb)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://f6design.com/journal/2007/07/19/file-download-icon/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Minor update to FormBuilder</title>
		<link>http://f6design.com/journal/2007/07/06/minor-update-to-formbuilder/</link>
		<comments>http://f6design.com/journal/2007/07/06/minor-update-to-formbuilder/#comments</comments>
		<pubDate>Sat, 07 Jul 2007 06:58:15 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Toolbox]]></category>

		<guid isPermaLink="false">http://f6design.com/journal/2007/07/06/minor-update-to-formbuilder/</guid>
		<description><![CDATA[I have made a minor update to my FormBuilder PHP class. It now includes support for &#8216;password&#8217; and &#8216;hidden&#8217; field types.
Next up I will be adding functionality so that the submitted form variables can be emailed to any address. Stay tuned&#8230;
]]></description>
			<content:encoded><![CDATA[<p>I have made a minor update to my <a href="http://f6design.com/journal/2007/04/27/formbuilder-html-forms-made-simple/">FormBuilder</a> PHP class. It now includes support for &#8216;password&#8217; and &#8216;hidden&#8217; field types.</p>
<p>Next up I will be adding functionality so that the submitted form variables can be emailed to any address. Stay tuned&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://f6design.com/journal/2007/07/06/minor-update-to-formbuilder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FormBuilder: HTML forms made simple</title>
		<link>http://f6design.com/journal/2007/04/27/formbuilder-html-forms-made-simple/</link>
		<comments>http://f6design.com/journal/2007/04/27/formbuilder-html-forms-made-simple/#comments</comments>
		<pubDate>Fri, 27 Apr 2007 13:24:06 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Toolbox]]></category>

		<guid isPermaLink="false">http://f6design.com/journal/2007/04/27/formbuilder-html-forms-made-simple/</guid>
		<description><![CDATA[Even though HTML forms tend to be much of a muchness, each is different enough to require customized markup, styling, and validation. Sometimes it feels like reinventing the wheel. Over the past year I have been progressively streamlining the way I build my forms, and recently got to a point where I realized it wouldn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>Even though HTML forms tend to be much of a muchness, each is different enough to require customized markup, styling, and validation. Sometimes it feels like reinventing the wheel. Over the past year I have been progressively streamlining the way I build my forms, and recently got to a point where I realized it wouldn&#8217;t take much more work to create an all-in-one PHP class that generates form markup, validates input, and displays error messages to the user. So that&#8217;s what I did, and I&#8217;m sharing it here in the hope someone else finds it useful too.</p>
<h3>FormBuilder features</h3>
<p>FormBuilder is designed to do make building forms simple. It can do pretty much everything you might want to achieve with a typical HTML form:</p>
<ul>
<li>Create HTML forms by entering a few PHP values</li>
<li>Generates XHTML 1.0 Strict compliant markup</li>
<li>Fully skinnable via CSS</li>
<li>Rigorous and flexible form validation on a per-field basis</li>
<li>Displays easy to understand error messages to the user</li>
<li>Highlights required fields and fields that are in error</li>
<li>Automatically send form results to any email address</li>
<li>Displays a &#8216;thanks&#8217; message once form is successfully processed</li>
<li>Hide or show HTML content based on whether the form was successfully submitted</li>
<li>Ability to add your own custom form validation after FormBuilder has completed its own validation pass</li>
<li>Protect against PHP header injection</li>
</ul>
<h3>Demo and download</h3>
<p>I put together a demo page that shows FormBuilder in action. Try filling out the form incorrectly to see examples of FormBuilder&#8217;s error messaging.</p>
<p><a href="http://f6design.com/journal/formbuilder/" target="_blank">View FormBuilder demo</a><br />
Demonstrates default FormBuilder setup.</p>
<p><a href="http://f6design.com/journal/formbuilder/index_pretty.php" target="_blank">View FormBuilder &#8216;pretty&#8217; demo</a><br />
Demonstrates the <code>showDividers</code> and <code>usePseudoLegends</code> options. These make your forms easier to style but less semantic.</p>
<p><a href="http://f6design.com/journal/formbuilder/formbuilder_1.4.zip">Download FormBuilder</a> (current version is v1.4)</p>
<p><strong>Important:</strong> FormBuilder is a work in progress, so I can&#8217;t promise it&#8217;s completely bug free. Feedback, suggestions and bug reports are welcomed: leave a comment below.</p>
<h3>How the heck do I use this thing?</h3>
<p>You should be able to get a pretty good idea how FormBuilder works just by looking at the source code of index.php in the download package. If you want to dig a little deeper I included a text file with the package that documents all aspects of the class and how to use it. And if you&#8217;re still scratching your head feel free to post a comment below.</p>
<h3>Requirements</h3>
<p>FormBuilder must be run on a web server with PHP 4+ running (I&#8217;ve tested under both PHP4 and PHP5). A basic understanding of PHP is helpful, but if you follow the examples provided in the documentation you might be able to make do without. CSS knowledge is required if you want to change the appearance of the form.</p>
<h3>AJAX validation</h3>
<p>Over at roScripts there is a <a href="http://www.roscripts.com/Unobtrusive_Ajax_PHP_form_validation-188.html">nice tutorial</a> explaining how to modify FormBuilder so that validation is performed unobtrusively using AJAX.</p>
<h3>Changelog</h3>
<p><strong>Version 1.4</strong></p>
<ul>
<li>Added <code>emailResults</code> function, which automatically emails the form variables to any email address</li>
</ul>
<p><strong>Version 1.3</strong></p>
<ul>
<li>Added new field type: password</li>
<li>Added new field type: hidden</li>
</ul>
<p><strong>Version 1.2</strong></p>
<ul>
<li>By default there is no longer an empty <code>dd</code> after each form field, which makes FormBuilder&#8217;s markup more semantic. The empty <code>dd'</code>s provide a handy element for styling visual dividers between fields, so you can still reveal them using the new <code>showDividers</code> parameter in the FormBuilder constructor.</li>
<li>Introduced <code>usePseudoLegends</code> parameter. If set to true, <code>legend</code> will be replaced with <code>h3</code>. The HTML <code>legend</code> element is notoriously difficult to style consistently, and this parameter provides a workable alternative.</li>
<li>Cleaned up the demo CSS styles, including getting dividers displaying properly in Safari.</li>
</ul>
<p><strong>Version 1.1</strong></p>
<ul>
<li>Checkboxes and radio buttons are now correctly marked up inside label tags</li>
<li>Labels are now associated with the relevant form field via the <code>for</code> attribute</li>
</ul>
<h3>Credit where credit is due</h3>
<p>FormBuilder uses validaForms by Erick Vavretchek for form validation. Please see the <a href="http://www.phpclasses.org/browse/package/1698.html">validaForms PHP Classes package</a> if you wish to learn more about this excellent from validator.</p>
]]></content:encoded>
			<wfw:commentRss>http://f6design.com/journal/2007/04/27/formbuilder-html-forms-made-simple/feed/</wfw:commentRss>
		<slash:comments>57</slash:comments>
		</item>
		<item>
		<title>Elastic Flash with scrollbars</title>
		<link>http://f6design.com/journal/2006/12/16/scalable-flash-with-scrollbars/</link>
		<comments>http://f6design.com/journal/2006/12/16/scalable-flash-with-scrollbars/#comments</comments>
		<pubDate>Sat, 16 Dec 2006 13:14:23 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Toolbox]]></category>

		<guid isPermaLink="false">http://f6design.com/journal/2006/12/16/scalable-flash-with-scrollbars/</guid>
		<description><![CDATA[In the past couple of years it has been common for Flash developers to design elastic sites, rather than sites with fixed dimensions. These elastic sites fill the browser window, and content is positioned programatically on the stage according to the size of the viewport. The trouble with this approach is that because the width [...]]]></description>
			<content:encoded><![CDATA[<p>In the past couple of years it has been common for Flash developers to design elastic sites, rather than sites with fixed dimensions. These elastic sites fill the browser window, and content is positioned programatically on the stage according to the size of the viewport. The trouble with this approach is that because the width and height of the embedded Flash swf are set to 100%, the browser will never display scrollbars. If the user sizes their browser window too small then content will begin to disappear off screen. Due to the lack of scrollbars, this hidden content is inaccessible to the user.</p>
<p>By writing a small JavaScript function that is triggered when the window is resized, we can overcome this restriction. When the window size is detected to be smaller than a minimum width/height specified by the designer, the Flash movie will stop scaling, and scrollbars will be forced to appear.</p>
<h3>FlashScaler class</h3>
<p>I have written a JavaScript class that takes care of resizing the Flash movie. FlashScaler is designed to integrate nicely with the SWFObject method of Flash embedding, though it will work fine without SWFObject too. With a sprinkling of CSS applied to your HTML document it will work just dandy in any modern browser.</p>
<h3>Demo</h3>
<p><a href="http://www.f6design.com/journal/flashscaler/" target="_blank">See FlashScaler in action (SWFObject static publishing example)</a><br />
<a href="http://www.f6design.com/journal/flashscaler/index_dynamic.html" target="_blank">See FlashScaler in action (SWFObject dynamic publishing example)</a></p>
<h3>Download</h3>
<p><a href="http://www.f6design.com/journal/flashscaler/flashscaler.zip">Download FlashScaler</a></p>
<p>The download pack contains all of the files used in the FlashScaler demo. If you take a look at the HTML, Flash and CSS files included in the pack it shouldn&#8217;t be hard to figure out how it all fits together. Feel free to use my FlashScaler class in any of your personal or commercial projects. </p>
<h3>Browser compatibility</h3>
<p>The current version has been tested in the following browsers <strong>but probably works in older browsers too</strong>:</p>
<ul>
<li>Firefox 3+</li>
<li>Internet Explorer 6+</li>
<li>Safari 3 (Mac), Safari 4 (PC)</li>
<li>Chrome 4</li>
<li>Opera 9</li>
</ul>
<p>Previous versions of FlashScaler have been confirmed to work in Firefox 1, Safari 1.3, and IE5, and Netscape 8, so it is safe to say that FlashScaler works in any modern browser.</p>
<h3>Changelog</h3>
<h4>v1.1, 04 March 2010:</h4>
<p>I have updated FlashScaler to take advantage of the callback feature introduced in SWFObject 2.2. Now, when Flash detection fails, FlashScaler is disabled.</p>
]]></content:encoded>
			<wfw:commentRss>http://f6design.com/journal/2006/12/16/scalable-flash-with-scrollbars/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
		<item>
		<title>DeepLink: Flash deep linking class</title>
		<link>http://f6design.com/journal/2006/11/18/deeplink-flash-deep-linking/</link>
		<comments>http://f6design.com/journal/2006/11/18/deeplink-flash-deep-linking/#comments</comments>
		<pubDate>Sat, 18 Nov 2006 11:55:50 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Toolbox]]></category>

		<guid isPermaLink="false">http://f6design.com/journal/2006/11/18/deeplink-flash-deep-linking/</guid>
		<description><![CDATA[The inability to bookmark &#8216;deep&#8217; content has long been an accessibility criticism leveled at Flash. In fact, with a bit of Javascript and Actionscript trickery it is possible to create bookmarkable URLs that provide direct access to a Flash movie&#8217;s internal content. And with the introduction of the ExternalInterface class in Flash 8, this two [...]]]></description>
			<content:encoded><![CDATA[<p>The inability to bookmark &#8216;deep&#8217; content has long been an accessibility criticism leveled at Flash. In fact, with a bit of Javascript and Actionscript trickery it is possible to create bookmarkable URLs that provide direct access to a Flash movie&#8217;s internal content. And with the introduction of the <a href="http://livedocs.macromedia.com/flash/8/main/00002200.html">ExternalInterface</a> class in Flash 8, this two way communication between Javascript and Flash just got a lot easier.</p>
<p>Inspired by the work of <a href="http://blog.iconara.net/2006/10/26/swfaddress-back-reload-and-bookmarks-in-flash/">Theo Hultberg</a> and <a href="http://www.asual.com/swfaddress/">Asual</a>, I have developed a simple Flash class that demonstrates the implementation of deep linking in a Flash movie. While I don&#8217;t propose that my DeepLink class should be used as a substitute for Ausual&#8217;s excellent <a href="http://www.asual.com/swfaddress/">SWFAddress,</a> it might provide a useful building block for exploring what the ExternalInterface class is capable of.</p>
<p><strong>Table of contents:</strong></p>
<ul>
<li><a href="#shouldiuseit">Should I use DeepLink instead of SWFAddress?</a></li>
<li><a href="#demo">DeepLink Demo</a></li>
<li><a href="#download">Download</a></li>
<li><a href="#notes">Notes and known issues</a></li>
<li><a href="#installation">Installation</a></li>
<li><a href="#whatisdeeplinking">What is deep linking?</a></li>
<li><a href="#thanks">Thanks</a></li>
</ul>
<p><a name="shouldiuseit"></a></p>
<h3>Should I use DeepLink instead of SWFAddress?</h3>
<p>In a word, no! SWFAddress includes support for the browser history buttons, which makes it a much more comprehensive solution. Taking things further, Theo Hultberg has developed proper object oriented <a href="http://blog.iconara.net/2006/10/26/swfaddress-back-reload-and-bookmarks-in-flash/">implementation of SWFAdddress</a>. I developed DeepLink to satisfy my own personal curiosity about Flash&#8217;s ExternalInterface class, not as any kind of substitute for SWFAddress, and decided to release it publicly in the hope someone might find it useful in their own experiments with deep linking and ExternalInterface. Having said that, DeepLink is very easy to implement and does a decent job, so you should be able to use in production environments if you choose to. If you want to use DeepLink as the basis for further experimentation, please feel free.</p>
<p><a name="demo"></a></p>
<h3>DeepLink Demo</h3>
<p>I have made a simple demo showing how the DeepLink class works.</p>
<p><strong>View DeepLink demo here:</strong><br />
<a href="http://www.f6design.com/journal/deeplink/" target="_blank">http://www.f6design.com/journal/deeplink/</a></p>
<p>Note how each time you select a new &#8216;page&#8217; within the Flash movie, the URL in the browser window changes. Each of these URLs is bookmarkable, and when plugged into a web browser will take you directly to the relevant content instead of the front page of the site.</p>
<p><strong>To try this out, visit:</strong><br />
<a href="http://www.f6design.com/journal/deeplink/#/pageone/" target="_blank">http://www.f6design.com/journal/deeplink/#/pageone/</a></p>
<p>You will notice I have structured my URLs in the same way as SWFAddress, which I think is a good method for &#8216;disguising&#8217; the hash (#) symbol and producing a clean looking URL.</p>
<p><a name="download"></a></p>
<h3>Download</h3>
<p><a href="http://f6design.com/journal/deeplink/DeepLink.zip">Download DeepLink</a> &#8211; the Flash DeepLink class, including the required javascript functions and demo files.</p>
<p><a name="notes"></a></p>
<h3>Notes and known issues</h3>
<p>The DeepLink class has been tested in the following browsers:</p>
<ul>
<li>Firefox 2 &#8211; PC (should work fine in older versions too)</li>
<li>Internet Explorer 7 &#8211; PC</li>
<li>Internet Explorer 6 &#8211; PC</li>
<li>Internet Explorer 5.5 &#8211; PC</li>
<li>Netscape 8 &#8211; PC</li>
<li>Opera 9.0.2 &#8211; PC</li>
</ul>
<p>Note that DeepLink tests for the availablility of ExternalInterface functionality, and will fail silently in situations when it cannot work.</p>
<p>DeepLink requires Flash 8+ to work. The ExternalInterface class was not available is previous versions of Flash.</p>
<p>To get DeepLink working, you need to be running your Flash site on a web server. A local web server on your development machine will do just fine.</p>
<p>DeepLink relies on modifying the hash value of the browser URL (the bit after the #), and if the user manually modifies the hash value then DeepLink will be unable to modify it any further.</p>
<p>The method by which DeepLink uses Javascript to communicate with the Flash assumes that you have used <a href="http://blog.deconcept.com/swfobject/">SWFObject</a> to embed the Flash movie in your web page. This isn&#8217;t due to any technical requirement, it&#8217;s just that SWFObject is the defacto standard for Flash detection and embedding, and also happens to be what I personally use. It should be simple to change my Javascript <code>sendState()</code> function so that it communicates with standard object/embed tags, but you&#8217;re on your own if you want to have a crack at it.</p>
<p><a name="installation"></a></p>
<h3>Installation</h3>
<p>In the <code>&lt;head&gt;</code> tag of your HTML page insert a link to the SWFObject JavaScript, followed by a link to the DeepLink JavaScript:</p>
<pre><code>&lt;script type="text/javascript" src="js/swfobject.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/deeplink.js"&gt;&lt;/script&gt;</code></pre>
<p>Below that, include a single line script that tells DeepLink the id of your SWFObject instance:</p>
<pre><code>&lt;script type="text/javascript"&gt;
    DeepLink.setObject('deeplinkexample');
&lt;/script&gt;</code></pre>
<p>Embed your Flash movie on the page using the regular SWFObject method, such as:</p>
<pre><code>&lt;div id="flashcontent"&gt;
   Alternative content goes here...
&lt;/div&gt;
&lt;script type="text/javascript"&gt;
    // &lt;![CDATA[
    var so = new SWFObject('deeplink.swf', 'deeplinkexample', '100%', '100%', '8', '#000000');
    so.addParam('menu', 'false');
    so.write('flashcontent');
    // ]]&gt;
&lt;/script&gt;</code></pre>
<p>In your Flash movie, create a listener object, which will receive hash states from JavaScript (typically when the page first loads):</p>
<pre><code>var deeplinkListener:Object = new Object();
deeplinkListener.receiveState = function(newState:String){
    // code to handle hash variable goes here...
}</code></pre>
<p>Note that the code inside your <code>receiveState()</code> function can be whatever you like. The hash string wil be received in the format one/two/three/. For an example of how this might work, see frame 2 of the .fla included with the demo.</p>
<p>Next, create an instance of the DeepLink class:</p>
<pre><code>deepLinkController = new com.f6design.DeepLink(deeplinkListener);</code></pre>
<p>And finally, alert JavaScript that the Flash movie has loaded. The JavaScript will then pass Flash the current hash value (if any):</p>
<pre><code>deepLinkController.alertLoaded();</code></pre>
<p>You may call the <code>alertLoaded()</code> function at any time, just make sure you don&#8217;t do it until the Flash movie is ready to receive deep links &#8211; typically this would be when the Flash file has finished loading.</p>
<p><a name="whatisdeeplinking"></a></p>
<h3>What is deep linking?</h3>
<p>If you&#8217;ve read this far and still have no idea what the heck &#8216;deep linking&#8217; is, here is a quick summary:</p>
<p>Flash applications typically utilize only one HTML document, and therefore have only one URL. No matter how complex a Flash movie&#8217;s internal navigation system, or how &#8216;deep&#8217; a visitor delves into the application, this URL doesn&#8217;t change. If the Flash application is located at <em>http://www.mysite.com/</em>, this address is all the user will ever see in their browser&#8217;s address bar. But what say a visitor wants to bookmark a content state that is located deep inside the Flash application? Or email a URL to a friend that takes them directly to deep content? A deep link allows the addition of this functionality to a Flash movie. </p>
<p>Deep linking in Flash is achieved by modifying the hash value of a URL. The hash value (the bit after the # symbol) is typically used to jump to an invisible anchor link further down the page. For the hash value to be useful as a deep link, it is necessary to extract it from the URL using JavaScript, and pass it as a variable to the Flash movie. The Flash movie can then parse the hash string and use it to perform a change of navigational state, such as jumping to a frame on the main timeline.</p>
<p><a name="thanks"></a></p>
<h3>Thanks</h3>
<p>Thanks obviously to <a href="http://blog.iconara.net/2006/10/26/swfaddress-back-reload-and-bookmarks-in-flash/">Theo Hultberg</a> and <a href="http://www.asual.com/swfaddress/">Asual</a>, whose excellent work with deep linking inspired me to try it for myself. Also thanks to Geoff Stearns, the creator of <a href="http://blog.deconcept.com/swfobject/">SWFObject</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://f6design.com/journal/2006/11/18/deeplink-flash-deep-linking/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>
