<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>craig phares design</title>
	
	<link>http://craigphares.com/blog</link>
	<description>design according to craig phares</description>
	<lastBuildDate>Thu, 18 Feb 2010 16:50:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/craigphares" /><feedburner:info uri="craigphares" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>40.744851</geo:lat><geo:long>-74.032941</geo:long><creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/2.0/</creativeCommons:license><image><link>http://www.craigphares.com/blog</link><url>http://www.craigphares.com/blog/craigphares.gif</url><title>Craig's Blog</title></image><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site, subject to copyright and fair use.</feedburner:browserFriendly><item>
		<title>Open Source 3D</title>
		<link>http://feedproxy.google.com/~r/craigphares/~3/JqwXu86H5MY/</link>
		<comments>http://craigphares.com/blog/2010/02/open-source-3d/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 16:49:04 +0000</pubDate>
		<dc:creator>Craig Phares</dc:creator>
				<category><![CDATA[3D]]></category>

		<guid isPermaLink="false">http://craigphares.com/blog/?p=760</guid>
		<description><![CDATA[Lately I&#8217;ve been playing around with Blender, an open source 3D modeling and animation application, and I have to say I&#8217;m pleasantly surprised. Virtually anything that can be realized in commercial 3D programs can be done in Blender. I&#8217;ll be posting some tutorials soon on some of the techniques I&#8217;ve found useful within Blender and [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I&#8217;ve been playing around with <a href="http://www.blender.org/">Blender</a>, an open source 3D modeling and animation application, and I have to say I&#8217;m pleasantly surprised. Virtually anything that can be realized in commercial 3D programs can be done in Blender. I&#8217;ll be posting some tutorials soon on some of the techniques I&#8217;ve found useful within Blender and how your 3D models can be brought into Flash using <a href="http://blog.papervision3d.org/">Papervision3D</a>.</p>
<img src="http://feeds.feedburner.com/~r/craigphares/~4/JqwXu86H5MY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://craigphares.com/blog/2010/02/open-source-3d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://craigphares.com/blog/2010/02/open-source-3d/</feedburner:origLink></item>
		<item>
		<title>Victors &amp; Spoils Logos</title>
		<link>http://feedproxy.google.com/~r/craigphares/~3/SjXiTzH3g0Q/</link>
		<comments>http://craigphares.com/blog/2009/11/victors-spoils-logos/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 14:17:31 +0000</pubDate>
		<dc:creator>Craig Phares</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Logo]]></category>

		<guid isPermaLink="false">http://craigphares.com/blog/?p=755</guid>
		<description><![CDATA[I&#8217;ve submitted a few logos for the Victors &#038; Spoils competition on crowdSPRING. Check &#8216;em out and vote if you like them!]]></description>
			<content:encoded><![CDATA[<div id="attachment_756" class="wp-caption alignnone" style="width: 600px"><a href="http://www.crowdspring.com/projects/graphic_design/logo/v_s_001_design_the_victors_spoils_logo/gallery/mob_of_pirate_admen"><img src="http://craigphares.com/blog/wp-content/uploads/2009/11/mob-590x590.jpg" alt="Victors &amp; Spoils Logo Concept" title="Victors &amp; Spoils" width="590" height="590" class="size-medium wp-image-756" /></a><p class="wp-caption-text">Victors &#038; Spoils Logo Concept</p></div>
<p>I&#8217;ve submitted a few logos for the <a href="http://www.crowdspring.com/projects/graphic_design/logo/v_s_001_design_the_victors_spoils_logo">Victors &#038; Spoils competition on crowdSPRING</a>. <a href="http://www.crowdspring.com/projects/graphic_design/logo/v_s_001_design_the_victors_spoils_logo/gallery/mob_of_pirate_admen">Check &#8216;em out</a> and vote if you like them!</p>
<img src="http://feeds.feedburner.com/~r/craigphares/~4/SjXiTzH3g0Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://craigphares.com/blog/2009/11/victors-spoils-logos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://craigphares.com/blog/2009/11/victors-spoils-logos/</feedburner:origLink></item>
		<item>
		<title>The Schoolyard Is Live!</title>
		<link>http://feedproxy.google.com/~r/craigphares/~3/40JI-lJP08A/</link>
		<comments>http://craigphares.com/blog/2009/09/the-schoolyard-is-live/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 13:35:40 +0000</pubDate>
		<dc:creator>Craig Phares</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Schoolyard]]></category>

		<guid isPermaLink="false">http://craigphares.com/blog/?p=751</guid>
		<description><![CDATA[The Schoolyard is up and running! Check out the Beta version of my very first Facebook game! Contact me if you&#8217;re interested in becoming a beta tester, and receive 5 Extra Credits and one exclusive item.]]></description>
			<content:encoded><![CDATA[<div id="attachment_749" class="wp-caption alignleft" style="width: 160px"><img src="http://craigphares.com/blog/wp-content/uploads/2009/09/Schoolyard-Logo-200-150x150.jpg" alt="The Schoolyard" title="The Schoolyard" width="150" height="150" class="size-thumbnail wp-image-749" /><p class="wp-caption-text">The Schoolyard</p></div>
<p><a href="http://apps.facebook.com/schoolyard">The Schoolyard</a> is up and running! Check out the Beta version of my very first Facebook game! Contact me if you&#8217;re interested in becoming a beta tester, and receive 5 Extra Credits and one exclusive item.</p>
<img src="http://feeds.feedburner.com/~r/craigphares/~4/40JI-lJP08A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://craigphares.com/blog/2009/09/the-schoolyard-is-live/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://craigphares.com/blog/2009/09/the-schoolyard-is-live/</feedburner:origLink></item>
		<item>
		<title>The Schoolyard Is Coming!</title>
		<link>http://feedproxy.google.com/~r/craigphares/~3/Cw1WSSc-kYc/</link>
		<comments>http://craigphares.com/blog/2009/09/the-schoolyard-is-coming/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 20:30:51 +0000</pubDate>
		<dc:creator>Craig Phares</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Schoolyard]]></category>

		<guid isPermaLink="false">http://craigphares.com/blog/?p=748</guid>
		<description><![CDATA[My very first Facebook game, The Schoolyard, is launching next week, Tuesday the 28th! Send me a message if you&#8217;re interested in becoming a beta tester. All volunteers receive 5 Extra Credits and one exclusive item only available to beta testers!]]></description>
			<content:encoded><![CDATA[<div id="attachment_749" class="wp-caption alignleft" style="width: 160px"><img src="http://craigphares.com/blog/wp-content/uploads/2009/09/Schoolyard-Logo-200-150x150.jpg" alt="The Schoolyard" title="The Schoolyard" width="150" height="150" class="size-thumbnail wp-image-749" /><p class="wp-caption-text">The Schoolyard</p></div>
<p>My very first Facebook game, The Schoolyard, is launching next week, Tuesday the 28th! Send me a message if you&#8217;re interested in becoming a beta tester. All volunteers receive 5 Extra Credits and one exclusive item only available to beta testers!</p>
<img src="http://feeds.feedburner.com/~r/craigphares/~4/Cw1WSSc-kYc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://craigphares.com/blog/2009/09/the-schoolyard-is-coming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://craigphares.com/blog/2009/09/the-schoolyard-is-coming/</feedburner:origLink></item>
		<item>
		<title>Infographic Goodness</title>
		<link>http://feedproxy.google.com/~r/craigphares/~3/JDCACz-3mjE/</link>
		<comments>http://craigphares.com/blog/2009/09/infographic-goodness/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 12:50:10 +0000</pubDate>
		<dc:creator>Craig Phares</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Infographic]]></category>

		<guid isPermaLink="false">http://craigphares.com/blog/?p=735</guid>
		<description><![CDATA[I love infographics, and Information Is Beautiful has some of the best I&#8217;ve seen. Some highlights: If Twitter was 100 People The Hierarchy Of Digital Distractions Walled World]]></description>
			<content:encoded><![CDATA[<div id="attachment_736" class="wp-caption alignleft" style="width: 160px"><img src="http://craigphares.com/blog/wp-content/uploads/2009/09/twitter100_550-150x150.gif" alt="Twitter Stats " title="Twitter Stats " width="150" height="150" class="size-thumbnail wp-image-736" /><p class="wp-caption-text">Information Is Beautiful</p></div>
<p>I love infographics, and <a href="http://www.informationisbeautiful.net/" target="_blank">Information Is Beautiful</a> has some of the best I&#8217;ve seen. </p>
<p><strong>Some highlights:</strong></p>
<p><a href="http://www.informationisbeautiful.net/2009/if-twitter-was-100-people/" target="_blank">If Twitter was 100 People</a><br />
<a href="http://www.informationisbeautiful.net/visualizations/the-hierarchy-of-digital-distractions/" target="_blank">The Hierarchy Of Digital Distractions</a><br />
<a href="http://www.informationisbeautiful.net/2009/walled-world/" target="_blank">Walled World</a></p>
<img src="http://feeds.feedburner.com/~r/craigphares/~4/JDCACz-3mjE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://craigphares.com/blog/2009/09/infographic-goodness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://craigphares.com/blog/2009/09/infographic-goodness/</feedburner:origLink></item>
		<item>
		<title>The New Freelancer: Launching Your Virtual Company</title>
		<link>http://feedproxy.google.com/~r/craigphares/~3/n7lwPFPJWA0/</link>
		<comments>http://craigphares.com/blog/2009/09/the-new-freelancer-launching-your-virtual-company/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 02:03:59 +0000</pubDate>
		<dc:creator>Craig Phares</dc:creator>
				<category><![CDATA[Business]]></category>

		<guid isPermaLink="false">http://craigphares.com/blog/?p=708</guid>
		<description><![CDATA[So you're ready to head off into the awesome world of freelance development: be your own boss, call your own shots, hire people, fire people, and rake in the money. The new freelancer is the virtual company: a team of individuals, each with their own unique talents - loosely associated with each other that come together on a project-by-project basis according to the needs of each assignment.]]></description>
			<content:encoded><![CDATA[<h4>Step 1: Launching Your Virtual Company</h4>
<p>So you&#8217;re ready to head off into the awesome world of freelance development: be your own boss, call your own shots, hire people, fire people, and rake in the money. The new freelancer is the virtual company: a team of individuals, each with their own unique talents &#8211; loosely associated with each other that come together on a project-by-project basis according to the needs of each assignment. Virtual companies are taking over the web development world. They are flexible and scalable, with low overhead and global reach. Getting up and running with your own virtual freelance business is now easier than ever. There are plenty of freely (and cheaply) available resources online to help you get started. But before you do anything, you need to make your company official. This series of articles are based largely upon my own experience in starting up a virtual company. This first segment will help you get your new business off the ground.</p>
<p><img src="http://craigphares.com/blog/wp-content/uploads/2009/09/41YNFKZRPQL._BO2204203200_PIsitb-sticker-arrow-clickTopRight35-76_AA240_SH20_OU01_-150x150.jpg" alt="The Business Side of Creativity" title="The Business Side of Creativity" width="150" height="150" class="alignleft size-thumbnail wp-image-712" /></p>
<h4>Consult the Experts</h4>
<p>I highly recommend reading through <a href="http://www.amazon.com/Business-Side-Creativity-Complete-Communications/dp/039373093X/ref=sr_1_5?ie=UTF8&#038;s=books&#038;qid=1252456948&#038;sr=1-5" target="_blank">The Business Side of Creativity: The Complete Guide for Running a Graphic Design or Communications Business</a> by Cameron S. Foote before taking any steps towards your company launch. Much of what we&#8217;ll cover in the first step of this series is addressed in this book, and it will give you a good idea of what you&#8217;re getting into.</p>
<h4>Form a Business Plan</h4>
<p>Before you jump head-first into designing a logo, building a website, and schmoozing clients, take a step back and remember that this is a business. Without a solid plan of attack, your company will be in the red before you know it. Even if you never show your plan to anyone else, it&#8217;s a good idea to put your business goals down on paper, and to revise this plan every year. Secondly, if you ever want to convince a bank or a private investor in loaning money to your company, a business plan is mandatory. Here&#8217;s a sample <a href="http://www.scribd.com/doc/36341/Business-Plan-Template" target="_blank">business plan template</a> to help you get started.</p>
<p><img src="http://craigphares.com/blog/wp-content/uploads/2009/09/godaddy.gif" alt="Go Daddy" title="Go Daddy" width="140" height="81" class="alignright size-full wp-image-723" /></p>
<h4>Choose Your Company Name and Register Your Domain</h4>
<p>Now for the fun part. Be creative. Take into consideration the identity you want to portray. This is your brand. But keep in mind that naming your company and registering a domain go hand in hand. You won&#8217;t be taken seriously without a website, but virtually every real-word domain is already reserved, so think about spelling your company phonetically. It should be easy to remember. Dot-coms are the most desirable but they are not necessary, so consider all your options. Naming your company can actually be the most difficult step in your company launch. Take your time and find something that you know you&#8217;ll be happy with for many years. Above all, have some fun with the process. Here are some resources to help:</p>
<ul>
<li><a href="http://www.entrepreneur.com/startingabusiness/startupbasics/namingyourbusiness/article21774.html" target="_blank">How to Name Your Business</a></li>
<li><a href="http://www.godaddy.com/" target="_blank">Go Daddy</a></li>
<li><a href="http://thesaurus.reference.com/" target="_blank">Thesaurus.com</a></li>
<li><a href="http://www.dotomator.com/web20.html" target="_blank">Web 2.0 Domain Name Generator</a></li>
</ul>
<p><img src="http://craigphares.com/blog/wp-content/uploads/2009/09/irs.gif" alt="IRS" title="IRS" width="170" height="72" class="alignleft size-full wp-image-724" /></p>
<h4>Register With the IRS</h4>
<p>Ahhh, taxes. There&#8217;s no way around it. But that&#8217;s not the only reason you should make your company officially registered with the government. Having a corporate identity offers a layer of protection between you and your clients/contractors. This also allows you to keep your business and personal finances separate from each other. Having an EIN lets you present yourself to your clients as a business entity, not just a freelancer. Of course, if you&#8217;re not located in the United States, you&#8217;ll need to register with your local government, not the IRS. There are plenty of services out there that will offer to take care of this legal process for you. However, doing this yourself is not difficult at all. Everything you need is available at the <a href="http://www.irs.gov/" target="_blank">Internal Revenue Service</a> website. You can <a href="https://sa2.www4.irs.gov/modiein/individual/index.jsp" target="_blank">apply for an EIN here</a>. The application process takes less then an hour and you should receive all your paperwork in the mail within a few days.</p>
<h4>Get a Business Account</h4>
<p>You have your detailed plan of attack, your brilliant company name, your website domain reserved at your registrar of choice, and your business registered with the government. Take a second and breath. You&#8217;re official! With your new EIN, you can and should open up a business checking account. It&#8217;s always best to keep your business finances separate from your personal transactions. While you&#8217;re at it, make sure to order some nice professional voucher checks. Consider opening up a business credit account as well to build some credit for your company. Always deposit your business income in your business account, and pay all contractors from this account. Keeping all your business transactions in one place is a life-saver when tax season comes around. </p>
<p><img src="http://craigphares.com/blog/wp-content/uploads/2009/09/moo.png" alt="MOO" title="MOO" width="171" height="77" class="alignright size-full wp-image-731" /></p>
<h4>Brand Yourself</h4>
<p>Now it&#8217;s time to form your public identity. If you&#8217;re a designer this is the most fun. If you&#8217;re not a designer, it&#8217;s time to get in touch with one. You&#8217;ll need your business basics: a logo, some business cards, and a website. The website doesn&#8217;t need to be overkill, but be sure to include the essentials: about the company, contact information, and a big call to action to get in touch with you. Your business cards don&#8217;t need to be quite so typical either. The more unique and eye-catching, the better. I order my cards from <a href="http://us.moo.com/en/" target="_blank">MOO</a>, skinny little cards that are especially great for designers/illustrators/photographers.</p>
<h4>Congratulations!</h4>
<p>At this point, your company is up and running! You may not have any clients available or work coming in, but your website is live and you&#8217;re ready to hand out your freshly printed business cards to everyone you meet. The hard part is over. In the next segment I&#8217;ll cover some useful web applications to help you easily run your new virtual company. Remember, you still need to manage projects, keep track of contractors, and stay on top of your invoices. If you found this segment useful, or if you have anything to add, or even if you completely disagree with every word on the page, feel free to contact me and let me know your thoughts. </p>
<img src="http://feeds.feedburner.com/~r/craigphares/~4/n7lwPFPJWA0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://craigphares.com/blog/2009/09/the-new-freelancer-launching-your-virtual-company/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://craigphares.com/blog/2009/09/the-new-freelancer-launching-your-virtual-company/</feedburner:origLink></item>
		<item>
		<title>RAD Model View Controller Demo</title>
		<link>http://feedproxy.google.com/~r/craigphares/~3/rSG2obGjEpk/</link>
		<comments>http://craigphares.com/blog/2009/09/rad-model-view-controller-demo/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 19:59:47 +0000</pubDate>
		<dc:creator>Craig Phares</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Avatar]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[RAD]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://craigphares.com/blog/?p=664</guid>
		<description><![CDATA[About RAD The Rapid ActionScript Development package lets developers get up and running with a lightweight flexible framework quickly and painlessly. Many developers are already using a model-view-controller framework. The RAD MVC package supplies a very clear set of abstract classes that will help any developer get up and running as fast as possible with [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_668" class="wp-caption alignnone" style="width: 560px"><a href="http://craigphares.com/blog/wp-content/uploads/2009/09/mvc_demo.zip"><img src="http://craigphares.com/blog/wp-content/uploads/2009/09/avatar_editor.jpg" alt="Avatar Editor" title="Avatar Editor" width="550" height="400" class="size-full wp-image-668" /></a><p class="wp-caption-text">Avatar Editor</p></div>
<p><strong>About RAD</strong></p>
<p>The Rapid ActionScript Development package lets developers get up and running with a lightweight flexible framework quickly and painlessly. Many developers are already using a model-view-controller framework. The RAD MVC package supplies a very clear set of abstract classes that will help any developer get up and running as fast as possible with a full-featured MVC design pattern. In lieu of a boring Hello World example, this demo will show how easy it is to setup an avatar editor in Flash using very little code. The user will be able to add or remove hair, add or remove a goatee, and change the hair color.</p>
<p><strong>Required Files</strong></p>
<p>RAD is available as open source through Google Code.<br />
You can visit the <a href="http://code.google.com/p/radpackage/">project site</a> or <a href="http://radpackage.googlecode.com/files/radpackage_1_2_1.zip">download the latest build</a>.</p>
<p>You can download the entire demo source for this tutorial <a href="http://craigphares.com/blog/wp-content/uploads/2009/09/mvc_demo.zip">here</a>.</p>
<p><strong>Flash Visual Elements</strong></p>
<p>This demo will have three visual components that we need to build in Flash: The Avatar Control Panel, an Avatar Info bar, and the Avatar himself. To begin, open up Flash and create a new AS3 file. Add a MovieClip titled &#8216;MVCDemo&#8217; to the stage. Export the MovieClip as &#8216;com.craigphares.tutorials.mvc.MVCDemo&#8217; and extend the &#8216;flash.display.Sprite&#8217; class. This will be our main holder clip that will contain our three elements.</p>
<p><strong>The Control Panel</strong></p>
<p>Within the MVCDemo clip, create a new MovieClip called &#8216;ControlPanelView&#8217;, and set its instance property name on the stage to &#8216;controlPanelView_mc&#8217;. This will house our form controls to edit the avatar. Add a Flash ColorPicker component named &#8216;hairColor_cp&#8217;, and two CheckBox components named &#8216;hair_cb&#8217; and &#8216;goatee_cb&#8217;. You can edit the labels to make it clear that one is for Hair and one is for the Goatee. That&#8217;s all we need for our ControlPanelView.</p>
<div id="attachment_676" class="wp-caption alignleft" style="width: 264px"><a href="http://craigphares.com/blog/wp-content/uploads/2009/09/avatar_view.jpg"><img src="http://craigphares.com/blog/wp-content/uploads/2009/09/avatar_view-254x590.jpg" alt="AvatarView" title="AvatarView" width="254" height="590" class="size-medium wp-image-676" /></a><p class="wp-caption-text">AvatarView</p></div>
<p><strong>The Avatar Views</strong></p>
<p>Return to the MVCDemo clip and create a new MovieClip named &#8216;AvatarView&#8217;, and set its instance property name on the stage to &#8216;avatarView_mc&#8217;. This is our main avatar display. Within the AvatarView clip, be sure to have one MovieClip named &#8216;hair_mc&#8217;, one named &#8216;eyebrows_mc&#8217;, and one MovieClip named &#8216;goatee_mc&#8217;. You can grab the artwork from the demo file available above, or create your own artwork for the Avatar. Just be sure to include separate artwork for the hair, eyebrows, and goatee.</p>
<p>Go back once more to the MVCDemo clip and create a new MovieClip named &#8216;AvatarInfoView&#8217;, and set its instance property name on the stage to &#8216;avatarInfoView_mc&#8217;. This will display some textual information about our avatar. Add a new TextField to the stage and name it &#8216;info_txt&#8217;.</p>
<p>Note: It&#8217;s important to name each important element on the stage. By working this way, a designer and programmer can work independently of each other, with the designer not needing to get involved with any ActionScript, and the programmer simply referencing the named objects within ActionScript and not worrying about the design. This significantly speeds up development time, as both members of the team can work simultaneously.</p>
<p>To illustrate the flexibility of the RAD framework, we&#8217;re going to show two different ways of converting these elements into View objects. So for now, edit the AvatarView in the library and export it for ActionScript as &#8216;com.craigphares.tutorials.mvc.AvatarView&#8217;, and export the ControlPanelView as &#8216;com.craigphares.tutorials.mvc.ControlPanelView&#8217;. Both of these classes will extend the RAD View class, and we will manually convert the AvatarInfoView to a View object in ActionScript.</p>
<div class="clearer"></div>
<p><strong>The Model</strong></p>
<p>Okay, our design is complete &#8211; now it&#8217;s on to the ActionScript. Open up your favorite ActionScript editor and create a new class named &#8216;com.craigphares.tutorials.mvc.AvatarModel&#8217;. This is our data model class and will extend the RAD Model class. Our AvatarModel class has three properties accessible through getters and setters: hairColor (uint), hasHair (Boolean), and hasGoatee (Boolean).</p>
<pre class="brush: as3; collapse: true; light: false; toolbar: true;">
package com.craigphares.tutorials.mvc {

	import com.rad.mvc.*;

	public class AvatarModel extends Model {

		public static const DEFAULT_HAIR_COLOR:uint = 0x361808;

		private var _hairColor:uint = DEFAULT_HAIR_COLOR;	// hexadecimal hair color
		private var _hasHair:Boolean;						// if the avatar has hair
		private var _hasGoatee:Boolean;						// if the avatar has a goatee

		public function AvatarModel() {}

		public function get hairColor():uint { return _hairColor; }
		public function set hairColor(c:uint):void {
			_hairColor = c;
			notify();
		}

		public function get hasHair():Boolean { return _hasHair; }
		public function set hasHair(h:Boolean):void {
			_hasHair = h;
			notify();
		}

		public function get hasGoatee():Boolean { return _hasGoatee; }
		public function set hasGoatee(h:Boolean):void {
			_hasGoatee = h;
			notify();
		}

	}

}
</pre>
<p>The key feature of the AvatarModel is the notify() method. Whenever notify() is called from any Model, all Views associated with that Model run their own method named update(), which can handle any visual changes that need to be made to represent the change in the data model. You can see that we add the notify() method to each setter function in AvatarModel.</p>
<pre class="brush: as3;">
public function set hairColor(c:uint):void {
	_hairColor = c;
	notify();
}
</pre>
<p><strong>AvatarView</strong></p>
<p>Next, let&#8217;s create our AvatarView class. This class requires two methods, init() and update(). The init() method is called explicitly once to setup the view according to the supplied model, which will be our AvatarModel. The update() method is called every time a change is made to the AvatarModel.</p>
<pre class="brush: as3; collapse: true; light: false; toolbar: true;">
package com.craigphares.tutorials.mvc {

	import com.rad.mvc.*;
	import flash.geom.ColorTransform;
	import flash.display.Sprite;
	import flash.events.Event;

	public class AvatarView extends View {

		private var _hair_mc:Sprite;
		private var _goatee_mc:Sprite;
		private var _eyebrows_mc:Sprite;
		private var _colorTransform:ColorTransform;

		public function AvatarView(m:IModel = null, c:IController = null, s:Sprite = null) {
			super(m, c, s);
		}

		override public function update(e:Event = null):void {

			_colorTransform.color = (getModel() as AvatarModel).hairColor;

			_hair_mc.transform.colorTransform = _colorTransform;
			_goatee_mc.transform.colorTransform = _colorTransform;
			_eyebrows_mc.transform.colorTransform = _colorTransform;

			_hair_mc.visible = (getModel() as AvatarModel).hasHair;
			_goatee_mc.visible = (getModel() as AvatarModel).hasGoatee;

		}

		public function init():void {

			_hair_mc = getChildByName(&quot;hair_mc&quot;) as Sprite;
			_goatee_mc = getChildByName(&quot;goatee_mc&quot;) as Sprite;
			_eyebrows_mc = getChildByName(&quot;eyebrows_mc&quot;) as Sprite;

			_colorTransform = new ColorTransform();

			update();

		}

	}

}
</pre>
<p>Let&#8217;s take a closer look at the update() method:</p>
<pre class="brush: as3;">
_colorTransform.color = (getModel() as AvatarModel).hairColor;

_hair_mc.transform.colorTransform = _colorTransform;
_goatee_mc.transform.colorTransform = _colorTransform;
_eyebrows_mc.transform.colorTransform = _colorTransform;

_hair_mc.visible = (getModel() as AvatarModel).hasHair;
_goatee_mc.visible = (getModel() as AvatarModel).hasGoatee;
</pre>
<p>Basically, we are grabbing the hair color from the model, and applying a colorTransform to all three avatar display objects: hair, goatee, and eyebrows. We also hide or show the hair or goatee based on the hasHair and hasGoatee properties of the AvatarModel. Simple enough.</p>
<p><strong>AvatarInfoView</strong></p>
<p>Our AvatarInfoView is even simpler. Here we are just describing the avatar as a &#8220;Hairy Man&#8221; or &#8220;Bald Man&#8221; based on whether the AvatarModel has hair.</p>
<pre class="brush: as3; collapse: true; light: false; toolbar: true;">
package com.craigphares.tutorials.mvc {

	import com.rad.mvc.*;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.text.TextField;

	public class AvatarInfoView extends View {

		private var _info_txt:TextField;

		public function AvatarInfoView(m:IModel = null, c:IController = null, s:Sprite = null) {

			super(m, c, s);

			_info_txt = getSprite().getChildByName(&quot;info_txt&quot;) as TextField;
			update();

		}

		override public function update(e:Event = null):void {

			if ((getModel() as AvatarModel).hasHair) {
				_info_txt.text = &quot;Hairy Man&quot;;
			} else {
				_info_txt.text = &quot;Bald Man&quot;;
			}

		}

	}

}
</pre>
<p>Note: The AvatarInfoView class does not require an init() method because we will be constructing the class within ActionScript instead of exporting it for ActionScript within Flash. Therefore we have the ability to pass the model to the view during its construction and our initialization can happen within the constructor.</p>
<p><strong>ControlPanelView</strong></p>
<p>The ControlPanelView class will simply add EventListeners to the form controls and pass them along to our Controller class. During initialization we make sure to update the form controls to match the AvatarModel defaults.</p>
<pre class="brush: as3; collapse: true; light: false; toolbar: true;">
package com.craigphares.tutorials.mvc {

	import com.rad.mvc.*;
	import fl.controls.ColorPicker;
	import fl.controls.CheckBox;
	import flash.display.Sprite;
	import flash.events.Event;

	public class ControlPanelView extends View {

		public function ControlPanelView(m:IModel = null, c:IController = null, s:Sprite = null) {
			super(m, c, s);
		}

		override public function defaultController(m:IModel):IController {
			return new AvatarController(getModel());
		} 

		public function init():void {

			var hairColor_cp:ColorPicker = getChildByName(&quot;hairColor_cp&quot;) as ColorPicker;
			hairColor_cp.selectedColor = (getModel() as AvatarModel).hairColor;
			hairColor_cp.addEventListener(Event.CHANGE, (getController() as AvatarController).onChange);

			var hair_cb:CheckBox = getChildByName(&quot;hair_cb&quot;) as CheckBox;
			var goatee_cb:CheckBox = getChildByName(&quot;goatee_cb&quot;) as CheckBox;

			hair_cb.addEventListener(Event.CHANGE, (getController() as AvatarController).onChange);
			goatee_cb.addEventListener(Event.CHANGE, (getController() as AvatarController).onChange);

		}

	}

}
</pre>
<p><strong>The Controller</strong></p>
<p>Now we can create our &#8216;AvatarController&#8217; class, which extends the abstract Controller class. All our user input will pass through to this class through event listeners, and this class will be sure to tell the AvatarModel to change its data accordingly.</p>
<pre class="brush: as3; collapse: true; light: false; toolbar: true;">
package com.craigphares.tutorials.mvc {

	import com.rad.mvc.*;
	import flash.events.Event;

	public class AvatarController extends Controller {

		public function AvatarController(m:IModel = null) {
			super(m);
		}

		public function onChange(e:Event):void {

			switch (e.target.name) {

				case&quot;hair_cb&quot;:
					(getModel() as AvatarModel).hasHair = e.target.selected;
				break;

				case &quot;goatee_cb&quot;:
					(getModel() as AvatarModel).hasGoatee = e.target.selected;
				break;

				case &quot;hairColor_cp&quot;:
					(getModel() as AvatarModel).hairColor = e.target.selectedColor;
				break;

			}
		}

	}

}
</pre>
<p><strong>The Main Class: MVCDemo</strong></p>
<p>Finally, we put this all together in the &#8216;MVCDemo&#8217; class:</p>
<pre class="brush: as3; collapse: true; light: false; toolbar: true;">
package com.craigphares.tutorials.mvc {

	import flash.display.Sprite;

	public class MVCDemo extends Sprite {

		private var _avatarModel:AvatarModel;
		private var _controlPanelView:ControlPanelView;
		private var _avatarView:AvatarView;
		private var _avatarInfoView:AvatarInfoView;

		public function MVCDemo() {

			_avatarModel = new AvatarModel();

			_controlPanelView = getChildByName(&quot;controlPanelView_mc&quot;) as ControlPanelView;
			_controlPanelView.setModel(_avatarModel);
			_controlPanelView.init();

			_avatarView = getChildByName(&quot;avatarView_mc&quot;) as AvatarView;
			_avatarView.setModel(_avatarModel);
			_avatarView.init();

			var avatarInfoView_mc:Sprite = getChildByName(&quot;avatarInfoView_mc&quot;) as Sprite;
			_avatarInfoView = new AvatarInfoView(_avatarModel, null, avatarInfoView_mc);			

		}

	}

}
</pre>
<p>You can see that we created the AvatarInfoView differently from the AvatarView and ControlPanelView. By not exporting the class to ActionScript within Flash, we can pass the &#8216;avatarInfoView_mc&#8217; Sprite through the View constructor from ActionScript. We also don&#8217;t explicitly pass the AvatarController, instead defining the defaultController within the ControlPanelView. This makes it easier to change controller classes later on without having to change our code in two places.</p>
<pre class="brush: as3;">
_avatarModel = new AvatarModel();

_controlPanelView = getChildByName(&quot;controlPanelView_mc&quot;) as ControlPanelView;
_controlPanelView.setModel(_avatarModel);
_controlPanelView.init();

_avatarView = getChildByName(&quot;avatarView_mc&quot;) as AvatarView;
_avatarView.setModel(_avatarModel);
_avatarView.init();

var avatarInfoView_mc:Sprite = getChildByName(&quot;avatarInfoView_mc&quot;) as Sprite;
_avatarInfoView = new AvatarInfoView(_avatarModel, null, avatarInfoView_mc);
</pre>
<p>So now we have a working avatar editor. You&#8217;ll see that both the AvatarView and the AvatarInfoView update in real time as you change the controls within the ControlPanelView. You can have unlimited views associated with each Model, allowing you to keep your data nice and tidy within one place.</p>
<p>If you have any questions or comments about this tutorial, feel free to contact me. I hope this makes your Flash projects much easier and faster to develop.</p>
<img src="http://feeds.feedburner.com/~r/craigphares/~4/rSG2obGjEpk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://craigphares.com/blog/2009/09/rad-model-view-controller-demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://craigphares.com/blog/2009/09/rad-model-view-controller-demo/</feedburner:origLink></item>
		<item>
		<title>RAD Updated</title>
		<link>http://feedproxy.google.com/~r/craigphares/~3/_nWQOS3On4k/</link>
		<comments>http://craigphares.com/blog/2009/09/rad-updated/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 04:48:33 +0000</pubDate>
		<dc:creator>Craig Phares</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[RAD]]></category>

		<guid isPermaLink="false">http://craigphares.com/blog/?p=651</guid>
		<description><![CDATA[I&#8217;ve updated the Rapid ActionScript Development package on Google Code. This update includes greater flexibility for the model-view-controller classes. This makes it even easier for both designers and hard-core programmers to use the framework. Stay tuned for a step-by-step tutorial on how to use the MVC feature of the RAD package. RAD is available as [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_633" class="wp-caption alignleft" style="width: 138px"><a href="http://code.google.com/p/radpackage/"><img src="http://craigphares.com/blog/wp-content/uploads/2009/08/file_as.jpg" alt="RAD Package" title="RAD Package" width="128" height="128" class="size-full wp-image-633" /></a><p class="wp-caption-text">RAD Package</p></div>
<p>I&#8217;ve updated the <a href="http://code.google.com/p/radpackage/">Rapid ActionScript Development</a> package on Google Code. This update includes greater flexibility for the model-view-controller classes. This makes it even easier for both designers and hard-core programmers to use the framework. Stay tuned for a step-by-step tutorial on how to use the MVC feature of the RAD package.</p>
<p>RAD is available as open source through Google Code. You can visit the <a href="http://code.google.com/p/radpackage/">project site</a> or <a href="http://radpackage.googlecode.com/files/radpackage_1_2_1.zip">download the latest build</a>. </p>
<p>Alternatively, you an checkout the latest source from Subversion using the following command:<br />
svn checkout http://radpackage.googlecode.com/svn/trunk/ radpackage-read-only</p>
<img src="http://feeds.feedburner.com/~r/craigphares/~4/_nWQOS3On4k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://craigphares.com/blog/2009/09/rad-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://craigphares.com/blog/2009/09/rad-updated/</feedburner:origLink></item>
		<item>
		<title>Wrapping Long Lines of Text in CSS</title>
		<link>http://feedproxy.google.com/~r/craigphares/~3/oPacVGEsG74/</link>
		<comments>http://craigphares.com/blog/2009/08/wrapping-long-lines-of-text-in-css/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 16:39:38 +0000</pubDate>
		<dc:creator>Craig Phares</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://craigphares.com/blog/?p=646</guid>
		<description><![CDATA[I recently came a cross a very tricky issue where an extremely long URL needed to be displayed in a narrow DIV. Browsers refuse to wrap this line, as there is no logical place to break the text. If you don&#8217;t have the luxury of providing a shorter label for the link, and need to [...]]]></description>
			<content:encoded><![CDATA[<p>I recently came a cross a very tricky issue where an extremely long URL needed to be displayed in a narrow DIV. Browsers refuse to wrap this line, as there is no logical place to break the text. If you don&#8217;t have the luxury of providing a shorter label for the link, and need to force it to wrap, I&#8217;ve come up with a CSS class definition that will work across virtually all browsers:</p>
<pre class="brush: css;">
.forcewrap {
	display: block;
	white-space: pre-wrap; /* css3 */
	white-space: -moz-pre-wrap !important; /* mozilla */
	white-space: -pre-wrap; /* opera 4-6 */
	white-space: -o-pre-wrap; /* opera 7 */
	word-wrap: break-word; /* ie 5.5+ */
}
</pre>
<p>Here is an example of its use:</p>
<pre class="brush: xml;">
&lt;div style=&quot;width:100px;&quot;&gt;
	&lt;a href=&quot;http://www.averylonglinkthatwillnotwrapnomatterwhatyoudo.com&quot; class=&quot;forcewrap&quot;&gt;http://www.averylonglinkthatwillnotwrapnomatterwhatyoudo.com&lt;/a&gt;
&lt;/div&gt;
</pre>
<img src="http://feeds.feedburner.com/~r/craigphares/~4/oPacVGEsG74" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://craigphares.com/blog/2009/08/wrapping-long-lines-of-text-in-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://craigphares.com/blog/2009/08/wrapping-long-lines-of-text-in-css/</feedburner:origLink></item>
		<item>
		<title>Rapid ActionScript Development Package Released</title>
		<link>http://feedproxy.google.com/~r/craigphares/~3/5OOU5Mmsiu0/</link>
		<comments>http://craigphares.com/blog/2009/08/rapid-actionscript-development-package-released/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 13:03:50 +0000</pubDate>
		<dc:creator>Craig Phares</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[RAD]]></category>

		<guid isPermaLink="false">http://craigphares.com/blog/?p=632</guid>
		<description><![CDATA[The RAD package has been born. This is a collection of ActionScript classes that I use often in my work. In the future I plan on posting a number of tutorials with examples of their use. I&#8217;ve added the full MVC design pattern and several Papervision3D utility classes. As I go through and clean up [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_633" class="wp-caption alignleft" style="width: 138px"><a href="http://code.google.com/p/radpackage/" rel="actionscript"><img src="http://craigphares.com/blog/wp-content/uploads/2009/08/file_as.jpg" alt="RAD Package" title="RAD Package" width="128" height="128" class="size-full wp-image-633" /></a><p class="wp-caption-text">RAD Package</p></div>
<p>The RAD package has been born. This is a collection of ActionScript classes that I use often in my work. In the future I plan on posting a number of tutorials with examples of their use. I&#8217;ve added the full MVC design pattern and several Papervision3D utility classes. As I go through and clean up more ActionScript, I&#8217;ll be incrementally adding these to the repository and releasing new downloads.</p>
<p>RAD is available as open source through Google Code. You can visit the <a href="http://code.google.com/p/radpackage/">project site</a>, or <a href="http://radpackage.googlecode.com/files/radpackage_1_0_1.zip">download the latest build</a>. </p>
<p>Alternatively, you an checkout the latest source from Subversion using the following command:<br />
svn checkout http://radpackage.googlecode.com/svn/trunk/ radpackage-read-only</p>
<img src="http://feeds.feedburner.com/~r/craigphares/~4/5OOU5Mmsiu0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://craigphares.com/blog/2009/08/rapid-actionscript-development-package-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://craigphares.com/blog/2009/08/rapid-actionscript-development-package-released/</feedburner:origLink></item>
	</channel>
</rss>
