<?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>Interactive IQ : The Hessler Design Blog &#187; Web Design</title>
	<atom:link href="http://www.hesslerdesign.com/blog/category/web-design/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hesslerdesign.com/blog</link>
	<description>Smart Developers = Smart Websites</description>
	<lastBuildDate>Thu, 26 Jan 2012 23:00:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>User Experience Lesson from Google</title>
		<link>http://www.hesslerdesign.com/blog/web-design/user-experience-lesson-from-google/</link>
		<comments>http://www.hesslerdesign.com/blog/web-design/user-experience-lesson-from-google/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 02:31:19 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[user experience]]></category>

		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=602</guid>
		<description><![CDATA[As a web guy, I like good user experiences.  I try not to make users think.  And I try to make the user experience as intuitive as I possibly can. Today, I was once again flabbergasted by a great little feature I accidentally discovered using Google&#8217;s Gmail.  It reminded me that as good as a [...]]]></description>
			<content:encoded><![CDATA[<p>As a web guy, I like good user experiences.  I try not to make users think.  And I try to make the user experience as intuitive as I possibly can.</p>
<p>Today, I was once again flabbergasted by a great little feature I accidentally discovered using Google&#8217;s Gmail.  It reminded me that as good as a user experience gets, there&#8217;s always room for improvement.</p>
<p>(It also made me think of the quote from TRON, which is applicable to web design and user experiences as well: <em>&#8220;On the other side of the screen, it all looks so easy.&#8221;</em>)</p>
<p>So what was this great little feature of Gmail?  I was typing a message and had every intention of attaching a PDF file.  Problem is, I totally forgot to attach the PDF file.  Luckily, Google was smart enough to know that I wanted to attach the file, and prompted me, asking if I wanted to attach anything.</p>
<p>&#8220;How&#8217;d they do that?&#8221; you ask?  Well, in my message, I had included the words &#8220;Attached is&#8230;&#8221;, referencing the PDF file I was going to attach and wanted the recipient to look for.  Apparently, Google thought that, like me, people would forget to attach files more than just once.  So they put in logic to search each message for certain keywords (&#8220;attached is&#8221;, in my case), and if the email has no attachments, they&#8217;ll give you a popup message that tells you they found those keywords in your message, and ask if you really want to send the email as-is, or if you want to attach a file.</p>
<p>Chalk one up for Google in teaching us all another lesson on a subtle but well thought-out user experience.</p>
<p>Until next time, happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hesslerdesign.com/blog/web-design/user-experience-lesson-from-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Look Mom, No Flash!</title>
		<link>http://www.hesslerdesign.com/blog/web-design/look-mom-no-flash/</link>
		<comments>http://www.hesslerdesign.com/blog/web-design/look-mom-no-flash/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 18:27:02 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=500</guid>
		<description><![CDATA[Whew!  It&#8217;s been far too long since my last ramblings on the blog here.  And c&#8217;mon&#8230;what&#8217;s up with that title?  No Flash?  Don&#8217;t worry, I&#8217;m not turning anti-Flash like Steve Jobs or anything.  Heck, I continue to do a ton of Flash development work, and seriously enjoy doing it.  No, it&#8217;s nothing like that.  It&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Whew!  It&#8217;s been far too long since my last ramblings on the blog here.  And c&#8217;mon&#8230;what&#8217;s up with that title?  No Flash?  Don&#8217;t worry, I&#8217;m not turning anti-Flash like Steve Jobs or anything.  Heck, I continue to do a ton of Flash development work, and seriously enjoy doing it.  No, it&#8217;s nothing like that.  It&#8217;s just that I&#8217;ve just launched an updated version of <a title="Hessler Design - Home" href="http://www.hesslerdesign.com/" target="_self">HesslerDesign.com</a> that includes no Flash elements in the main framework of the site (minus the a few entries in the <a title="Hessler Design - Work" href="http://www.hesslerdesign.com/">Work</a> section, and of course excluding the blog section, because I write about Flash quite a bit as you can probably tell).</p>
<p>Why, you ask?</p>
<p>As time goes on, I&#8217;m finding myself drawing closer and closer to sticking close to pure HTML/CSS code, with other standards-compliant languages like PHP/MySQL and JavaScript.  Not to say Flash and it&#8217;s programming language (ActionScript) isn&#8217;t compliant with anything.  I had simply found myself doing things in Flash by default because it&#8217;s what I was most comfortable with, and could do with the least amount of technical issues.</p>
<p>But, now that I&#8217;ve been exploring more uses for JavaScript in place of what would normally be Flash code, it&#8217;s easier and easier to pull myself away from Flash.  Plus, as I&#8217;ve been doing more and more dynamic code content with PHP, I&#8217;m finding myself a lot more excited about using PHP than I am about using Flash.  I still enjoy Flash, and don&#8217;t get me wrong &#8212; there are definitely times and places for Flash.  But for where I&#8217;m at now, I am finding that my own site doesn&#8217;t currently need to rely on Flash so much.</p>
<p>Outside of the programming techniques used for the most recent release of the site, I felt like it was definitely the time for a change regarding the design of the site.  The new design has a much more sophisticated simplicity and clean look than the old version. It&#8217;s focus is more on the projects and artwork, as they take a very prominent position on the <a title="Hessler Design - Work" href="http://www.hesslerdesign.com/" target="_self">Work</a> page with only the project details to accompany them.  No fluff content just to fill in space and give users something else to read.  Only the necessities.</p>
<p>With that all said, I hope you enjoy the newest iteration of HesslerDesign.com.  If you haven&#8217;t already, check out the <a title="Hessler Design - Work" href="http://www.hesslerdesign.com/" target="_self">Work</a> page, which has a few new projects listed that I&#8217;ve completed recently.  I hope you like what you see.</p>
<p>Until next time, happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hesslerdesign.com/blog/web-design/look-mom-no-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Life on the Edge: Making Your Website Span to the Edge of the Browser Window</title>
		<link>http://www.hesslerdesign.com/blog/web-design/life-on-the-edge-making-your-website-span-to-the-edge-of-the-browser-window/</link>
		<comments>http://www.hesslerdesign.com/blog/web-design/life-on-the-edge-making-your-website-span-to-the-edge-of-the-browser-window/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 15:15:14 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[stylesheet]]></category>
		<category><![CDATA[websites]]></category>

		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=490</guid>
		<description><![CDATA[Here&#8217;s an oldie, but a goodie.  One of the questions I get a lot is, &#8220;Why isn&#8217;t my website reaching all the way to the edge of the browser window, and how do I get it to do that?&#8221;  Well, the answer is very simple, and it&#8217;s easily taken care of with one line of [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an oldie, but a goodie.  One of the questions I get a lot is, &#8220;Why isn&#8217;t my website reaching all the way to the edge of the browser window, and how do I get it to do that?&#8221;  Well, the answer is very simple, and it&#8217;s easily taken care of with one line of CSS code.</p>
<p>In your CSS code, simply assign the following:</p>
<p><span style="margin-left: 24px; margin-right: 24px;"><code>html body {margin:0px; padding:0px}</code></span></p>
<p>That&#8217;s it. Seriously. By default, most (I hesitate to say all) browsers have a built in 10px or so padding around the edge of the window. By setting your html and body to have no margin or padding, it effectively overwrites the browser default values and uses yours.</p>
<p>While you&#8217;re at it, you might also be wondering how you can center your main container in the browser window, instead of having it left-justified.  This too is easy to implement with one snippet of CSS.  Let&#8217;s go ahead and assume that your main div container has the ID &#8220;container&#8221;. Your CSS code to center the div &#8220;container&#8221; will be:</p>
<p><span style="margin-left: 24px; margin-right: 24px;"><code>#container {margin: 0 auto; width:960px;}</code></span></p>
<p>Notice that in this example, you need to fix your width to a certain value so the container knows not to take up 100%. The margin setting &#8220;0 auto&#8221; tells the container to have a margin of 0 (zero) pixels on top and bottom, with auto margins on the left and  right.</p>
<p>So there you have it. Two basic CSS rules to make your page go all the way up to the edge of the browser window, and to center your main container in the window.</p>
<p>Until next time, happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hesslerdesign.com/blog/web-design/life-on-the-edge-making-your-website-span-to-the-edge-of-the-browser-window/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Optimize Your Website&#8217;s SEO with the Help of SEOmoz</title>
		<link>http://www.hesslerdesign.com/blog/web-design/optimize-your-websites-seo-with-the-help-of-seomoz/</link>
		<comments>http://www.hesslerdesign.com/blog/web-design/optimize-your-websites-seo-with-the-help-of-seomoz/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 17:50:05 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=486</guid>
		<description><![CDATA[One question I get repeatedly is, &#8220;How can I improve my search rankings?&#8221;  While there&#8217;s a vast array of variables that go into search rankings, most of which are beyond the comprehension of non-Google developers, there is a site that is devoted to providing information on Search Engine Optimization (SEO).  That site is: seomoz.org. SEOmoz [...]]]></description>
			<content:encoded><![CDATA[<p>One question I get repeatedly is, &#8220;How can I improve my search rankings?&#8221;  While there&#8217;s a vast array of variables that go into search rankings, most of which are beyond the comprehension of non-Google developers, there is a site that is devoted to providing information on Search Engine Optimization (SEO).  That site is: <a title="SEOmoz" href="http://www.seomoz.org" target="_blank">seomoz.org</a>.</p>
<p>SEOmoz is a popular provider of SEO software.  It&#8217;s website is dedicated to all things SEO, including a blog, helpful articles and user guides, and best of all, a set of tools that webmasters can use to help their site&#8217;s SEO.  Some of the tools are only available to &#8220;Pro&#8221; members, which costs money.  But a little over half of them (at the writing of this entry) are completely free to use (some with daily restrictions on use).</p>
<p>One of the coolest free tools available to anyone is the <a title="SEO Toolbar for Firefox" href="http://www.seomoz.org/seo-toolbar" target="_blank">SEO Toolbar for Firefox</a>.  With the toolbar, you can access any of the SEOmoz tools right from the toolbar, without having to go to the actual site first.  It&#8217;s incredibly handy, and also includes stats like Page Authority and Domain Authority, which give real-time stats on the site you&#8217;re currently on.</p>
<p>So next time you get the question, &#8220;How can I improve my search rankings?&#8221;, look to <a title="SEOmoz" href="http://www.seomoz.org" target="_blank">SEOmoz.org</a> as your first (and likely, only) stop for resources and tools to help guide you on your road to SEO success.</p>
<p>Until next time, happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hesslerdesign.com/blog/web-design/optimize-your-websites-seo-with-the-help-of-seomoz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find My Fold &#8211; A Modern Definition of the Web&#8217;s &#8216;Fold&#8217;</title>
		<link>http://www.hesslerdesign.com/blog/web-design/find-my-fold-a-modern-definition-of-the-webs-fold/</link>
		<comments>http://www.hesslerdesign.com/blog/web-design/find-my-fold-a-modern-definition-of-the-webs-fold/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 20:17:56 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[fold]]></category>
		<category><![CDATA[websites]]></category>

		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=480</guid>
		<description><![CDATA[Time and time again, I get the request nearly every designer hates hearing: &#8220;Will this be above the fold?&#8221; Innocent enough question, but honestly, anyone who asks this is still living in the 20th Century.  The reasons are numerous for why &#8220;the fold&#8221; is obsolete for websites. Instead of explaning them here, I&#8217;ll point you [...]]]></description>
			<content:encoded><![CDATA[<p>Time and time again, I get the request nearly every designer hates hearing: &#8220;Will this be above the fold?&#8221; Innocent enough question, but honestly, anyone who asks this is still living in the 20th Century.  The reasons are numerous for why &#8220;the fold&#8221; is obsolete for websites. Instead of explaning them here, I&#8217;ll point you to a great site that&#8217;ll do the job for me: <a title="Find My Fold" href="http://www.findmyfold.com" target="_blank">FindMyFold.com</a>.</p>
<p>Okay, truthfully the shameless plug of <a title="Find My Fold" href="http://www.findmyfold.com" target="_blank">FindMyFold.com</a> is quite self-serving. Between me, you, Google, the Internet, and Al Gore, I sort of created the site. I thought it high time to do my duty as a designer and developer, and offer the site as a public service to the world.</p>
<p>So the next time someone asks you, &#8220;Is this going to be above the &#8216;fold&#8217;?&#8221;, point them to <a title="Find My Fold" href="http://www.findmyfold.com" target="_blank">FindMyFold.com</a>. At the site, you see what <em><strong>your</strong></em> fold is in <em><strong>your</strong></em> own browser.  Plus, there&#8217;s a handy-dandy &#8220;<em>Test Your Site&#8217;s Fold</em>&#8221; feature that you can use to test <em><strong>any site</strong></em> to see where your fold lands on that particular page.</p>
<p>Oh yeah, and while you&#8217;re there, make sure to share the news with your friends, with the built-in social links.  Let&#8217;s spread the news and get everyone up to speed!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hesslerdesign.com/blog/web-design/find-my-fold-a-modern-definition-of-the-webs-fold/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top Ten Ways to Optimize Your Flash Website</title>
		<link>http://www.hesslerdesign.com/blog/flash/top-ten-ways-to-optimize-your-flash-website/</link>
		<comments>http://www.hesslerdesign.com/blog/flash/top-ten-ways-to-optimize-your-flash-website/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 17:45:12 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[arrays]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=324</guid>
		<description><![CDATA[Let&#8217;s face it.  When it comes to Flash websites, people either love them or hate them.  For those who hate them, I firmly believe it&#8217;s because of two main reasons: crappy SEO (search engine optimization), and long load times (a direct result of heavy file weights).  While the issue of SEO is its own beast, [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s face it.  When it comes to Flash websites, people either love them or hate them.  For those who hate them, I firmly believe it&#8217;s because of two main reasons: crappy SEO (search engine optimization), and long load times (a direct result of heavy file weights).  While the issue of SEO is its own beast, I won&#8217;t get into that now.  For now, I&#8217;m going to focus on 10 easy ways to optimize your Flash website to make it meaner, leaner, and more user-friendly.  Believe me, if you start using some of these ideas, your sites will transform in ways you never though imaginable.  And you&#8217;ll notice that you&#8217;ll get a much smoother and quicker site.  With that said, let&#8217;s get started.</p>
<h4>1. Use XML files to set content framework</h4>
<p>On nearly every Flash site I work on, I use at least some XML. The great thing about XML files is they are a great way to structure blocks of your site.  For instance, if you want a slideshow on your site, you could have an XML file that contains the title, url, and other image-specific information you want to include for each image. Then, just import the XML into Flash and store the XML data in arrays to organize the information to use later.  (More on arrays below.)</p>
<p>Another great thing about using XML in Flash is that if you want to stream an RSS feed into a Flash site, you can, because RSS feeds are set up as XML.  (For more info on RSS feeds, see the post on <a href="http://www.hesslerdesign.com/blog/flash-actionscript/streaming-rss-feeds-into-your-flash-application/" target="_self">Streaming RSS feeds into Your Flash Applications</a>.)</p>
<p>Additionally, XML is easy to change without having to republish your site.  Say you have that slideshow I mentioned above, but want to swap out an image.  With XML, you just point to the new url, update the title, and save. Your Flash site will automatically update with the new info, and you won&#8217;t have to republish every time. Trust me, you&#8217;ll thank yourself for using XML when you build your Flash site.</p>
<h4>2. Use arrays to organize assets used in your code</h4>
<p>For me, using arrays is quite possibly one of the smartest and most powerful things you can do to optimize your code.  Not necessarily from a file weight perspective, but because with arrays, you can reference an object stored in an array by name, number, id, etc. For instance, say you have 20 thumbnail images you want to make clickable to open a larger image. You could attach individual event listeners to each image.  Or, you could set up a couple of arrays &#8212; one for the instance names of each image, and one for the reference to the larger image to load when clicked &#8212; and run &#8220;for&#8221; loops to set the event listeners all at once. While you&#8217;re in the &#8220;for&#8221; loop, set an ID number for each image that you can then reference in your &#8220;click&#8221; function that will fire on mouse click, and call up that ID number slot in the large image array.  With only a few lines of code, you&#8217;ll have a powerful way to batch chunks of your code with minimal effort. (For more info on arrays, see my post on <a href="http://www.hesslerdesign.com/blog/flash-actionscript/utilizing-the-power-of-arrays-in-adobe-flash/" target="_self">Utilizing the Power of Arrays in Adobe Flash</a>.)</p>
<h4>3. Only import and embed absolutely necessary image files into your file.</h4>
<p>If you&#8217;ve been on the Web at all&#8230;and judging by you reading this, I&#8217;m guessing you have&#8230;you know doubt know that a lot of people don&#8217;t like Flash sites.  The main reason seems to be they take way too long to load.  To get around this, I highly suggest importing and embedding ONLY the images you absolutely need.  If you have a lot of image assets, I suggest loading them dynamically via code, and placing them in the appropriate places.  This not only makes the file size considerably smaller, but it also opens the door to be able to update an image, replace it, and have Flash automatically read in the updated file without the need to republish the entire site.  (Sorta sounds like one of the key perks of using XML, doesn&#8217;t it?)  And trust me, users will thank you for having a site that loads (or at least shows up with a short preloader) in 5 seconds, rather than a beefy site that doesn&#8217;t show up until the entire thing loads.</p>
<h4>4. Load assets in an orderly fashion, not all at once</h4>
<p>Along with #3 above, when you load assets into your Flash site dynamically, it&#8217;s best to set up a structure and order in which to load them. For instance, load all of the home/landing page assets first. Once those are loaded, proceed with the next set of assets that you think will be needed/viewed by your users.  Not using a certain set of images until later in the site?  Don&#8217;t load them up front. Wait until the rest of the assets before it have been loaded first. Think about it.  Would you rather try to have 20 images load all at once?  Or load them in the order of which they&#8217;ll be seen? Loading them one at a time will speed up the individual image load time because there is only one image needing attention while it is being loaded, not all 20?</p>
<h4>5. Cool it with the videos</h4>
<p>Okay, this sounds harsh, but hear me out. Video is great. It&#8217;s everywhere, and it&#8217;s getting more popular by the day.  (YouTube, anyone?)  But when you&#8217;re making a Flash site, video can also be a beast to work with, specifically video that needs to stream without a playback bar.  The worst thing about video is file size. I&#8217;ll admit, video has come a long way in optimizing file weights and all, but at the end of the day, even a small video is still going to be around 1-2MB.  When you are using video, make sure you utilize the &#8220;loading assets in an orderly fashion&#8221; advice from above.  If you try to start streaming a video when 20 images are loading while it&#8217;s trying to play, you&#8217;ll no doubt get choppy playback.</p>
<h4>6. Use TweenMax or TweenLite for code-based tweening and animating</h4>
<p>I&#8217;m a big fan of keeping my Flash sites on one frame of the timeline, and doing as much as I possibly can with code, rather than with the timeline.  The reason for this is simply less time making changes later on down the road.  Want to make every tween of an image fading out half as long across the entire site?  Pretty laborious if you&#8217;re using the timeline.  But if you&#8217;re using code, it&#8217;s a matter of updating a couple of numbers.</p>
<p>This is where <a href="http://blog.greensock.com/tweenmax/" target="_blank">TweenMax</a> and <a href="http://blog.greensock.com/tweenlite/" target="_blank">TweenLite</a> come in.  In a nutshell, they&#8217;re the best tweening engine out there.  Using it, you can call one function that can alter many facets of an object at once (x and y position, alpha, tint, etc.).  You can also attach event listeners like onComplete, onStart, etc., that call functions to run at specific times during the tween.  In short, these tweening engines will make you wonder why you ever used timeline-based animations.  And best of all, they&#8217;re extremely light in file weight, unlike a lot of timeline-based animations.  And it&#8217;s a one-time file weight addition, not a per-tween sort of thing.</p>
<h4>7. Simulate downloading on slower connections</h4>
<p>Not everyone has a cable-speed connection. Believe it or not, there are still a lot of people out there using DSL or slower connections.  And as unfortunate as it may be, those are the people you need to build the site for.  Don&#8217;t ever assume that your audience is going to have the latest and greatest computers.</p>
<p>To simulate downloads in Flash, export your movie and select &#8220;View &gt; Simulate Download&#8221;.  To set different connection speed settings, select &#8220;View &gt; Download Settings&#8221;, and select your desired speed (or create your own custom speed).  Flash can be deceiving. When you test out a movie, it always runs lightning fast. But by testing it using the &#8220;Simulate Download&#8221; method, you&#8217;ll get a much better idea of how your site will behave on the Web.</p>
<h4>8. Build buttons and other UI components as vector artwork in Flash</h4>
<p>One of my biggest pet peeves is using raster images for buttons that could easily be made as vector art in Flash.  Not only does this make having to update the button a multi-step process, but it also beefs up the size of the file.  It may not be much, but if you get a dozen different image buttons, you could easily have just added 100+ kb to your file weight.  Might not seem by much, but as people&#8217;s attention spans are getting shorter and shorter, that added 2 seconds of load time you just added might be costly, and you may see an increase in the number of dropped users.</p>
<p>My motto is this: &#8220;<em>If it can be made in Flash, make it in Flash&#8221;</em>.  Vector art is not only easily editable, but also a huge file weight saver.  Plus, you don&#8217;t get any degradation of quality that you&#8217;d get if you used images.  All of your lines, colors, gradients, etc. are crystal clear.  Pair that with the almost non-existent file weight they carry, and what&#8217;s not to love?</p>
<h4>9. Write custom Classes for reusable code</h4>
<p>If you write Actionscript code, you use Classes.  You might not know it, but you do.  Every time you use a property of a MovieClip instance (i.e. myClip_mc.y to get the &#8220;y&#8221; position), you&#8217;re calling the MovieClip class.  Same with Sprites, Buttons, UI Components, etc.  Classes are a staple in object-oriented programming, and allow you to read or set properties, call functions (methods), and respond to events.  It&#8217;s a great way to reuse the same code over and over again, by simply importing the classes into your site file.</p>
<p>One of my personal favorite classes that I have written is for an Email Validator, which contains the logic to check whether a string is a valid email address or not.  You can check it out in my previous post on <a href="http://www.hesslerdesign.com/blog/flash-actionscript/building-a-better-email-validator-in-flash/" target="_self">Building a Better Email Validator in Flash</a>.  Each time I need to use this, I simply import it into my file (which is 1 line of code), make an instance of the validator (1 line of code), then call the validate function and pass in the string to validate (1 line of code).  In all, for me to validate an email address, it takes 3 lines of code.  Much better than rewriting all of the validation logic in a dozen different files, eh?</p>
<h4>10. Use FlashVars to set important global variables</h4>
<p>Every so often, you&#8217;ll run into an issue where you&#8217;ll want to change a variable from outside of your Flash file. An easy way to do this is to use the FlashVars parameter when embedding your Flash file in HTML.  I find that I mostly use FlashVars for variables that will change from a &#8220;staging&#8221; site to the final &#8220;production&#8221; site.  The most often used variable that I personally encounter is the account name for Omniture tracking. The bulk of sites I develop have different staging and production Omniture account names, so the metrics don&#8217;t get skewed while testing.  But if I embed that account name into the Flash file, I suddenly need 2 different versions of the Flash file &#8212; one for staging, one for production.  But if I have a FlashVar set up for this account name, I can just change the variable in the HTML code, and have Flash read it in.  Trust me, it&#8217;s a handy way to avoid having multiple versions of the same file for different environments.</p>
<h4>In Conclusion&#8230;</h4>
<p>So there you have it.  10 easy ways to optimize your Flash sites.  There are many more ways to optimize Flash sites, and I&#8217;m sure I&#8217;ll get into them in later posts.  But these are some of the main culprits.  And trust me, individual posts could be written about each one of these (and some already have).  If you want to see posts that dive deeper into any of these, just let me know and I&#8217;ll write it up.  Until next time, happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hesslerdesign.com/blog/flash/top-ten-ways-to-optimize-your-flash-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making Your Flash Application Communicate with the Outside World</title>
		<link>http://www.hesslerdesign.com/blog/flash/making-your-flash-application-communicate-with-the-outside-world/</link>
		<comments>http://www.hesslerdesign.com/blog/flash/making-your-flash-application-communicate-with-the-outside-world/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 22:14:15 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=181</guid>
		<description><![CDATA[I&#8217;ve recently been working on a number of Flash sites that require communication back and forth between the Flash SWF file and the parent HTML page. This is relatively easy to do, but includes a few &#8220;gotcha&#8217;s&#8221; that should be addressed. Below is a list of items that you will need to make sure you [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently been working on a number of Flash sites that require communication back and forth between the Flash SWF file and the parent HTML page.  This is relatively easy to do, but includes a few &#8220;gotcha&#8217;s&#8221; that should be addressed. Below is a list of items that you will need to make sure you follow that will make your Flash be able to communicate with the outside world, and vice-versa.<br /><span id="more-181"></span></p>
<h4>Step 1: Embed your Flash SWF file in your HTML page</h4>
<p>When embedding your SWF file, give your <code>object</code> tags the same <code>id</code> and <code>name</code>.  Your non-Internet Explorer <code>object</code> tag should have the <code>id</code>, and your IE <code>object</code> tag should have the name. And again, both should be set to the same value. (In this example, these attributes are set to &#8220;helloSWF&#8221;.) Additionally, you need to set the <code>allowScriptAccess</code> attribute of your Flash object to either &#8220;sameDomain&#8221; or &#8220;always&#8221;.  Without this attribute set, you won&#8217;t be able to have Flash communicate with the HTML file.  At a basic level, the <code>object</code> tag will need to look something like this:</p>
<p><a href="http://www.hesslerdesign.com/blog/wp-content/uploads/2009/11/flashJS_htmlObjectCode1.gif"><img src="http://www.hesslerdesign.com/blog/wp-content/uploads/2009/11/flashJS_htmlObjectCode1.gif" alt="flashJS_htmlObjectCode" title="flashJS_htmlObjectCode" width="542" height="181" class="aligncenter size-full wp-image-232" /></a></p>
<div style="display:block; height:20px; clear:both;"></div>
<h4>Step 2: Write a JavaScript function that targets and calls to Flash</h4>
<p>There must be a JavaScript function that acts as the mediator between HTML and your Flash SWF file. In this JS function, you need to access the SWF file.  This is done by referencing the <code>id/name</code> (see step 1).  In its simplest form, this JS function should look something like this:</p>
<p>
<code><strong>function</strong> jsSayHello<span style="color: #000099;">() {</span><br />
&nbsp; &nbsp;<span style="color: #000099;">var</span> mySWF;<br />
&nbsp; &nbsp;mySWF = <span style="color: #990099;">document</span>.helloSWF;<br />
&nbsp; &nbsp;<span style="color: #000099;">if (</span><span style="color: #0000FF;">!</span>mySWF<span style="color: #000099;">) {</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #990099;">window</span>.helloSWF;<br />
&nbsp; &nbsp;<span style="color: #000099;">}</span><br />
&nbsp; &nbsp;mySWF.sayHello<span style="color: #000099;">()</span>;<br />
<span style="color: #000099;">}</span></code>
</p>
<p>In this example, you&#8217;ll notice a variable that get set to <code>document.helloSWF</code>.  If you&#8217;re using a browser that doesn&#8217;t recognize the &#8216;<code>document</code>&#8216; syntax, the conditional statement catches it, and uses &#8216;<code>window</code>&#8216; to reference the SWF file. Once the variable is set, you can simply call the function you wish to call in your Flash file by using the syntax &#8220;<code>jsVariable.flashFunctionName()</code>&#8220;.  In our example, this is the line &#8220;<code>mySWF.sayHello<span style="color: #000099;">()</span>;</code>&#8220;.</p>
<div style="display:block; height:20px; clear:both;"></div>
<h4>Step 3: Set functions and ExternalInterface properties in Flash</h4>
<p>In your Flash file, you need to import the <code>ExternalInterface</code> Class, and add a callback that listens for the function being called from outside of the Flash file.  When adding the callback, you also need to specify the function to run in your Flash file when it gets instructed to do so from the outside world.  The code snippet below provides the basic structure of what you&#8217;ll need:</p>
<p>
<code><span style="color: #0000ff;">import flash.external.*</span>;<br />
<span style="color: #0000ff;">ExternalInterface.addCallback</span>(<span style="color: #009900;">'sayHello'</span>, helloWorld);<br />
<span style="color: #0000ff;">function</span> helloWorld():<span style="color: #0000ff;">void</span> {<br />
&nbsp; &nbsp;<span style="color: #bbbbbb;">// Insert actions</span><br />
}</code>
</p>
<p>In this example, you&#8217;ll notice the <code>addCallback</code> accepts two parameters: (1) a String that is the function called from outside of Flash, and (2) a function inside of Flash to run.</p>
<p>If you want to have Flash call out to JavaScript, you can use the <code>ExternalInterface.call</code> method to call a JavaScript function.  For example, if you wanted to call a JS function named &#8220;hiFromFlash&#8221;, the ActionScript code would look something like this:</p>
<p>
<code><span style="color: #0000ff;">ExternalInterface.call</span>(<span style="color: #009900;">'hiFromFlash'</span>);</code>
</p>
<p>If you need to pass parameters, simply add them after the function call, separated by commas.</p>
<div style="display:block; height:20px; clear:both;"></div>
<p>So there you have it. With these three items, you will be all set to have your Flash file be able to receive instructions from its parent file.  Until next time, happy coding!</p>
<p><a href="http://www.hesslerdesign.com/blog/wp-content/uploads/2009/11/AS-JS-Communication.zip">Download source files &raquo;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hesslerdesign.com/blog/flash/making-your-flash-application-communicate-with-the-outside-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Building a Better Email Validator in Flash</title>
		<link>http://www.hesslerdesign.com/blog/flash/building-a-better-email-validator-in-flash/</link>
		<comments>http://www.hesslerdesign.com/blog/flash/building-a-better-email-validator-in-flash/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 21:55:25 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=147</guid>
		<description><![CDATA[I work on a lot of Flash projects that require form validation. One issue that keeps coming up is the process of field validation, and more specifically, email validation. There are numerous rules that people use to validate email addresses (does it contain an @ sign, does it contain a dot, how many characters are [...]]]></description>
			<content:encoded><![CDATA[<p>I work on a lot of Flash projects that require form validation. One issue that keeps coming up is the process of field validation, and more specifically, email validation. There are numerous rules that people use to validate email addresses (does it contain an @ sign, does it contain a dot, how many characters are there, etc.), but there is a fine line between overly strict validation and validation that&#8217;s way too loose. So I did some investigating about what makes up an email address, and how to best validate an email address in Flash. The result of my work is a robust EmailValidator class that I authored, written in ActionScript 3.0. <span id="more-147"></span></p>
<p>&nbsp;</p>
<h4>The Validation Logic</h4>
<p>Here&#8217;s a quick rundown of what this EmailValidator class validates:</p>
<ul>
<li>Must contain three parts: [1] Local part, [2] @ sign, [3] Domain</li>
<li>Local part must contain at least one of the following valid characters:
<ul>
<li>Upper and lowercase letters (A-Z, a-z)</li>
<li>Numeric Digits (0-9)</li>
<li>Other characters:  ! # $ % &amp; &#8216; * + &#8211; / = ? ^ _ ` { | } ~</li>
<li>Periods (provided it is not the first or last character, and does not appear more than two times consecutively)</li>
</ul>
</li>
<li>Domain must contain at least one period, as well as at least one character before the period as well as a valid top-level domain (i.e. com, org, ca, uk) after the last period.  Valid domain characters include:
<ul>
<li>Upper and lowercase English letters (A-Z, a-z)</li>
<li>Numeric Digits (0-9)</li>
<li>Hyphens</li>
<li>Periods (provided it is not the first or last character, and does not appear more than two times consecutively)</li>
</ul>
</li>
</ul>
<p>With that list of validation logic written, I must also confess that, technically speaking, quoted strings and spaces (so long as they are within quotes) are valid in the local-part of an email. However, on the Internet Engineering Task Force (IETF) website, <a href="http://tools.ietf.org/html/rfc5321" target="_blank">RFC 5321 Section 4.1.2</a> contends that,</p>
<blockquote><p><em>&#8220;&#8230;a host that expects to receive mail SHOULD avoid defining mailboxes where the Local-part requires (or uses) the Quoted-string form&#8230;&#8221;</em></p></blockquote>
<p>Since the practice of using quoted strings is discouraged by RFC 5321, the logic in my EmailValidator class does NOT allow quoted strings, including the double-quote character and spaces.</p>
<p>&nbsp;</p>
<h4>An Example</h4>
<p>I have included a small Flash email validator file below that you can test the validity of an inputted email address.  It utilizes the EmailValidator class that I have written.  Feel free to test out a range of email addresses.  Note that the validator gives useful feedback about invalid addresses, specifying what the first encountered issue is when checking whether or not the address valid.</p>
<p>&nbsp;</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="414" height="108" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0"><param name="src" value="http://www.hesslerdesign.com/blog/wp-content/uploads/2009/09/email.swf" /><embed type="application/x-shockwave-flash" width="414" height="108" src="http://www.hesslerdesign.com/blog/wp-content/uploads/2009/09/email.swf"></embed></object></p>
<p>&nbsp;</p>
<h4>Known Issues &#038; Exceptions:</h4>
<ol>
<li>Many email providers out there will only accept letters, digits and hyphens as valid in the local part of the email. Though this is becoming more common, the EmailValidator class will still allow any of the valid characters listed above, even if it results in an invalid email address for a specific email client (i.e. */+@gmail.com). This is done to follow the direction of RFC 5322, and the list of valid atom characters listed in Section 3.2.3 that can be included in the local part of an email. Until this list is deprecated (if ever), it&#8217;s an exception I&#8217;m willing to live with.</li>
<li>Though the EmailValidator checks for a valid domain (including only alpha characters, numbers and hyphens, as well as valid top-level domain), there&#8217;s no way to tell whether the domain actually exists. (For example, me@fake.net will validate, though www.fake.net may not be a valid site/domain.)</li>
</ol>
<p>&nbsp;</p>
<h4>Resources:</h4>
<p><a href="http://www.ietf.org/rfc.html" target="_blank">Internet Engineering Task Force (IETF)</a><br />
<a href="http://www.iana.org/domains/root/db/" target="_blank">Internet Assigned Numbers Authority (IANA)</a></p>
<p>&nbsp;</p>
<p>Interested in getting this EmailValidator class for your own use? <a href="http://www.hesslerdesign.com/#/contact">Contact me</a> to request a copy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hesslerdesign.com/blog/flash/building-a-better-email-validator-in-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sending Flash Data to ASPX or PHP files</title>
		<link>http://www.hesslerdesign.com/blog/flash/sending-flash-data-to-aspx-or-php-files/</link>
		<comments>http://www.hesslerdesign.com/blog/flash/sending-flash-data-to-aspx-or-php-files/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 15:54:25 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[aspx]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=1</guid>
		<description><![CDATA[If you are working on any Flash website projects that need to pass data out to an ASPX or PHP file (or any other type of file requiring to send data via POST or GET), you can use the code below.  Note that this code is written in ActionScript 3. /* --- Begin Code --- [...]]]></description>
			<content:encoded><![CDATA[<p>If you are working on any Flash website projects that need to pass data out to an ASPX or PHP file (or any other type of file requiring to send data via POST or GET), you can use the code below.  Note that this code is written in ActionScript 3.</p>
<p><code><span style="color:#999999;">/* --- Begin Code --- */</span></code><br />
<code><span style="color: #0000ff;">var</span> firstName:<span style="color: #0000ff;">String</span> = <span style="color: #009900;">"Anthony"</span>;</code></p>
<p><code><span style="color: #0000ff;">function</span> submitForm(e:<span style="color: #0000ff;">MouseEvent</span>):<span style="color: #0000ff;">void</span> {</code><br />
<code>&nbsp; &nbsp;<span style="color: #0000ff;">var</span> varsToSend:<span style="color: #0000ff;">URLVariables</span> = <span style="color: #0000ff;">new URLVariables</span>();</code><br />
<code>&nbsp; &nbsp;varsToSend.firstName = firstName;</code><br />
<code>&nbsp; &nbsp;<span style="color: #999999;">// Insert additional values to send</span></code></p>
<p><code>&nbsp; &nbsp;<span style="color: #999999;">// Create URL Request, set to POST, and attach data</span></code><br />
<code>&nbsp; &nbsp;<span style="color: #0000ff;">var</span> formRequest:<span style="color: #0000ff;">URLRequest</span> = <span style="color: #0000ff;">new URLRequest</span>(<span style="color: #009900;">"flash.php"</span>);</code><br />
<code>&nbsp; &nbsp;formRequest.<span style="color: #0000ff;">method</span> = <span style="color: #0000ff;">URLRequestMethod.POST</span>;</code><br />
<code>&nbsp; &nbsp;formRequest.<span style="color: #0000ff;">data</span> = varsToSend;</code></p>
<p><code>&nbsp; &nbsp;<span style="color: #999999;">// Create URL Loader, attach listeners, and load URL Request</span></code><br />
<code>&nbsp; &nbsp;<span style="color: #0000ff;">var</span> varLoader:<span style="color: #0000ff;">URLLoader</span> = <span style="color: #0000ff;">new URLLoader</span>;</code><br />
<code>&nbsp; &nbsp;varLoader.<span style="color: #0000ff;">addEventListener</span>(<span style="color: #0000ff;">Event.COMPLETE</span>, onLoaded);</code><br />
<code>&nbsp; &nbsp;varLoader.<span style="color: #0000ff;">addEventListener</span>(<span style="color: #0000ff;">IOErrorEvent.IO_ERROR</span>, ioErrorHandler);</code><br />
<code>&nbsp; &nbsp;varLoader.<span style="color: #0000ff;">load</span>(formRequest);</code><br />
<code>}</code></p>
<p><code><span style="color: #0000ff;">function</span> onLoaded(e:<span style="color: #0000ff;">Event</span>):<span style="color: #0000ff;">void</span> {</code><br />
<code>&nbsp; &nbsp;<span style="color: #999999;">// Insert success actions here</span></code><br />
<code>}</code></p>
<p><code><span style="color: #0000ff;">function</span> ioErrorHandler(e:<span style="color: #0000ff;">IOErrorEvent</span>):<span style="color: #0000ff;">void</span> {</code><br />
<code>&nbsp; &nbsp;<span style="color: #999999;">// Insert error actions here</span></code><br />
<code>}</code><br />
<code><span style="color:#999999;">/* --- End Code --- */</span></code></p>
<p>A few notes on the code:</p>
<ul>
<li>The <code>submitForm</code> function in this example is called on a <code>MouseEvent.CLICK</code> event (noted with the <code>e:MouseEvent</code> passed into the function).</li>
</ul>
<ul>
<li>If you need to send via GET, change the <code>URLRequestMethod</code> to <code>URLRequestMethod.GET</code>.</li>
</ul>
<ul>
<li>One thing I noticed about the <code>URLRequest</code> was that on the particular domain I was working on, using an absolute URL gave me some bugs.  If I used http://www.myfakedomain.com/flash.aspx, my tests failed on PCs but worked on Macs.  If I removed the “www”, resulting in http://myfakedomain.com/flash.aspx, my tests failed on Macs, but worked on PCs. I don’t know if this was an issue with how the domain was set up (since I only worked on the Flash portion, not setting up the domain) or if it is a Flash <code>URLRequest</code> bug.  Either way, I found that using a relative URL (“flash.aspx”) worked on Macs and PCs, and didn’t throw me any errors.</li>
</ul>
<p>Hope this sheds some insight on how to send data out of Flash.  Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hesslerdesign.com/blog/flash/sending-flash-data-to-aspx-or-php-files/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

