<?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>Seagull Code Nodes</title>
	<atom:link href="http://blog.joshuasiegal.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.joshuasiegal.com</link>
	<description></description>
	<lastBuildDate>Tue, 05 Oct 2010 06:25:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>10 Ways Agile Development Fails</title>
		<link>https://blog.joshuasiegal.com/2010/10-ways-agile-development-fails/</link>
		<comments>https://blog.joshuasiegal.com/2010/10-ways-agile-development-fails/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 05:15:34 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://blog.joshuasiegal.com/?p=208</guid>
		<description><![CDATA[I recently read through 37 Signals&#8217; excellent manual, Getting Real.  It describes in detail a successful method for developing and launching web-based software.  Many of its tenets are based on the principles of Agile Development, first articulated by Kent Beck et al in The Agile Manifesto.  There is so much hope and good will in [...]]]></description>
			<content:encoded><![CDATA[<p>I recently read through 37 Signals&#8217; excellent manual, <em><a title="Getting Real" href="http://gettingreal.37signals.com/toc.php" target="_blank">Getting Real</a></em>.  It describes in detail a successful method for developing and launching web-based software.  Many of its tenets are based on the principles of Agile Development, first articulated by Kent Beck et al in <em><a title="The Agile Manifesto" href="http://agilemanifesto.org/principles.html" target="_blank">The Agile Manifesto</a></em>.  There is so much hope and good will in these documents &#8211; it makes me a little sad.  Agile started out as a way to free software developers from the chains of a brittle, dogmatic technology age, where change was viewed as expensive and collaboration dangerous.  Agile is supposed to tilt development toward the ways in which developers naturally work.  Despite its promise, agile has become one of those professional chew-toys that has been so thoroughly mangled and salivated over, it&#8217;s barely recognizable anymore.  Many of its principles have been diluted by blind adoption.  At the same time, Agile Development has a dark side.  It&#8217;s the perfect crutch for refusing to do the diligence that&#8217;s required on many tech projects, and, sadly, for denying developers the avenues it was meant to open.</p>
<p>Agile Development is in danger of slipping into the ditch already occupied by brainstorming sessions, train-the-trainer, and team-building: that of management double-speak and great ideas used as excuses to continue the same old practices.<span id="more-208"></span></p>
<p>I know I&#8217;m not the first person to point all this out &#8211; however, unlike many of them, I don&#8217;t see Agile as a panacea or a ploy.  It is precisely because I believe in the principles of Agile Development that I feel a little twinge of pain when I see it going wrong.  Rather than trying to forecast why it must fail or trumpet its invincibility, this post is simply trying to paint some yellow stripes on the bumps in the road, in the inevitable web list format:</p>
<p><strong>1) Working From Small To Large</strong> &#8211; Agile Development aims to put practical decision-making in the hands of the people doing the work.  This sounds dangerous to the people who ostensibly have the &#8220;vision&#8221;, as they realize that real-world concerns are shaping &#8220;their&#8221; project.  However, this is only a problem when there are errors in the vision in the first place.  As <em>Getting Real</em> aptly points out, this style can only work when a motivated team understands and embraces the vision of the project.  If management thinks, &#8220;well, I&#8217;ve got a superb and agile team of developers over here and a great concept over here &#8211; now all I have to do is start assigning tasks&#8221;, the project is doomed to snarl.  After all, agile development teams don&#8217;t need reams of documentation and planning, right?  <em>Sometimes</em> that&#8217;s true, and then only if they deeply understand the goals of the project.  Agile Development is like high-end audio gear.  It can make everything shine, but it will also highlight all the flaws.  Make the effort to get your direction aligned before you start your project running.  You want a nimble bobsled team, not a game of tag.</p>
<p><strong>2) Agile Development on a Non-Agile Project</strong> &#8211; How many workstations have felt the concussion of a developer&#8217;s forehead after the project manager (or the project manager&#8217;s manager) stops by to report that the glorious, elegant solution the developer came up with is nixed for a reason that the developer herself had pointed out weeks, maybe months ago.  Agile teams are supposed to respond to change quickly and enthusiastically.  However, agile precepts are corrupting when applied to non-agile projects.  If the business isn&#8217;t sure what they want, it means trouble for most projects, but an immediate fail for an agile project, which is better adapted to change, but also more vulnerable to it.  Even cases where the business side is focused may not be suitable for agile methods.  For example, one of the main tenets of Agile Development is that developers and business units collaborate to find the best approach for the customer.  If you are Apple, you make your living by exceeding the curve and leading your customers (in theory) to the right place.  However, if you are in an industry that requires stable, trusted solutions (banking would be one that comes to mind), you would do well to temper that agile enthusiasm with a solid dose of risk assessment.</p>
<p><strong>3) Teams Not Independent</strong> &#8211; Unlike the previous examples, this one is a prime example of giving lip service to an idea while ignoring it completely in the day-to-day life of a project.  Micromanagement and agile do not go well together.  Though this is a well-known problem in many types of projects, it actually goes against everything agile stands for.  <em>The Agile Manifesto</em> points out that face-to-face discussions are the most effective means of conveying information.  But what do you do when you&#8217;re having a face-to-face conversation with someone who wants to insert personal preferences into his developers&#8217; work?  Or when management cannot protect the team from peripheral, time-sapping requests?  In these cases, it may be best to put your nose to the grindstone and polish up your resume.</p>
<p><strong>4) Over-Employment</strong> &#8211; So far, we&#8217;ve touched on common problems, but this point is rooted directly in the areas where agile excels.  The concepts of Agile Development have proven so successful that many developers expect to find them on day one: being able to call on business personnel to clarify / collaborate over requirements and solutions; the use of small teams to accomplish discrete tasks; flexibility in planning; experimentation and prototyping as integral to the development process.  When you&#8217;ve got it, you don&#8217;t need to push it.  You don&#8217;t want to show off the strings you just cut and find yourself holding the strings in the process.  If your developers are in the comfort zone, don&#8217;t push them out of it just to try and fulfill what someone says is &#8220;properly&#8221; agile.</p>
<p><strong>5) Scope Defenses Are Down</strong> &#8211; We&#8217;ve all heard that change is key to success, and in the world of software development, the ability to rapidly change direction can mean a decisive edge on the competition.  But there is a big difference between an agile redirection of resources and a stumbling, careening project that no longer knows where it&#8217;s going.  Part of this involves scope.  Imagine a current of water traveling through a gulley.  You realize you need to divert the gulley 90 degrees to the left.  What happens if you dig out a leftward channel but also leave the gulley intact?  Imagine doing this every time the project needs a change &#8211; you are left with a flooded delta, not an effective change.  If developers or managers are thinking &#8220;this is an agile project, so scope creep shouldn&#8217;t matter&#8221;, they are lining themselves up for a waste of resources and a messy, unfocused project &#8211; there is nothing agile about that.</p>
<p><strong>6) Weak Push-Back</strong> &#8211; If <em>Getting Real</em> gets unrealistic at points, it&#8217;s probably in the area of push-back on feature requests.  Sure, if you&#8217;re a crack team of multitalented developers and designers with a shared vision and a successful product, you can afford to ride out an initial wave of resistance as customers adjust to your latest release.  When you have a corporate customer relations manager whose phone banks are blowing up, and he&#8217;s coming over to speak with your boss, things &#8220;get real&#8221; in a hurry.  For Agile Development to fulfill its promise of responsiveness, developers must &#8211; somewhat ironically &#8211; be allowed to provide context to the business.  As usual, communication early and often is key.  Remember that good developers want their applications to be effective and well-received.  Imagine that your team and the business are on the same page, you think you have a brilliant answer, you roll it out, and the users hate it &#8211; and continue hating it.  Agile Development can really shine for you here.  Now imagine the same situation, except that the developers knew users would hate it, and they said so, but you didn&#8217;t listen?  How is the fix going to go?</p>
<p><strong>7) Paying The Bills</strong> &#8211; An agile team should, according to <em>The Agile Manifesto</em>, be able to run indefinitely, making changes and adjustments, keeping up a regular pace.  This does not mean, however, that kludges and workarounds should be allowed to fester when they can be cleaned up.  <em>Get Real</em> puts it well: &#8220;The same way you should regularly put aside some of your income for taxes, regularly put aside some time to pay off your code and design debt. If you don&#8217;t, you&#8217;ll just be paying interest (fixing hacks) instead of paying down the principal (and moving forward).&#8221;  If your team is maintaining a constant pace, they&#8217;ll be fixing these issues eventually.  Better to account for it.</p>
<p><strong>8) How Do We Do This</strong> &#8211; Agile Development requires not just developer feedback on the project itself, but developer feedback on the process.  <em>The Agile Manifesto</em> calls this &#8220;tuning&#8221;, and requires it at regular (and, we can assume, scheduled) intervals.  Failure to pay heed to this tenet of the manifesto results in what I like to call &#8220;Casual Development&#8221;, with everyone plugging along, ignoring opportunities to create efficiency and save time and money.  Can there be a better rationale to the business side than &#8220;this will save you time and money&#8221;?  A regular reflective breather helps create more smoothly running teams and exposes issues that may be silently eating away at a project.  It also gives deeper meaning to the term &#8220;agile&#8221; itself: the ability for a team to self-diagnose and fix issues before they arise.</p>
<p><strong>9) Docu-drama</strong> &#8211; As someone who enjoys writing, making diagrams, and having sensible project outlines, I&#8217;ve never had a problem with documentation, unless it&#8217;s bad documentation.  Some developers and managers act like documentation is a pure waste of time, or else as archaic as stone tablets.  This is hubris.  Thinking that having an agile project means documentation is superfluous is to ignore the experience and wisdom of others &#8211; is your project so cutting edge that no one has ever attempted anything like it before?  Then maybe you don&#8217;t need documentation, and you can just wing it on the strength of your genius.  Will no one ever touch your application besides you and your team?  Surely if they do, they will simply read through your sublimely intuitive and graciously commented code and instantly intuit exactly what is going on.  Just like pre-writing is a great creative exercise for all kinds of non-linguistic projects, documentation is immensely helpful to produce, even if you think you&#8217;ll never need it.  Go ahead, get your thoughts, your vision, your risks and assumptions, you technical specs down on paper.  You may be very glad you did.</p>
<p><strong>10) Users?  What users?</strong> &#8211; Oh, the poor, poor users.  Who is looking out for them in the world of Agile Development?  One of the main creeds of Agile Development is that <em>everyone</em> should be looking out for the souls who have to use our wonderful applications.  Too often, no one is looking out for the user, so caught up are they in the idea that in the modern, agile era of development, all the user has to do is wait until the next release.  The truth is that sometimes the business and the development teams get together and end up with zero idea of how users are going to react.  Here we come full-circle: some projects are well cut out for Agile Development, and some are not.  If you are a small startup and you&#8217;re desperately trying to get your app to market, agile may be what you&#8217;re looking for.  If you&#8217;re in the midst of transitioning a legacy application that thousands of users are relying on daily, you may want to (shudder) think of your users first and your developers second.  As I&#8217;ve pointed out, many agile habits have already worked their way into the mainstream, so don&#8217;t be afraid to be a bit selective about how far you want to push the methodology on any given project.  At 37 Signals, users can marvel at the process, but that doesn&#8217;t mean your users necessarily want to be made aware of your process.  It pays to spend the time and effort to get to know your users.</p>
<p>Agile Development is neither a gift from above nor a mere trend &#8211; it&#8217;s an important crystallization of ideas that can often provide real clarity of purpose for developers and help projects adjust to a fast-changing world.  But it can also be a destructive force if used carelessly.  It&#8217;s like business casual: it can be fun and freeing, but in some circumstances and some hands, it can be disastrous.  I hope this post helps you choose your outfit wisely.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.joshuasiegal.com/2010/10-ways-agile-development-fails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash in the Pan?  Hardly</title>
		<link>https://blog.joshuasiegal.com/2010/flash-in-the-pan-hardly/</link>
		<comments>https://blog.joshuasiegal.com/2010/flash-in-the-pan-hardly/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 16:49:44 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://blog.joshuasiegal.com/?p=204</guid>
		<description><![CDATA[By now, I would guess that over 95% of people interested in Flash have read the Steve Jobs blog rant about why Apple will never implement it on its mobile devices.  That&#8217;s the same percentage of web browsers that have Flash installed, beating Java, Quicktime, Windows Media Player, and so on.  There is a greater [...]]]></description>
			<content:encoded><![CDATA[<p>By now, I would guess that over 95% of people interested in Flash have read the <a title="Jobs Jobbing Flash" href="http://www.apple.com/hotnews/thoughts-on-flash/" target="_blank">Steve Jobs blog rant</a> about why Apple will never implement it on its mobile devices.  That&#8217;s the <a title="Browser Plugin Stats" href="http://lh4.ggpht.com/_GlFxNI53m0o/S8oYyVt0ysI/AAAAAAAAAGA/-yNo-tjCaP4/browser%20chart.PNG" target="_blank">same percentage of web browsers that have Flash installed</a>, beating Java, Quicktime, Windows Media Player, and so on.  There is a greater likelihood that your site is going to be viewed correctly in Flash than in any browser, no matter how standards-compliant.</p>
<p>With the iPod and iPhone, Apple looked like world-beaters, and when the app store opened, developers flocked to pay Apple $100 for the privilege of downloading the app SDK; they began furiously pumping out apps and biting their fingernails while Apple&#8217;s team personally verified the worthiness of each app.  Okay, we get it: part of the iPhone experience is knowing that every app has been tested and approved; it&#8217;s quality control.</p>
<p>It seems that much of the debate right now is whether Flash is an open standard and/or whether apps written in objective C are open and/or which company is behaving like the biggest crybaby.  Really, neither is an open standard.  If you want to develop an iPhone app on a Windows machine or if you&#8217;re looking to compile some Actionscript without running Flash, you have to use third-party software in either case.  These companies are like two toddlers whining at one another for not wanting to share their toys.</p>
<p><span id="more-204"></span></p>
<p>Jobs does have some points &#8211; Flash is not the best for use in iPhone apps, and not just because adopting it for the app store would punish all of Apple&#8217;s loyal developer community, who plunked down dollars for the SDK.  Having developed in Flash, I&#8217;m willing to believe Apple&#8217;s claims about Flash&#8217;s memory issues (remember ye olde garbage collection issues?).  However, WebKit is the best mobile browser anyone has ever seen, and it doesn&#8217;t support Flash.  On this point, there seems to be no good rationale.</p>
<p>Let Apple keep Flash out of the app store.  That&#8217;s their bread and butter &#8211; okay.  But creating a mobile web browser that doesn&#8217;t support the plugin that&#8217;s installed on over 95% of desktop browsers &#8211; including safari &#8211; is just bitterness manifested.  Other mobile browsers support Flash, and yet Apple seems too content to let the market pass them by in this regard.</p>
<p>The worst part is that Jobs and his supporters are offering HTML5 as a panacea.  Sure, it&#8217;ll be great &#8211; whenever it&#8217;s fully supported &#8211; but its video component will lack much that Flash is able to do fairly easily now (real interactivity, for example), and its codec of choice, H.264, is proprietary.  Having most players agree on a proprietary format is not the same thing as an open standard.  Oh, and it <a title="Flash Here To Stay?" href="http://theiphonefever.blogspot.com/2010/04/5-reasons-flash-is-here-to-stay.html" target="_blank">leaves out Firefox</a>, which is, by the way, open.   It&#8217;s like telling commuters that everything will be great when we get our hovercars that run on solar power.  In the meantime, your car is not welcome on our road.  Jobs and his backers may have a point that Adobe treated Apple like a second-class citizen back in the 90s.  Which they were.  Now, I love my Apple products like anyone else drinking the multimedia development koolaid, but wasn&#8217;t Adobe doing the same thing to Apple back then that Apple is trying to do to Adobe now?  If the open revolution proved anything, it&#8217;s that having a zen-like indifference to such petty squabbles produces winners.  Did Zend worry about Microsoft?</p>
<p>Jobs&#8217; blog post hints at the decades of recrimination by recalling the early days when Adobe and Apple were both based in similar garages.  Get over it.  It&#8217;s Final Cut Pro and Aftereffects.  No one will ever use the combination of Premiere and Motion.  Flash is better for the web.  Mac apps are better for Apple devices.</p>
<p>It seems that offering Flash support in Apple&#8217;s mobile WebKit browser while keeping Adobe out of the app store market would make everyone relatively happy, but unfortunately, it seems such realism is lacking in the relatively closed and high-ego world of large-scale software development.</p>
<p><span style="text-decoration: underline;">update</span>: <a title="Proof of Flash on iPhone?" href="http://www.techradar.com/news/computing/apple/steve-jobs-doesn-t-know-what-the-iphone-can-do-says-adobe-641520" target="_blank">proof Flash can hang on Apple mobile devices after all?</a></p>
]]></content:encoded>
			<wfw:commentRss>https://blog.joshuasiegal.com/2010/flash-in-the-pan-hardly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rel Isn&#8217;t That Nice</title>
		<link>https://blog.joshuasiegal.com/2010/rel-isnt-that-nice/</link>
		<comments>https://blog.joshuasiegal.com/2010/rel-isnt-that-nice/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 17:44:25 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[semantic]]></category>

		<guid isPermaLink="false">http://blog.joshuasiegal.com/?p=202</guid>
		<description><![CDATA[Just a quick post to talk about how much I&#8217;m loving the rel tag these days.   Defining custom values for this attribute may not be strictly validated, but there seems to be some debate about this, and with HTML 5, we&#8217;re going to be moving that way with the all-encompassing data- tag. But for now, [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick post to talk about how much I&#8217;m loving the rel tag these days.   Defining custom values for this attribute may not be strictly validated, but there seems to be some debate about this, and with HTML 5, we&#8217;re going to be moving that way with the all-encompassing <a title="The HTML5 data tag" href="http://www.danwebb.net/2010/1/27/put-that-data-attribute-away-son-you-might-hurt-someone" target="_blank">data-</a> tag.</p>
<p>But for now, the rel tag is easy, supported, and makes getting a little bit of meta information to your script quite easy.</p>
<p>Two uses I&#8217;ve written recently are:</p>
<p>(1) Creating abstracted div collapse scripts.  The script just looks at the rel tag for the link and finds the matching rel tag among a class of divs on the page.  Anything matching is shown, anything not matching is hidden.  I never have to go back and touch the script, and I only have to add a rel tag to my divs.</p>
<p>(2) Letting my css-based navigation know which page we&#8217;re currently on.  With includes, the idea that your navigation should reflect your current page location fell out of favor a bit.  Kind of suspicious, if you ask me.  It often seems designers and front-end developers adapt their pet styles to suit the latest technology.  Regardless, it&#8217;s dang easy with the rel tag to revert to the &#8220;old&#8221; style of location-aware navigation.  I just drop a rel tag in my nav links and a matching rel tag in my content div within the content include file.  They search for each other.  They find one another.  It&#8217;s like an interface component romance paperback.</p>
<p>Part of the reason that HTML 5 is going to include some developer-defined tags is that people have been using rel and a few other tags to include meta data (and sometimes some not-so-meta data) in their front-end code.  I completely understand the cold chill that comes over some folks when they start contemplating gobs of data gooping up the front end.  I also think it&#8217;s possible to fret too much.  As the linked article above points out well, it&#8217;s possible to include some meta data inline and still be semantically useful, degrade nicely, and not offend the browser.</p>
<p>If people hadn&#8217;t been expanding on the uses of the rel attribute so effectively, we may not have had the push for user-defined attributes in HTML 5.  This is a good thing.  It&#8217;s important to remember this truism: no amount of standards will stop people from writing ugly code.  But, paying attention to what developers are doing in practice and honoring those practices in new standards definitions can benefit everyone.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.joshuasiegal.com/2010/rel-isnt-that-nice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jsFloater is top ten on google!</title>
		<link>https://blog.joshuasiegal.com/2010/jsfloater-is-top-ten-on-google/</link>
		<comments>https://blog.joshuasiegal.com/2010/jsfloater-is-top-ten-on-google/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 23:38:53 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[jsFloater]]></category>
		<category><![CDATA[liquid]]></category>

		<guid isPermaLink="false">http://blog.joshuasiegal.com/?p=189</guid>
		<description><![CDATA[Celebrating jsFloater&#8217;s appearance on the first result page in a google search for &#8220;Flash Liquid GUI&#8221;! We&#8217;re just psyched to be in a google result page with the likes of James O&#8217;Reilly and actionscript.org. Hooray!  If you haven&#8217;t checked out the code yet, by all means please do.]]></description>
			<content:encoded><![CDATA[<p>Celebrating jsFloater&#8217;s appearance on the first result  page in a <a title="google search for &quot;flash liquid gui&quot;" href="http://www.google.com/#hl=en&amp;q=flash+liquid+gui&amp;aq=f&amp;aqi=&amp;oq=&amp;fp=c26c79a56c95bda8" target="_blank">google search</a> for &#8220;Flash Liquid GUI&#8221;!</p>
<div id="attachment_193" class="wp-caption aligncenter" style="width: 410px"><a href="http://www.google.com/#hl=en&amp;q=flash+liquid+gui&amp;aq=f&amp;aqi=&amp;oq=&amp;fp=c26c79a56c95bda8" target="_blank"><img class="size-full wp-image-193  " style="border: 0pt none;" title="jsFloater in google's top ten results for flash liquid gui" src="http://blog.joshuasiegal.com/wp-content/uploads/2010/02/jsFloaterTopTen1.png" alt="Hangin at the Bottom" width="400" height="129" /></a><p class="wp-caption-text">Hangin at the Bottom</p></div>
<p>We&#8217;re just psyched to be in a google result page with the likes of James O&#8217;Reilly and actionscript.org.</p>
<p>Hooray!  If you haven&#8217;t checked out the code yet, by all means <a title="jsFloater" href="http://blog.joshuasiegal.com/jsFloater/" target="_blank">please do</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.joshuasiegal.com/2010/jsfloater-is-top-ten-on-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Three, Can&#8217;t Wait for Thee</title>
		<link>https://blog.joshuasiegal.com/2010/css-three-cant-wait-for-thee/</link>
		<comments>https://blog.joshuasiegal.com/2010/css-three-cant-wait-for-thee/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 18:22:13 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://blog.joshuasiegal.com/?p=182</guid>
		<description><![CDATA[Well, it&#8217;s not exactly what I&#8217;ve been asking for, but it&#8217;s actually quite a bit better than what I thought we might get.  Like wanting a pony for christmas and getting a great dane. It looks like CSS3 will have some pretty cool new attributes available for us developers.  Of course, it&#8217;s all proposed and [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Well, it&#8217;s not exactly what I&#8217;ve been <a title="A Call For CSS Math" href="http://blog.joshuasiegal.com/2009/a-call-for-css-math/">asking for</a>, but it&#8217;s actually quite a bit better than what I thought we might get.  Like wanting a pony for christmas and getting a great dane.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://theblackboxoffice.com/wp-content/uploads/marmaduke.gif" alt="http://theblackboxoffice.com/wp-content/uploads/marmaduke.gif" /></p>
<p style="text-align: left;">It looks like CSS3 will have some pretty cool new attributes available for us developers.  Of course, it&#8217;s all proposed and not released yet, but let&#8217;s start salivating anyway:</p>
<p><span id="more-182"></span></p>
<p style="text-align: left;">One really cool thing with the potential for hilarious abuse of power is a proposed scale attribute.  Use your own imagination on that one.</p>
<p style="text-align: left;">But that&#8217;s not the best.  The best (if truly implemented) would be a set of CSS specs for creating a multicolumn layout without having to resort to javascript trickery, fakey background images, or ridiculous amounts of div nesting.  <em>Great news, everyone!</em></p>
<p style="text-align: center;"><em><img class="size-full wp-image-198 alignnone" title="professor farnsworth" src="http://blog.joshuasiegal.com/wp-content/uploads/2010/02/farnsworth.jpg" alt="professor farnsworth" width="470" height="330" /><br />
</em></p>
<p style="text-align: left;">Found on these <a title="sixrevisions: CSS3 techniques" href="http://sixrevisions.com/css/css3-techniques-you-should-know/" target="_blank">sixrevisions</a> <a title="sixrevisions: CSS3 resources" href="http://sixrevisions.com/css/20-useful-resources-for-learning-about-css3/" target="_blank">posts</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.joshuasiegal.com/2010/css-three-cant-wait-for-thee/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sufferin Semantics! XML, HTML, jQuery, and MSIE</title>
		<link>https://blog.joshuasiegal.com/2010/sufferin-semantics-xml-html-jquery-msie/</link>
		<comments>https://blog.joshuasiegal.com/2010/sufferin-semantics-xml-html-jquery-msie/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 22:54:32 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[semantic]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://blog.joshuasiegal.com/?p=168</guid>
		<description><![CDATA[So, in a recent project, I&#8217;m consuming xml data and pulling out some text for a description field on an html page.  I&#8217;ve got some basic stuff, text for title information, paths to asset files stored as node attributes, the usual.  But something is bugging me.  I&#8217;ve included some html in my descriptions, all formatted [...]]]></description>
			<content:encoded><![CDATA[<p>So, in a recent project, I&#8217;m consuming xml data and pulling out some text for a description field on an html page.  I&#8217;ve got some basic stuff, text for title information, paths to asset files stored as node attributes, the usual.  But something is bugging me.  I&#8217;ve included some html in my descriptions, all formatted according to xhtml standards, but it won&#8217;t be parsed by jQuery.</p>
<p>Dagnabit!  What is the point of combining xml and html standards if I can&#8217;t use them together all the time?  I know, you may be thinking, but xml is not html , no matter what you throw into your nodes.  You&#8217;re right, and this is exactly what jQuery tells us.  You can grab the text contents of any node, but if you have html tags in there, the <a title="jQuery API - text method" href="http://api.jquery.com/text/" target="_blank">.text()</a> method in jQuery will just look right past them.  As it should.  This works fine, for little snippets like my titles, but what if I want to put some (ostensibly) well-formatted html code in my data?  Further, what about all those applications where you want to store html snips in a database and read them out in XML?  How do you get around this?</p>
<p><span id="more-168"></span></p>
<p>For that, we&#8217;d want to use the <a title="jQuery API - html method" href="http://api.jquery.com/html/" target="_blank">.html()</a> method of jQuery, and for that, my friends, we suddenly get quite strict.  XML, according to jQuery, is not html, and so has no innerHTML quality for the .html() method to grab.  It doesn&#8217;t matter, says jQuery, if your html code is so well formatted that it can be parsed as xml&#8230;it&#8217;s just not possible to access an html-specific property that does not exist.</p>
<p>Like fun, I say!</p>
<p>But before we get to the solution, let&#8217;s heartlessly go over some available options:</p>
<p>1) We could punt on the whole jQuery thing and use Flash, which knows just what to do with a string of html parsed from within an xml node.  Furthermore, Flash has a nifty .htmlText property on its text fields, and although the formatting of said html pales compared to real css, it will faithfully render as html anything you tell it to, caveat codeur.  Since the project in question did involve some Flash, this was an option, but one of the points of the project was to take the same xml data and have both flash and jQuery parse it for different purposes, and thereby provide ease for content providers and improve accessibility.  So doing the whole thing in Flash was out.</p>
<p>2) We could escape the heck out of all our characters and turn the whole node into a mess of html character codes.  Un-fun to code and messy for the content people.  Also, I tried that and it rendered out a block of actual html onto my screen.  I&#8217;m sure I could have reconverted those characters back into actual html behind the scenes, but again, un-fun and a hassle.</p>
<p>3) Use a fancy xml consuming plugin or script.  There are some neat ones out there, and I tried one in particular that looked pretty good, but it seems they have a common issue &#8211; you have to know what tags you&#8217;re looking for in order to seek and replace within the script.  Some of them will hunt for anything that looks like an html tag in the string and convert that, but mostly these plugins seem like scripts that people wrote to perform functions for themselves, and then extracted and shared.  Which I applaud.  But these were not what I was looking for, and I found the implementation sometimes troublesome.</p>
<p>4)<strong> [Warning: bad solution]</strong> Hand jQuery a bag of grapes and say it&#8217;s &#8220;nature&#8217;s jellybeans&#8221; (at least that&#8217;s what my mom used to do to us).  It goes like so: grab your xml file with an <a title="jQuery API - ajax method" href="http://api.jquery.com/jQuery.ajax/" target="_blank">ajax()</a> call, and use the optional key/value pair:</p>
<blockquote><p>dataType: &#8220;html&#8221;</p></blockquote>
<p>And then you&#8217;d do ike so:</p>
<blockquote><p>$.ajax({ url: &#8220;myXMLdoc.xml&#8221;,<br />
dataType: &#8220;html&#8221;,<br />
success: function(xml){<br />
var myHtmlContent = $(&#8216;node&#8217;,xml).eq(id).find(&#8220;nodeName&#8221;).html();<br />
$(&#8220;#targetdiv&#8221;).html(myHtmlContent);<br />
}<br />
});</p></blockquote>
<p>&#8230;and there you have it!  Or, would&#8230;if&#8230;</p>
<p>&#8230;can you see where this is going?</p>
<p>&#8230;search your feelings, Luke&#8230;</p>
<p>&#8230;if only Internet Explorer handled the XMLHTTPRequest result like the rest of the world!  Like most Microsoft stuff, IE, with its <strong>own</strong> version of the XMLHTTPRequest (someone <a title="Microsoft XMLHTTPRequest documentation" href="http://msdn.microsoft.com/en-us/library/ms535874%28VS.85%29.aspx" target="_blank">correct me if I&#8217;m wrong on that</a>), wants to get too clever and won&#8217;t let you, the developer, tell it what kind of data you&#8217;d like to see (even if it&#8217;s either of several types that are verging toward common standard).  No siree!</p>
<p>Supposedly, recent versions of IE (7+) have their own XMLHTTPRequest, not the previous Microsoft HTTPRequest.  However, the Microsoft XMLHTTPRequest doesn&#8217;t behave like the other girls and boys, even in the recent versions of IE.  Now, this post didn&#8217;t start off to be a discussion of the supposed evils of Microsoft&#8217;s proprietary habits.  But who else has almost 11 million results on a <a title="google search: internet explorer sucks" href="http://www.google.com/#hl=en&amp;q=internet+explorer+sucks&amp;aq=f&amp;aqi=&amp;oq=&amp;fp=c26c79a56c95bda8" target="_blank">google search of how much they suck</a>?  Hint: not Chrome (3 M), Firefox (1 M), or Safari (1 M).  (Can&#8217;t evaluate Opera on this critrion because sadly a lot of people out there think that real, actual opera &#8211; the music &#8211; sucks too).  For comparison: &#8220;yanni sucks&#8221; (400 K), &#8220;death metal sucks&#8221; (700 K), &#8220;paris hilton sucks&#8221; (1 M), &#8220;the lions suck&#8221; (1 M), &#8220;tv sucks&#8221; (11 M), and &#8220;new york sucks&#8221; (12 M).  So, yeah.</p>
<p>Anyway, after that turgid digression, <em>finally,</em> we come to the solution.  And&#8230;</p>
<p>It&#8217;s simple!  Maybe I&#8217;m, like, the last one to figure this out, but you just use XML&#8217;s <a title="W3C XML CDATA" href="http://www.w3schools.com/XML/xml_cdata.asp" target="_blank">CDATA</a> declaration, and wrap it around our html code within our xml node.  If I had found that idea earlier, it would have saved me some time, but I would have missed a brain-scratching moment or ten for sure.</p>
<p>Anyway, this is fascinating to me for several reasons:</p>
<p>a) When oh when is Microsoft going to just give up and give us a truly standards-compliant web browser?  Maybe they should spin off a company whose software is intuitive and flexible and plays nice with others.  Oh wait, <a title="apple" href="http://www.apple.com/" target="_blank">they already did that</a>.</p>
<p>b) With the XHTML standard in full force, it seems totally silly that one would have to pass off perfectly valid XHTML within an xml document as CDATA.  Isn&#8217;t the whole point of XHTML to be able to one day have a semantic web, where code itself can be meaningful?  How far away are we when it&#8217;s trouble to get even well-formatted html out of my xml nodes without basically commenting it out?  In theory, that means I can&#8217;t parse through my html elements, which seems to go against the whole ethos of XHMTL.</p>
<p>Well, heck.  I remember when CSS was going to put an end to bad code.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.joshuasiegal.com/2010/sufferin-semantics-xml-html-jquery-msie/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Introducting jsFloater</title>
		<link>https://blog.joshuasiegal.com/2009/introducing-jsfloater/</link>
		<comments>https://blog.joshuasiegal.com/2009/introducing-jsfloater/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 15:00:13 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[jsFloater]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[liquid]]></category>

		<guid isPermaLink="false">http://blog.joshuasiegal.com/?p=13</guid>
		<description><![CDATA[jsFloater is an Actionscript 3 class that allows you to &#8220;liquidify&#8221; (create liquid layout or liquid GUI for) your Flash site with a minimum of effort. Objects can be &#8220;floated&#8221; in a variety of ways, and with a great deal of flexibility: you can assign pads to your objects within the context of their float, [...]]]></description>
			<content:encoded><![CDATA[<p>jsFloater is an Actionscript 3 class that allows you to &#8220;liquidify&#8221; (create liquid layout or liquid GUI for) your Flash site with a minimum of effort.</p>
<p>Objects can be &#8220;floated&#8221; in a variety of ways, and with a great deal of flexibility: you can assign pads to your objects within the context of their float, and even use simple math to create custom interactive behaviors for your objects.  The package is extremely lightweight and flexible.</p>
<p>jsFloater also computes the centering math on your own objects for you.  Standard movieclip 0,0 top left registration is expected.</p>
<p>For an example, see the <a title="jsFloater example swf" href="http://joshuasiegal.com/jsFloater/" target="_blank">jsFloater example swf</a>, which contains an object for each available float method in the jsFloater class.  Mousing over these objects reveals their method, their float mode, and their current pixel x &#8211; y coordinates.  The example swf acts as a kind of visual API guide.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.joshuasiegal.com/2009/introducing-jsfloater/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How To Use jsFloater</title>
		<link>https://blog.joshuasiegal.com/2009/how-to-use-jsfloater/</link>
		<comments>https://blog.joshuasiegal.com/2009/how-to-use-jsfloater/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 14:32:40 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[jsFloater]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[liquid]]></category>

		<guid isPermaLink="false">http://blog.joshuasiegal.com/?p=62</guid>
		<description><![CDATA[To use jsFloater in your projects, download and extract the zip file which contains the example FLA file and the package with the AS script, which is the class itself.  If you want, you can open up the FLA example file and look at that code (and its comments) to get a working idea of [...]]]></description>
			<content:encoded><![CDATA[<p>To use jsFloater in your projects, download and extract the zip file which contains the example FLA file and the package with the AS script, which is the class itself.  If you want, you can open up the FLA example file and look at that code (and its comments) to get a working idea of how to use the class.</p>
<p>The class is located in the package, com &gt; seagull &gt; jsfloat.   Move the directory &#8220;seagull&#8221; into your &#8220;com&#8221; directory, and add the following line of code either in your appropriate package declaration(s) or, if you are using Actionscript 3 within your own FLA file, at the top of your script:</p>
<blockquote><p>import com.seagull.jsfloat.*;</p></blockquote>
<p>Before you start floating your elements, several other things must happen:</p>
<p><span id="more-62"></span></p>
<p>1. Put a listener on your stage, listening for the Event. RESIZE event.  <a title="Adobe Livedocs - Resize Event" href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Stage.html#event:resize" target="_blank">More on this here</a>.  Basically, this could look like so:</p>
<blockquote><p>stage.addEventListener(Event.RESIZE, floatStuff);</p></blockquote>
<p>This will call a function you create &#8211; in this example, it&#8217;s named &#8220;floatStuff&#8221;.</p>
<p>2. Align your stage to the top left and instruct it not to scale content.  The code is below:</p>
<blockquote><p>stage.scaleMode = StageScaleMode.NO_SCALE;<br />
stage.align = StageAlign.TOP_LEFT;</p></blockquote>
<p>Be careful with your publish / export settings using these stage properties &#8211; make sure they do not conflict.</p>
<p>3. Instantiate the jsFloat class.  To do this, simply create a new object of type jsFloat, and pass in your intended minimum stage height and minimum stage width.  In this example, we have created a design that requires a minimum stage size of 960 x 600.  Smaller than this, and our elements will start to crash together, so we instantiate the jsFloat class with our values:</p>
<blockquote><p>var floater:jsFloat = new jsFloat(960,600);</p></blockquote>
<p>You could also create variables to hold your minimum stage dimensions and pass those in as well, or even write code to destroy the floater object and re-instantiate it with a new minimum size, depending on some user interaction, etc.</p>
<p>Okay, now we&#8217;re ready to begin floating our elements.  For this example, we&#8217;ll use three made-up, generic variables called &#8220;sprite1&#8243;, &#8220;sprite2&#8243;, and &#8220;sprite3&#8243; that we want to float.  Now, we need to construct the function that will handle our resize event.</p>
<blockquote><p>function floatStuff(re:Event):void<br />
{<br />
var sW:Number = stage.stageWidth;<br />
var sH:Number = stage.stageHeight;<br />
floater.floatHorVer(sprite1,&#8221;center&#8221;,0,0,sW,sH);<br />
floater.floatHor(sprite2,&#8221;rightStrict&#8221;,20,20,sW,sH);<br />
floater.floatVer(sprite3,&#8221;bottomStrict&#8221;,100,10,sW,sH);<br />
}<em></p>
<p>Note: if you are copying the code above, you will have to re-do the double quotes so that Flash recognizes them.</em></p></blockquote>
<p>So, what&#8217;s going on there?  Let&#8217;s take it line by line.  The first line sets up our function (you could make this private, if you like) with the same name as that called by our earlier event listener.  Since it&#8217;s called by an event handler, it wants to receive an argument that represents the event, so in the parentheses, we create an event called &#8220;re&#8221; of type &#8220;Event&#8221;.  This function is not returning anything, hence, the &#8220;:void&#8221;.</p>
<p>The next line opens the function with the curly brackets.  In the two lines following that, I have created two variables of type &#8220;Number&#8221;, which will hold the current stage width and height values.  It&#8217;s important that these go inside the resize event handler, so that they will be re-computed every time the user resizes the browser window / stage.</p>
<p>Next, I call the &#8220;floatHorVer&#8221; method on my floater object, passing in our sprite1 object and using an align mode of &#8220;center&#8221; (aligning &#8220;sprite1&#8243; to the center of the stage), and I&#8217;ve given it an xPad and a yPad of 0, which means it will sit right in the middle.  Finally, I pass in the current stage width and stage height, contained in my sW and sH variables.</p>
<p>In the line following, I call the &#8220;floatHor&#8221; method on my floater object, and I pass in my second sprite.  I want this sprite to always be 20 pixels down from the top of the window and stay 20 px away from the right edge of the window, so I use the &#8220;rightStrict&#8221; mode, and I pass in a yStick of 20 (sticks the y value at 20) and an xPad of 20 (pads the resized x value by 20 from the edge).  Then I pass in the current stage width and height.</p>
<p>Finally, I call the &#8220;floatVer&#8221; method on my floater object, passing in my third sprite.  For this sprite, I want an alignment that will always be 100 pixels off of the leftmost window edge, and I want it to always be 10 pixels above the bottom of the window.  I pass in the &#8220;bottomStrict&#8221; mode, and an xStick of 100 (sticks the x value at 100), then a yPad of 10 (pads the y resized y value by 10 from the bottom).  Then I pass in the current stage width and height.</p>
<p>If you&#8217;re wondering why the floater object keeps getting re-used, think of it as a invisible gnome that is called into action when the window resizes &#8211; your calls to it represent a list of tasks for it to complete &#8211; so, even though we&#8217;re floating 3 different sprites, we&#8217;re calling the same floater object to accomplish all those tasks.  Also, the floater object will generate an x <span style="text-decoration: underline;">and</span> a y value for whatever object you pass into it.  Thus, do not attempt to use floatHor and floatVer on the same object, as the second one will over-write the first.  Use floatHorVer instead.</p>
<p>To close our function, we use the closing curly bracket.</p>
<p>Okay, we&#8217;re almost there!  We only need one more thing to get this running.  We want to call the resize handler (our floatStuff function) once when the script runs, because otherwise we&#8217;ll have to wait for the user to resize the window for any of this to take effect (and we don&#8217;t want to do that).</p>
<p>The only difference is that this time, the function is not being called by an event handler, so there&#8217;s no event to pass in.  Since we&#8217;re not actually using that required event argument within the function, we&#8217;ll just pass in nothing instead.  So, we have:</p>
<blockquote><p>floatStuff(null);</p></blockquote>
<p>That&#8217;s the basics!  For more on the various methods and alignment modes available to you using jsFloater, see <a title="the jsFloater API" href="http://blog.joshuasiegal.com/2009/the-jsfloater-api/">the jsFloater API</a>, <a title="the jsFloater visual API guide - example" href="http://joshuasiegal.com/jsFloater/" target="_blank">the jsFloater visual API guide / example</a>, and <a title="the jsFloater box model" href="http://blog.joshuasiegal.com/2009/the-jsfloater-box/">the jsFloater box model</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.joshuasiegal.com/2009/how-to-use-jsfloater/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The jsFloater API</title>
		<link>https://blog.joshuasiegal.com/2009/the-jsfloater-api/</link>
		<comments>https://blog.joshuasiegal.com/2009/the-jsfloater-api/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 13:43:46 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[jsFloater]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[liquid]]></category>

		<guid isPermaLink="false">http://blog.joshuasiegal.com/?p=29</guid>
		<description><![CDATA[The API for jsFloater consists of 3 publicly available methods: floatHor, floatVer, and &#8211; you guessed it &#8211; floatHorVer.  The first of these will float an object horizontally; the second will float an object vertically, and the third will float an object both horizontally and vertically. Because web browsers are anchored to the top left [...]]]></description>
			<content:encoded><![CDATA[<p>The API for jsFloater consists of 3 publicly available methods: floatHor, floatVer, and &#8211; you guessed it &#8211; floatHorVer.  The first of these will float an object horizontally; the second will float an object vertically, and the third will float an object both horizontally and vertically.</p>
<p>Because web browsers are anchored to the top left of the window, you may want to use a combination of these three methods to achieve your desired results.  jsFloater allows you to define a minimum stage size, so that your elements won&#8217;t crash together if the user squashes the page size down by dragging the browser window&#8217;s bottom right corner to the middle of the screen, for example.  This minimum stage size is passed to the class constructor on instantiation.</p>
<p>There is a visual guide to the API available both in the <a title="download jsFloater" href="http://blog.joshuasiegal.com/2009/download-jsfloater/" target="_blank">downloadable zip file</a> and also for <a title="jsFloater visual API example online" href="http://joshuasiegal.com/jsFloater/" target="_blank">browsing on this site</a>.  You can mouse over the various objects in the visual API guide to reveal what method has been used to float them, which align mode they are employing, and what their current pixel x &#8211; y coordinates are.</p>
<p>jsFloater allows you several types of floating, in addition to the ability to &#8220;pad&#8221; or &#8220;stick&#8221; your floats, as will be expained below.  The types of floating are proportional (based off of the difference between the minimum stage size and current stage size) or Strict, meaning based only on the current stage size.</p>
<p><strong>The methods:</strong></p>
<p><span id="more-29"></span></p>
<p><strong><span style="text-decoration: underline;"><br />
constructor</span></strong></p>
<p>public function jsFloat(sIW:uint, sIH:uint):void</p>
<p style="padding-left: 30px;"><span style="text-decoration: underline;">returns</span>: nothing</p>
<p style="padding-left: 30px;"><span style="text-decoration: underline;">parameters</span>:</p>
<p style="padding-left: 60px;"><strong><span style="color: #0000ff;">sIW</span></strong>:uint &#8211; stage Initial Width.  This is also the stage minimum width you define based on your designs.<br />
<strong><span style="color: #0000ff;">sIH</span></strong>:uint &#8211; stage Initial Height.  This is also the stage miniumum height you define based on your designs.</p>
<p style="padding-left: 60px;">Both of these parameters will be used to calculate values in the proportional float modes and will also set the values for browser window resizes that are smaller than your minimum.</p>
<p><strong><span style="text-decoration: underline;"><br />
floatHor</span></strong></p>
<p>public function floatHor(obj:Object, align:String,  yStick:int, xPad:int, sW:Number, sH:Number):void</p>
<p style="padding-left: 30px;"><span style="text-decoration: underline;">returns</span>: nothing.</p>
<p style="padding-left: 30px;"><span style="text-decoration: underline;">parameters</span>:</p>
<p style="padding-left: 60px;"><strong><span style="color: #0000ff;">obj:</span></strong>Object &#8211; the object passed to the method.  Can be sprite or movieclip as well.<span style="color: #0000ff;"><br />
<strong>align:</strong></span>String &#8211; the alignment mode.  Options are:<span style="color: #008080;"> </span><span style="color: #008080;"><br />
&#8220;left&#8221;</span> &#8211; aligns left, proportionate to minimum stage size<br />
<span style="color: #008080;"> &#8220;leftStrict&#8221;</span> &#8211; aligns left, based strictly on current window size<br />
<span style="color: #008080;">&#8220;right&#8221;</span> &#8211; aligns right, proportionate to minimum stage size<br />
<span style="color: #008080;">&#8220;rightStrict&#8221;</span> &#8211; aligns right, based strictly on current window size<br />
<span style="color: #008080;">&#8220;center&#8221;</span> &#8211; aligns center (horizontally) in the window<br />
<strong><span style="color: #0000ff;">yStick</span><span style="color: #0000ff;">:</span></strong>int &#8211; allows you to force the floated object to &#8220;stick&#8221; to a particular y value.  A horizontal float with a yStick of 0 will align vertically with the top of the browser window.  Negative values can be used, as well as your own math (provided it results in an integer).<br />
<strong><span style="color: #0000ff;">xPad</span><span style="color: #0000ff;">:</span></strong>int &#8211; allows you to pad your float values.  For example, if you are using an image that always needs to be 20 pixels from the right edge of the window, you would use the &#8220;rightStrict&#8221; mode and and xPad of 20.  Positive values for pads will move objects toward the center of the window (horiztontally, in this case), except when using the &#8220;center&#8221; mode, which moves positive values toward the right.  Negative values can be used, as well as your own math (provided it results in an integer).<br />
<strong><span style="color: #0000ff;">sW:</span></strong>Number &#8211; current stage width.<br />
<span style="color: #0000ff;"><strong>sH:</strong></span>Number &#8211; current stage height.</p>
<p><span style="text-decoration: underline;"><strong><br />
floatVer</strong></span></p>
<p>public function floatVer(obj:Object, align:String, xStick:int, yPad:int, sW:Number, sH:Number):void</p>
<p style="padding-left: 30px;"><span style="text-decoration: underline;">returns</span>: nothing.</p>
<p style="padding-left: 30px;"><span style="text-decoration: underline;">parameters</span>:</p>
<p style="padding-left: 60px;"><strong><span style="color: #0000ff;">obj:</span></strong>Object &#8211; the object passed to the method.  Can be sprite or movieclip as well.<span style="color: #0000ff;"><br />
<strong>align:</strong></span>String &#8211; the alignment mode.  Options are:<span style="color: #008080;"> </span><span style="color: #008080;"><br />
&#8220;top&#8221;</span> &#8211; aligns top, proportionate to minimum stage size<br />
<span style="color: #008080;"> &#8220;topStrict&#8221;</span> &#8211; aligns top, based strictly on current window size<br />
<span style="color: #008080;">&#8220;bottom&#8221;</span> &#8211; aligns bottom, proportionate to minimum stage size<br />
<span style="color: #008080;">&#8220;bottomStrict&#8221;</span> &#8211; aligns bottom, based strictly on current window size<br />
<span style="color: #008080;">&#8220;middle&#8221;</span> &#8211; aligns middle (vertically) in the window<br />
<strong><span style="color: #0000ff;">xStick</span><span style="color: #0000ff;">:</span></strong>int &#8211; allows you to force the floated object to &#8220;stick&#8221; to a particular x value.  A vertical float with a xStick of 0 will align with the left side of the browser window.  Negative values can be used, as well as your own math (provided it results in an integer).<br />
<strong><span style="color: #0000ff;">yPad</span><span style="color: #0000ff;">:</span></strong>int &#8211; allows you to pad your float values.  For example, if you are using an image that always needs to be 20 pixels from the bottom of the window, you would use the &#8220;bottomStrict&#8221; mode and and yPad of 20.  Positive values for pads will move objects toward the middle of the window (vertically, in this case), except when using the &#8220;middle&#8221; mode, which moves positive values to the bottom.  Negative values can be used, as well as your own math (provided it results in an integer).<br />
<strong><span style="color: #0000ff;">sW:</span></strong>Number &#8211; current stage width.<br />
<span style="color: #0000ff;"><strong>sH:</strong></span>Number &#8211; current stage height.</p>
<p><span style="text-decoration: underline;"><strong><br />
floatHorVer</strong></span></p>
<p>public function floatHorVer(obj:Object, stickMode:String, xPad:int, yPad:int, sW:Number, sH:Number):void</p>
<p style="padding-left: 30px;"><span style="text-decoration: underline;">returns</span>: nothing.</p>
<p style="padding-left: 30px;"><span style="text-decoration: underline;">parameters</span>:</p>
<p style="padding-left: 60px;"><strong><span style="color: #0000ff;">obj:</span></strong>Object &#8211; the object passed to the method.  Can be sprite or movieclip as well.<br />
<span style="color: #0000ff;"><strong>stickMode</strong></span>:String &#8211; analogous to the align parameter in the methods above.  Options are:<br />
<span style="color: #008000;">&#8220;center&#8221;</span> &#8211; aligns to the center (horizontally) and middle (vertically) of the window<br />
<span style="color: #008000;">&#8220;right&#8221;</span> &#8211; aligns vertically to the middle and horizontally to the right, proportionate to the minimum stage size<br />
<span style="color: #008000;">&#8220;rightStrict&#8221;</span> &#8211; aligns vertically to the middle and horizontally to the right, based strictly on current window size<br />
<span style="color: #008000;">&#8220;bottom&#8221;</span> &#8211; aligns horizontally to the center and vertically to the bottom, proportionate to the minimum stage size<br />
<span style="color: #008000;">&#8220;bottomStrict&#8221;</span> &#8211; aligns horizontally to the center and vertically to the bottom, based strictly on current window size<br />
<span style="color: #008000;">&#8220;bottomright&#8221;</span> &#8211; aligns to the bottom right, both proportionate to the minimum stage size<br />
<span style="color: #008000;">&#8220;bottomrightStrict&#8221;</span> &#8211; aligns to the bottom right, both based strictly on current window size<br />
<span style="color: #008000;">&#8220;bottomleft&#8221;</span> &#8211; aligns to the bottom left, proportionate to the minimum stage size<br />
<span style="color: #008000;">&#8220;left&#8221;</span> &#8211; aligns vertically to the middle and horizontally to the left, proportionate to the minimum stage size<br />
<span style="color: #008000;">&#8220;topleft&#8221;</span> &#8211; aligns to the top left, proportionate to the minimum stage size<br />
<span style="color: #008000;">&#8220;top&#8221;</span> &#8211; aligns horizontally to the center and vertically to the top, proportionate to the minimum stage size<br />
<span style="color: #008000;">&#8220;topright&#8221;</span> &#8211; aligns to the top right, proportionate to the minimum stage size<em><br />
Note: because the browser window is anchored to the top left, certain stickMode parameters for this method would be redundant.  For example, there is no topleftStrict, as that effect can be achieved with the floatHor method, taking an align mode of &#8220;leftStrict&#8221;.</em><strong><span style="color: #0000ff;"><br />
xPad</span><span style="color: #0000ff;">:</span></strong>int &#8211; allows you to pad your float values horizontally.<span style="color: #0000ff;"><strong><br />
yPad</strong></span>:int &#8211; allows you to pad your float values vertically.<br />
xPad and yPad are as described for the methods above.  Either can accept negative values and math that results in an integer, except that both will push objects toward the center (horiztonally) and middle (vertically) of the window when given positive values, unless the &#8220;center&#8221; mode is used, which will push positive values down and to the right.  For example, if you wanted two objects to float at the center of the screen, with one always offset from the other 20 pixels down and to the right, you would float the first using the floatHorVer method with xPad and yPad of 0 and 0, and float the second using the same method, with an xPad of 20 and a yPad of 20.<strong><span style="color: #0000ff;"><br />
sW:</span></strong>Number &#8211; current stage width.<br />
<span style="color: #0000ff;"><strong>sH:</strong></span>Number &#8211; current stage height.</p>
<p>For more, see <a title="How To Use jsFloater" href="http://blog.joshuasiegal.com/2009/how-to-use-jsfloater/">How To Use jsFloater</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.joshuasiegal.com/2009/the-jsfloater-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The jsFloater Box</title>
		<link>https://blog.joshuasiegal.com/2009/the-jsfloater-box/</link>
		<comments>https://blog.joshuasiegal.com/2009/the-jsfloater-box/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 12:25:22 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[jsFloater]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[liquid]]></category>

		<guid isPermaLink="false">http://blog.joshuasiegal.com/?p=95</guid>
		<description><![CDATA[As you may have learned from the API, the jsFloater class gives you a lot of flexibility in your floats, with &#8220;stick&#8221; values and padding available to add to your floating object x and y values.  I thought it might be useful, however, to break down some of the available methods in terms of a [...]]]></description>
			<content:encoded><![CDATA[<p>As you may have learned from the <a title="The jsFloater API" href="http://blog.joshuasiegal.com/2009/the-jsfloater-api/">API</a>, the jsFloater class gives you a lot of flexibility in your floats, with &#8220;stick&#8221; values and padding available to add to your floating object x and y values.  I thought it might be useful, however, to break down some of the available methods in terms of a box model, to help explain two different types of floating you can use: what we&#8217;re calling proportional and strict.</p>
<p>jsFloater requires you to define a minimum and width and height for your stage, so that you can take a given design comp and figure out how small the browser window can get before the objects begin crashing into each other and/or overlapping in undersirable ways.  This is an issue common to liquid GUIs / layouts, one which jsFloater lets you fix.  But, you may not always want your elements to float based upon the very edges of the current browser window: if, for example, your design comp figures at a minimum window size of 800 x 600, you may want your elements to float somewhere between the minimum value and the edge of the window.  You could accomplish that with typical liquid GUI layout types and a bunch of your own math &#8211; or, you could let jsFloater do it for you, using the proportional float modes available.</p>
<p>We&#8217;ll examine the basic boxes in a moment, but first let&#8217;s recap the horizontal and vertical floats.  The images below are all taken from the <a title="The jsFloater visual API example" href="http://joshuasiegal.com/jsFloater/" target="_blank">jsFloater visual API example</a>, which can also be exported from the FLA file included in the download.  It may help you to have the visual API guide open while you read through this example, so you can experiment and see how the objects move and react.</p>
<p>First, let&#8217;s look at the available align modes for the floatVer (vertical) method.</p>
<p><span id="more-95"></span></p>
<div id="attachment_109" class="wp-caption aligncenter" style="width: 522px"><img class="size-full wp-image-109 " title="jsFloater Vertical align modes" src="http://blog.joshuasiegal.com/wp-content/uploads/2009/12/floater_verAlign2.png" alt="jsFloater Vertical align modes" width="512" height="286" /><p class="wp-caption-text">jsFloater Vertical align modes</p></div>
<p>As you can see, one of the objects is floating directly in the middle (vertically), one each is floating at the very top and bottom (strict), and two are floating somewhere that represents the a ratio of difference between the minimum height (height of the dotted box) and the current window height.  Those two are using the proportional modes.</p>
<p>Let&#8217;s look at the floats for the floatHor (horizontal) method:</p>
<div id="attachment_110" class="wp-caption aligncenter" style="width: 522px"><img class="size-full wp-image-110 " title="jsFloater Horizontal align modes" src="http://blog.joshuasiegal.com/wp-content/uploads/2009/12/floater_horAlign2.png" alt="jsFloater Horizontal align modes" width="512" height="286" /><p class="wp-caption-text">jsFloater Horizontal align modes</p></div>
<p>Although the left-most horiztonally floating object is currently obscured by the top-most vertically floating object, you should be able to see here how the horizontal mode is analogous to the vertical mode: one object aligned perfectly center, two strictly aligned left and right, and two floating proportionally between the minimum width (width of the dotted box) and current window width.</p>
<p>So, here is what the proportional box looks like, using nine floating modes (including the object at center-middle):</p>
<div id="attachment_111" class="wp-caption aligncenter" style="width: 522px"><img class="size-full wp-image-111 " title="jsFloater proportional box" src="http://blog.joshuasiegal.com/wp-content/uploads/2009/12/floater_propbox1.png" alt="jsFloater proportional box" width="512" height="286" /><p class="wp-caption-text">jsFloater proportional box</p></div>
<p>All of the nine objects being floated in the above box are using the floatHorVer method, width proportional align modes.  This proportional align is based on the difference between the minimum value and the current browser window size, so that elements float out into the browser space proportionally, but to not have to be stuck to the edges of the window, or to a fixed distance from the edges of the window.</p>
<p>Of course, you can combine the different float methods and modes however you like.  One possible use might be using proportional floats of the floatHorVer method for your right- and bottom-most objects, and using other floats for your left- and top-most items, for example.  It&#8217;s up to you and your creativity.</p>
<p>Now, let&#8217;s look at the strict box:</p>
<div id="attachment_112" class="wp-caption aligncenter" style="width: 522px"><img class="size-full wp-image-112 " title="jsFloater strict box" src="http://blog.joshuasiegal.com/wp-content/uploads/2009/12/floater_strictbox1.png" alt="jsFloater strict box" width="512" height="286" /><p class="wp-caption-text">jsFloater strict box</p></div>
<p>Notice, in the example above, that we&#8217;re now using a combination of the floatVer, floatHor, and floatHorVer methods to achieve a box that goes to the very edges of the current browser window size.  The reason for this can be explained using a simple example: look at the bottom left corner of the box.  That object only needs to float vertically, as the whole browser window is anchored to the top and the left.</p>
<p>Once again, you can assign particular x and y &#8220;stick&#8221; values to your vertically and horizontally floated objects, respectively.  You can pad the float of any object and also use your own math to create some custom behaviors on browser resize.  Hope you have fun experimenting with the various methods and modes.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.joshuasiegal.com/2009/the-jsfloater-box/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
