<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The Flash Platform, from a designer&#039;s perspective.</title>
	<atom:link href="http://swfhead.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://swfhead.wordpress.com</link>
	<description>Flash, AIR, Flex, and the love of it all.</description>
	<lastBuildDate>Thu, 24 Sep 2009 08:20:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='swfhead.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>The Flash Platform, from a designer&#039;s perspective.</title>
		<link>http://swfhead.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://swfhead.wordpress.com/osd.xml" title="The Flash Platform, from a designer&#039;s perspective." />
	<atom:link rel='hub' href='http://swfhead.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Using AIR SDK 1.5.2 in Flash CS4</title>
		<link>http://swfhead.wordpress.com/2009/09/18/using-air-sdk-1-5-2-in-flash-cs4/</link>
		<comments>http://swfhead.wordpress.com/2009/09/18/using-air-sdk-1-5-2-in-flash-cs4/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 09:54:41 +0000</pubDate>
		<dc:creator>swfhead</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash AIR]]></category>

		<guid isPermaLink="false">http://swfhead.wordpress.com/?p=16</guid>
		<description><![CDATA[There seems to be a lack of documentation from Adobe on how to get AIR 1.5.2 SDK working in Flash. After an exhausting search, I still have not been able to find anything. All documentation seems to lead to using Flex. That&#8217;s all fine and dandy, especially considering that I&#8217;ve been building my AIR apps [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swfhead.wordpress.com&amp;blog=9542138&amp;post=16&amp;subd=swfhead&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There seems to be a lack of documentation from Adobe on how to get AIR 1.5.2 SDK working in Flash. After an exhausting search, I still have not been able to find anything. All documentation seems to lead to using Flex. That&#8217;s all fine and dandy, especially considering that I&#8217;ve been building my AIR apps in Flex for the past few month. But once a colleague asks to use certain api features for a client in Flash CS4, I have to scramble to find the answers.<br />
<strong><br />
Setting up the SDK</strong></p>
<p>Close Flash<br />
First, download the <a href="http://www.adobe.com/cfusion/entitlement/index.cfm?e=airsdk" target="blank">AIR 1.5.2 SDK</a> for your OS.<br />
Extract the files and open the containing &#8220;AIR SDK&#8221; folder, we&#8217;ll need the stuff inside.<br />
Now, in a new folder window, browse to and duplicate (to backup) the AIK1.5 folder in Flash CS4 program folder.</p>
<p>Windows:<br />
C:\Program Files\Adobe\Adobe Flash CS4\AIK1.5</p>
<p>MAC:<br />
\Applications\Adobe Flash CS4\AIK1.5</p>
<p>Copy the extracted files from the downloaded SDK folder and paste to the new AIK1.5 folder. From that new SDK copy airglobal.swc from frameworks/libs/air. Backup the same named swc in this folder (I suggest renaming to airglobal_backup.swc):<br />
Windows:<br />
C:\Program Files\Adobe\Adobe Flash CS4\Common\Configuration\ActionScript 3.0\AIR1.5</p>
<p>MAC:<br />
\Applications\Adobe Flash CS4\Common\Configuration\ActionScript 3.0\AIR1.5</p>
<p>Now you can paste airglobal.swc in.</p>
<p><strong>Setting up Flash</strong></p>
<p>Since I like to be as throurough as possible, I also want to be able to get access to all the AIR api as much as possible, as easy as possible. This is easy.<br />
Open Flash and go into Preferences. Click on the ActionScript category and Click ActionScript 3.0. In the Library Path section click the red swc icon and browse to the first swc we&#8217;ll want located here:<br />
Windows:<br />
C:\Program Files\Adobe\Adobe Flash CS4\AIK1.5\frameworks\libs\air\<br />
MAC<br />
\Applications\Adobe Flash CS4\AIK\frameworks\libs\air\<br />
Click the plus sign to add another line and browse to the next swc. Repeat for the third.</p>
<p>Cool, now we have those ready when ever we need them without having to do the process of adding them to each projects Publish Settings.</p>
<p><img class="aligncenter size-full wp-image-23" title="ActionScript Preferences" src="http://swfhead.files.wordpress.com/2009/09/prefas3.jpg?w=571&#038;h=649" alt="ActionScript Preferences" width="571" height="649" /></p>
<p><strong> Making your AIR app work with the new SDK</strong><br />
Now that we got the SDK all set up and ready to use, you can use 1.5.2 at anytime. But, there is one more small issue. 1.5.2 doesn&#8217;t work unless you have it in your name space in your application&#8217;s descriptor file. Once you publish or test movie of your app, open the descriptor file and add the  dot 2 to the end of the namespace:</p>
<pre style="color:#000000;background:#ffffff;"><span style="color:#004a43;">&lt;?</span><span style="color:#004a43;">xml</span> <span style="color:#004a43;">version</span><span style="color:#808030;">=</span><span style="color:#008c00;">"1.0"</span> <span style="color:#004a43;">encoding</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"UTF-8"</span><span style="color:#004a43;">?&gt;</span>
<span style="color:#a65700;">&lt;</span><span style="color:#5f5035;">application</span> <span style="color:#666616;">xmlns</span><span style="color:#808030;">=</span><span style="color:#0000e6;">"</span><span style="color:#666616;">http</span><span style="color:#800080;">:</span><span style="color:#800000;font-weight:bold;">//</span><span style="color:#5555dd;">ns.adobe.com</span><span style="color:#40015a;">/air/application/1.5.2</span><span style="color:#0000e6;">"</span><span style="color:#a65700;">&gt;</span></pre>
<p>Your 1.5.2 SDK is completely ready to use.</p>
<p><strong>Let&#8217;s test it. </strong></p>
<p>Make a new AIR fla, create a movie clip with a rectangle in it. Put it on the main stage and give it an instance name of btn_fullScreen.</p>
<p>I&#8217;m borrowing some of Ryan Stewart&#8217;s code on preventing the ESC key in fullscreen mode found here:</p>
<p>http://blog.digitalbackcountry.com/2009/08/new-air-1-5-2-api-examples-and-features/</p>
<p>But since he used Flex, I had to change it up a bit.<br />
In your document class write this:</p>
<pre style="color:#000000;background:#ffffff;"><span style="color:#800000;font-weight:bold;">package</span>
<span style="color:#800080;">{</span>
    <span style="color:#800000;font-weight:bold;">import</span> flash<span style="color:#808030;">.</span>display<span style="color:#808030;">.</span>MovieClip<span style="color:#808030;">;</span>
    <span style="color:#800000;font-weight:bold;">import</span> flash<span style="color:#808030;">.</span>events<span style="color:#808030;">.</span>KeyboardEvent<span style="color:#808030;">;</span>
    <span style="color:#800000;font-weight:bold;">import</span> flash<span style="color:#808030;">.</span>events<span style="color:#808030;">.</span>MouseEvent<span style="color:#808030;">;</span>
    <span style="color:#800000;font-weight:bold;">import</span> flash<span style="color:#808030;">.</span>display<span style="color:#808030;">.</span>StageDisplayState<span style="color:#808030;">;</span>
    <span style="color:#800000;font-weight:bold;">import</span> flash<span style="color:#808030;">.</span>ui<span style="color:#808030;">.</span>Keyboard<span style="color:#808030;">;</span>

    <span style="color:#800000;font-weight:bold;">public</span> <span style="color:#800000;font-weight:bold;">class</span> Airapp <span style="color:#800000;font-weight:bold;">extends</span> MovieClip

    <span style="color:#800080;">{</span>
        <span style="color:#800000;font-weight:bold;">public</span> <span style="color:#800000;font-weight:bold;">var</span> btn_fullScreen<span style="color:#808030;">:</span>MovieClip<span style="color:#808030;">;</span>

        <span style="color:#800000;font-weight:bold;">public</span> function Airapp(<span style="color:#808030;">)</span>
        <span style="color:#800080;">{</span>
            btn_fullScreen<span style="color:#808030;">.</span>addEventListener<span style="color:#808030;">(</span>MouseEvent<span style="color:#808030;">.</span>CLICK<span style="color:#808030;">,</span> btn_fullScreen_clickHandler<span style="color:#808030;">)</span><span style="color:#808030;">;</span>
            stage<span style="color:#808030;">.</span>addEventListener<span style="color:#808030;">(</span>KeyboardEvent<span style="color:#808030;">.</span>KEY_DOWN<span style="color:#808030;">,</span> keyDownHandler<span style="color:#808030;">)</span><span style="color:#808030;">;</span>
        <span style="color:#800080;">}</span>

        <span style="color:#800000;font-weight:bold;">public</span> function btn_fullScreen_clickHandler(event<span style="color:#808030;">:</span>MouseEvent<span style="color:#808030;">)</span><span style="color:#808030;">:</span><span style="color:#800000;font-weight:bold;">void</span>
        <span style="color:#800080;">{</span>
            stage<span style="color:#808030;">.</span>displayState <span style="color:#808030;">=</span> StageDisplayState<span style="color:#808030;">.</span>FULL_SCREEN_INTERACTIVE<span style="color:#808030;">;</span>
        <span style="color:#800080;">}</span>

        <span style="color:#800000;font-weight:bold;">private</span> function keyDownHandler(event<span style="color:#808030;">:</span>KeyboardEvent<span style="color:#808030;">)</span><span style="color:#808030;">:</span><span style="color:#800000;font-weight:bold;">void</span>
        <span style="color:#800080;">{</span>
            event<span style="color:#808030;">.</span>preventDefault<span style="color:#808030;">(</span><span style="color:#808030;">)</span><span style="color:#808030;">;</span>

            <span style="color:#800000;font-weight:bold;">if</span> <span style="color:#808030;">(</span>event<span style="color:#808030;">.</span>keyCode <span style="color:#808030;">==</span> Keyboard<span style="color:#808030;">.</span>ESCAPE<span style="color:#808030;">)</span>
            <span style="color:#800080;">{</span>
                <span style="color:#800000;font-weight:bold;">trace</span><span style="color:#808030;">(</span><span style="color:#800000;">"</span><span style="color:#0000e6;">do nothing</span><span style="color:#800000;">"</span><span style="color:#808030;">)</span><span style="color:#808030;">;</span>
            <span style="color:#800080;">}</span>
            <span style="color:#800000;font-weight:bold;">if</span> <span style="color:#808030;">(</span>event<span style="color:#808030;">.</span>keyCode <span style="color:#808030;">==</span> Keyboard<span style="color:#808030;">.</span>ENTER<span style="color:#808030;">)</span>
            <span style="color:#800080;">{</span>
                stage<span style="color:#808030;">.</span>displayState <span style="color:#808030;">=</span> StageDisplayState<span style="color:#808030;">.</span>NORMAL<span style="color:#808030;">;</span>
            <span style="color:#800080;">}</span>

        <span style="color:#800080;">}</span>
    <span style="color:#800080;">}</span>

<span style="color:#800080;">}</span></pre>
<p>Test your app &#8211; cntrl+enter, but don&#8217;t change the descriptor file yet. If you click the button, then hit ESC, notice how it goes back to normal? This is because we haven&#8217;t changed the descriptor. Change that now to the 1.5.2 namespace. Test your app again. Should work.</p>
<p>Enjoy!</p>
<p>P.S. A BIG thanks to Andreas Heim for getting me started in the right direction.</p>
<p>Also, once I find that pesky descriptor file template, I will post about how to change that so you won&#8217;t have to change the file everytime.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/swfhead.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/swfhead.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/swfhead.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/swfhead.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/swfhead.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/swfhead.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/swfhead.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/swfhead.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/swfhead.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/swfhead.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/swfhead.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/swfhead.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/swfhead.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/swfhead.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swfhead.wordpress.com&amp;blog=9542138&amp;post=16&amp;subd=swfhead&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://swfhead.wordpress.com/2009/09/18/using-air-sdk-1-5-2-in-flash-cs4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d835a4a1f4f5570b2e4bee6e36fccc51?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">swfhead</media:title>
		</media:content>

		<media:content url="http://swfhead.files.wordpress.com/2009/09/prefas3.jpg" medium="image">
			<media:title type="html">ActionScript Preferences</media:title>
		</media:content>
	</item>
		<item>
		<title>Flash Optimization: The Performance vs. File Size Conundrum</title>
		<link>http://swfhead.wordpress.com/2009/09/09/flash-optimization-the-performance-vs-file-size-conundrum/</link>
		<comments>http://swfhead.wordpress.com/2009/09/09/flash-optimization-the-performance-vs-file-size-conundrum/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 06:19:00 +0000</pubDate>
		<dc:creator>swfhead</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://swfhead.wordpress.com/2009/09/09/flash-optimization-the-performance-vs-file-size-conundrum</guid>
		<description><![CDATA[**Additional information below (added 09/23/09)** I have heard, and asked, the question many times: “How do I get this swf down to file size?” This question has a cousin in another form: “How come this swf plays so slow at times?” The two sound different, right? Well, they are, but at the same time they [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swfhead.wordpress.com&amp;blog=9542138&amp;post=4&amp;subd=swfhead&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="color:#ff0000;">**Additional information below (added 09/23/09)**</span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">I have heard, and asked, the question many times: “How do I get this swf down to file size?” This question has a cousin in another form: “How come this swf plays so slow at times?”</span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">The two sound different, right? Well, they are, but at the same time they are the exact same. </span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">Balancing File size and Performance can be very tricky. In fact, it can be down-right frustrating. There are a lot of factors that go into optimizing for performance. In order to keep your brain from frying into molten lava, here are a few things to keep in mind.</span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">First let’s talk a little about how Flash Player renders – or “draws”. </span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">Flash must abide by the rules of a computer system and the monitors in which computers display their visual output. Flash is subject to the laws of the computer bit system<sup>1</sup>, an incremental system of numeric values starting with 8 bits (one piece of information with 2 values: on and off) to a byte and building onward. Flash must also bow itself to the laws of pixels. Your computer screen is made up of tiny little squares called pixels. Your monitor resolution might be 1024&#215;768, which means there are 1024 pixels along the top and 768 pixels along the side. </span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">With this understood we can now see that Flash Player must “draw” within these confines. It must know that there is – essentially – an unlimited amount of colors (or information) that each pixel of your monitor can display (not at the same time, of course). And, it can only “draw” in squares.</span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">Try this:</span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">Take out a piece of paper and draw a perfect, straight line diagonally across it. Easy, right? Now, draw a half inch grid on your piece of paper, perpendicular to the edges. Try to draw a perfect, straight, diagonal line by filling in adjacent squares. Not so easy, is it? Now try to do it with color while moving the line square by square to one side than the other. Nah, just kidding.</span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;"> </span></p>
<p><span style="font-size:100%;"> </span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;"> </span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;"><span style="font-weight:bold;">Bitmaps vs. Vectors</span></span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">If you tried the above example, you didn’t just stumble on how Flash Player must “draw” a straight line, but you also proved the difference between vector and bitmap. The first line you drew was a vector, whereas the second (with the grid) was a bitmap. Flash authoring environment can create vectors, but when Flash Player plays on your screen, it must abide by pixel laws. That is not to say that Flash Player turns vectors to bitmaps automatically, really it doesn’t.</span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">Vectors are basically made up of “imaginary” lines connected by points, then “filled” with color. This takes quite a bit of mathematical calculations to be converted to pixels. Since Flash must do the math for drawing lines between points, the more points that are on a vector path, the more math Flash must do. This not only can lead to slower performance, but also higher file size. Gradients in vectors can be hard on Flash Player, too, since it must draw even more colors.</span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">Bitmaps can be created in just about any photo or illustration software (PhotoShop and Illustrator for example), as a .png, .jpg, or .gif. These are basically dozens to thousands of pixels filled with a predefined color. It is easier to do the math of something that is already defined than it is to have to figure it out every time you would want to draw it. Keep in mind that the more complex the bitmap pixels – the more colors and large dimensions used – the more math Flash has to do.</span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">Bitmaps themselves generally aid in visual performance, but can lead to large, up-front file sizes and thus longer load times. Vectors are great for loading quickly – smaller file size – but can be a beast for Flash to have to redraw every frame during an animation, especially if they are complex.</span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">If you are using bitmaps, first thing you will want to do is make sure the quality settings aren’t obscene. To do this, first go to the Publish Setting (File&gt;Publish Settings), click on the Flash tab and adjust the bitmap quality slider. This works for pngs, but what about jpgs? To change their settings, simply double click on each jpgs little green icon in the library and check its quality settings. (In CS4 you can highlight multiple items, right click and choose <em>Properties</em>.)  Jpgs will most likely have “Use Imported Bitmap Quality” checked which is 102% (weird huh?).  Uncheck its radial and enter your own percentage. 75 – 80 is good for quality, less is better for file size. Also, if your jpgs are in constant motion, click the “Allow Smoothing” radial. This will keep your bitmaps from those gross “scan lines” but will be fuzzy if static (or standing still), so if they aren’t constantly moving, leave it unchecked.</span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">With Vectors, setting cacheAsBitmap with ActionScript or turning on the “Use Runtime Bitmap Caching” in the Properties Panel on the containing movie clip will help performance a little. But when static, they may look fuzzy. Vectors look great without being turned to bitmaps and are static.</span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;"> </span></p>
<p class="MsoNormal" style="line-height:normal;font-weight:bold;font-family:arial;"><span style="font-size:100%;">Filters and Blend Modes</span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">Filters and Blend Modes have little to nothing to do with load but can severely hinder performance, especially during animations. This is because Flash Player has to do even more math on the fly, as the animations play out. When you apply a Filter to a movie clip, Flash Player has to render that out immediately while playing. FP sort of runs your movie clip with cacheAsBitmap, essentially rendering your movie clip as a faux &#8220;bitmap&#8221; on the fly. This puts a damper on how well FP runs simply because it has to figure all the information within a tiny fraction of a second. Filters can also lead to strange &#8220;pixel shifts&#8221; or even large jumps, depending on the intensity and of which filter you are using.</span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">Blend Modes kill performance, much in the way Filters do. Using Blend Modes not only has to force Flash to render the movie clip they are applied to, but also any below them. Obviously, there is a lot involved in doing that, so Flash Player has to think through that as well.</span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;"><strong><span style="color:#ff0000;">**</span>Reuse and Recycle to Reduce<br />
</strong></span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">Reuse as any graphical elements as possible. Whether they are vector or bitmap, reusing common or shared symbols will greatly reduce file size. </span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">Let&#8217;s say you have 12 rectangular movie clip buttons. You would not want to recreate 12 different rectangles. Instead, create one square and scale, rotate, and manipulate that one square as often as you need to. If you need to alter colors, simply tint that same square to the color of your choice. Try to find all the ways you can possibly reuse and recycle graphics as often as possible. In fact, make it a habit.<br />
</span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;">
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;"> </span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;"><span style="font-weight:bold;">Masking</span></span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">Even though it looks great, in general Masking puts a damper on performance. This is further explained in another post <a href="http://swfhead.wordpress.com/2009/08/18/masks-the-pros-the-cons-and-other-interesting-info/">found here</a>.</span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;"> </span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;"> </span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;"><span style="font-weight:bold;">The End User</span></span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">The user’s hardware does come into account as well. If the computer your Flash piece is being viewed on has great amount of RAM, an awesome video card, plenty of hard drive space, etc. then your flash piece will usually play nicely. If the user has a machine with fewer capabilities, your Flash piece will render slower.</span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;"> </span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;"><span style="font-weight:bold;">Size Reporting</span></span></p>
<p style="font-family:arial;"><span style="font-size:100%;"><span style="font-size:100%;">To see just what all is taking up loading and how large bitmaps and vectors are, go to your publish settings (File&gt;Publish Settings), in the Flash tab click on &#8220;Generate File Size Report.&#8221; Also, when testing your movie (cntl+enter) hit cntl+B to bring up the Bandwidth Profiler. These will show you file size, but not necessarily performance hits.</span></span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;"> </span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;"><span style="font-weight:bold;">Conclusion</span></span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">Balancing File Size and Performance is not a simple task. There is a lot to keep in mind when creating your Flash piece. It might be best to ask yourself a series of questions before even getting to the nitty-gritty of designing.</span></p>
<ol style="margin-top:0;font-family:arial;" type="1">
<li class="MsoNormal" style="line-height:normal;"><span style="font-size:100%;">What is the      allowable file size, if there is any?</span></li>
<li class="MsoNormal" style="line-height:normal;"><span style="font-size:100%;">What is going to      be animating and what is going to be static?</span></li>
<li class="MsoNormal" style="line-height:normal;"><span style="font-size:100%;">What kind of      computer might my audience be viewing my work on?</span></li>
<li class="MsoNormal" style="line-height:normal;"><span style="font-size:100%;">Am I shooting      for better performance, faster loading times, smaller file size, or a      combination?</span></li>
<li class="MsoNormal" style="line-height:normal;"><span style="font-size:100%;">Can I create      that as vector or will I need to use photography? </span></li>
<li class="MsoNormal" style="line-height:normal;"><span style="font-size:100%;">Does my bitmap      quality really need to be very high if it is just animating?</span></li>
<li class="MsoNormal" style="line-height:normal;"><span style="font-size:100%;">Do my bitmaps      need to be large size or can I crop them down?</span></li>
<li class="MsoNormal" style="line-height:normal;"><span style="font-size:100%;">Can I clean up      parts of my bitmap images so there aren’t so many colors and they aren’t      so detailed? Or do they need to be really crisp and pixel perfect?</span></li>
<li class="MsoNormal" style="line-height:normal;"><span style="font-size:100%;">Do my vectors      need to be complex or can they be rather simple?</span><!--[if gte mso 9]&gt;     Normal   0               false   false   false      EN-US   X-NONE   X-NONE                                                     MicrosoftInternetExplorer4                                                   &lt;![endif]--><!--[if gte mso 9]&gt;                                                                                                                                                                                                                                                                                                                                                                                                                                &lt;![endif]--> <!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:roman; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-fareast-font-family:Calibri; 	mso-bidi-font-family:"Times New Roman";} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	font-size:10.0pt; 	mso-ansi-font-size:10.0pt; 	mso-bidi-font-size:10.0pt; 	mso-ascii-font-family:Calibri; 	mso-fareast-font-family:Calibri; 	mso-hansi-font-family:Calibri;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:125317028; 	mso-list-template-ids:-1164827142;} ol 	{margin-bottom:0in;} ul 	{margin-bottom:0in;} --> <!--[if gte mso 10]&gt;   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Calibri","sans-serif";}  &lt;![endif]--><span style="font-size:100%;"> </span></li>
<li class="MsoNormal" style="line-height:normal;"><span style="font-size:100%;">How      many items are animating on the screen at one time? Does there need to be so many?</span></li>
<li class="MsoNormal" style="line-height:normal;"><span style="font-size:100%;">Do I need to use filters or is there a better way to obtain the same visual appearance?
<p></span></li>
</ol>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;">Keep these all in mind and your Flash work will be that much more exceptional. Do this all on a consistent basis and optimizing will become like second nature.</span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;"> </span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:100%;"> </span></p>
<p class="MsoNormal" style="line-height:normal;font-family:arial;"><span style="font-size:78%;"><sup>1</sup></span><span style="font-size:100%;"><span style="font-size:78%;"> In decimal calculations: Each bit is a piece of information (on or off), there are 8 bits to a byte, 1000 bytes to a kilobyte, 1000 kilobytes to a megabyte, etc. This is based off of the metric systematic calculation. Binary calculation is actually 8 bits to a byte, 1024 bytes to a kilobyte, 1024 kilobytes to a megabyte, etc. To learn more, run a simple internet search.</span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/swfhead.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/swfhead.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/swfhead.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/swfhead.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/swfhead.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/swfhead.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/swfhead.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/swfhead.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/swfhead.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/swfhead.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/swfhead.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/swfhead.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/swfhead.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/swfhead.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swfhead.wordpress.com&amp;blog=9542138&amp;post=4&amp;subd=swfhead&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://swfhead.wordpress.com/2009/09/09/flash-optimization-the-performance-vs-file-size-conundrum/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d835a4a1f4f5570b2e4bee6e36fccc51?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">swfhead</media:title>
		</media:content>
	</item>
		<item>
		<title>Masks: The Pros, The Cons and Other interesting info.</title>
		<link>http://swfhead.wordpress.com/2009/08/18/masks-the-pros-the-cons-and-other-interesting-info/</link>
		<comments>http://swfhead.wordpress.com/2009/08/18/masks-the-pros-the-cons-and-other-interesting-info/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 05:00:00 +0000</pubDate>
		<dc:creator>swfhead</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://swfhead.wordpress.com/2009/08/18/masks-the-pros-the-cons-and-other-interesting-info</guid>
		<description><![CDATA[Masks are great! We use them all the time for everything. Masking is a way of life for some designers (myself included). But masks can be serious runtime performance killers. How? Why? Well, without getting into way too much detail, timeline masks aren&#8217;t actually keeping your animations and artwork contained within their bounds. They&#8217;re just [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swfhead.wordpress.com&amp;blog=9542138&amp;post=3&amp;subd=swfhead&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="x_MsoNormal" style="font-family:arial;"><span style="font-size:100%;">Masks are great! We use them all the time for everything. Masking is a way of life for some designers (myself included). </span></p>
<p class="x_MsoNormal" style="font-family:arial;"><span style="font-size:10%;">But masks can be serious runtime performance killers. How? Why?<br />
</span></p>
<p class="x_MsoNormal" style="font-family:arial;">Well, without getting into way too much detail, timeline masks aren&#8217;t actually keeping your animations and artwork contained within their bounds. They&#8217;re just making everything outside at 0% alpha. Flash still has to re-draw that 0%-edness.</p>
<p class="x_MsoNormal" style="font-family:arial;"><span style="font-size:100%;">This can seriously hurt performance, especially with complex animations/artwork.</span></p>
<p class="x_MsoNormal" style="font-family:arial;"><span style="font-size:100%;">Speaking with Andreas Heim, and working with Greg Schlimm on a small project, we discovered a couple helpful tips to keep performance dives to a minimum.</span></p>
<p class="x_MsoNormal" style="font-family:arial;"><span style="font-size:100%;">First, if at all possible, try not to turn layers to masks. There&#8217;s absolutely no way of getting performance back.</span></p>
<p class="x_MsoNormal" style="font-family:arial;"><span style="font-size:100%;">In order to have a mask and not have it set on the timeline and not hurt at runtime, do these quick/easy steps:</span></p>
<p class="x_MsoNormal" style="font-family:arial;"><span style="font-size:100%;">1. After creating your vector mask and your animation/artwork where you like it, give both a unique instance name. (Here I will call them <em><span style="color:#00b050;">maskee</span></em> for the artwork, and <em><span style="color:#00b050;">masker</span><span style="color:#0070c0;"> </span></em>for the actual mask.)</span></p>
<p class="x_MsoNormal" style="font-family:arial;"><span style="font-size:100%;">2. Check &#8220;Use runtime bitmap caching&#8221; on the properties of <em><span style="color:#00b050;">maskee</span></em></span><span style="color:#00b050;font-size:100%;"> </span> <span style="font-size:100%;"><strong>only</strong>.</span></p>
<p class="x_MsoNormal" style="font-family:arial;"><span style="font-size:100%;">3. Create an AS layer &#8211; if there isn&#8217;t one already. </span></p>
<p class="x_MsoNormal" style="font-family:arial;"><span style="font-size:100%;">4. On the first frame where the artwork/mask appear, on the AS layer, type this:</span></p>
<p class="x_MsoNormal" style="font-family:arial;"><span style="font-size:100%;"><em><span style="color:#00b050;">maskee</span></em>.</span><span style="color:#0070c0;font-size:100%;">mask</span><span style="font-size:100%;"> = <em> <span style="color:#00b050;">masker</span></em>;</span></p>
<p class="x_MsoNormal" style="font-family:arial;"><span style="font-size:100%;">This will keep the animation only within the bounds of the mask. No drawing anything outside at 0% alpha.</span></p>
<p class="x_MsoNormal" style="font-family:arial;"><span style="font-size:100%;">**Note** if you animate the mask itself, Flash still doesn&#8217;t redraw <em><span style="color:#00b050;">maskee</span></em> outside of the bounds but does have to redraw</span><span style="font-size:100%;"> <em><span style="color:#00b050;">masker</span></em>. **End Note** </span></p>
<p class="x_MsoNormal" style="font-family:arial;"><span style="font-size:100%;">Also note that this works solely with vector masks. To use a bitmap or gradient mask, you MUST check &#8220;Use runtime bitmap caching&#8221; on both mcs. But you lose the performance enhancement.</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/swfhead.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/swfhead.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/swfhead.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/swfhead.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/swfhead.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/swfhead.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/swfhead.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/swfhead.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/swfhead.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/swfhead.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/swfhead.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/swfhead.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/swfhead.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/swfhead.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=swfhead.wordpress.com&amp;blog=9542138&amp;post=3&amp;subd=swfhead&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://swfhead.wordpress.com/2009/08/18/masks-the-pros-the-cons-and-other-interesting-info/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d835a4a1f4f5570b2e4bee6e36fccc51?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">swfhead</media:title>
		</media:content>
	</item>
	</channel>
</rss>
