<?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>franto.com &#187; alpha</title>
	<atom:link href="http://franto.com/tag/alpha/feed/" rel="self" type="application/rss+xml" />
	<link>http://franto.com</link>
	<description></description>
	<lastBuildDate>Tue, 23 Aug 2011 10:29:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Inverse masking disclosed</title>
		<link>http://franto.com/inverse-masking-disclosed/</link>
		<comments>http://franto.com/inverse-masking-disclosed/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 11:50:29 +0000</pubDate>
		<dc:creator>Daniel Sedlacek</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[alpha]]></category>
		<category><![CDATA[blending]]></category>
		<category><![CDATA[blendmode]]></category>
		<category><![CDATA[erase]]></category>
		<category><![CDATA[inverse]]></category>
		<category><![CDATA[layer]]></category>
		<category><![CDATA[mask]]></category>
		<category><![CDATA[masking]]></category>
		<category><![CDATA[reverse]]></category>

		<guid isPermaLink="false">http://www.franto.com/?p=948</guid>
		<description><![CDATA[Recently I have used inverse mask in my project &#8211; a mask that hides everything beneath it, keeping everything outside visible. I knew there is no direct support for inverse masking in Flash, but such effect can be achieved by using blend modes. To my surprise when you google the term &#8220;flash inverse mask&#8221; all [...]]]></description>
			<content:encoded><![CDATA[<div class="TweetButton_button" style="float: right; margin-left: 10px;;height:20px;margin-bottom:5px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffranto.com%2Finverse-masking-disclosed%2F&amp;text=Inverse masking disclosed&amp;count=vertical&amp;lang=en&amp;related=alpha,blending,blendmode,erase,inverse,layer,mask,masking,reverse"><img src="http://franto.com/blog2/wp-content/plugins/tweetbutton-for-wordpress/images/tweet.png" style="border:none" /></a></div>
<p>Recently I have used inverse mask in my project &#8211; <strong>a mask that hides everything beneath it, keeping everything outside visible</strong>. I knew there is no direct support for inverse masking in Flash, but such effect can be achieved by using blend modes.</p>
<p>To my surprise when you google the term &#8220;flash inverse mask&#8221; all top ten or so results claim that this is not possible in Flash(!). People either suggest to <em>&#8220;invert the mask&#8221;</em> or <em>&#8220;duplicate the background layer and put it on the top of the layer stack, mask that&#8221;</em>. Some more advanced coders even do some magic with BitmapData.treshold and ColorTransforms. This may work but the solution is way much easier.</p>
<p><span id="more-948"></span><br />
Simply set the blend mode of masking object to BlendMode.ERASE place it above the object you want to mask and set the blend mode of their parent to BlendMode.LAYER (this is essential). And that&#8217;s it! You can get similar effect when your mask is transparent and you project it&#8217;s transparency to underlying object by setting BlendMode.ALPHA.</p>
<p><object id="bt04" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="420" height="315" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="align" value="center" /><param name="allowScriptAccess" value="sameDomain" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="bgcolor" value="#ffffff" /><param name="src" value="http://www.franto.com/uploads/inverseMask.swf" /><param name="name" value="bt" /><embed id="bt04" type="application/x-shockwave-flash" width="420" height="315" src="http://www.franto.com/uploads/inverseMask.swf" name="bt" bgcolor="#ffffff" scale="noscale" quality="high" menu="false" allowscriptaccess="sameDomain" align="center"></embed></object></p>
<p>It is a pity that such valuable functionality remains almost unknown and unused and I think <strong>Adobe is the one to blame here</strong>. The documentation on blending modes is really poor, if not confusing. Especially the LAYER mode is confusing, stating <em>&#8220;This is done automatically if &#8230;is display object container with at least one child object with a blendMode setting other than BlendMode.NORMAL.&#8221;</em> while the ERASE mode reads <em>&#8220;This requires the blendMode of the parent display object to be set to BlendMode.LAYER&#8221;</em> (manually). I have also noticed that adding shadow to the parent object has the same effect here as setting the blend mode to LAYER. In addition, there are some nice pictures on how different blend modes work, but you won&#8217;t find them (nor a reference) in a <a href="http://livedocs.adobe.com/flash/9.0/main/00000162.html">Applying blending modes</a> chapter, nor in <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/BlendMode.html">BlendMode class documentation</a> but only in <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#blendMode">DisplayObject class documentation</a>. To shame Adobe even more, blend modes are available since <em>&#8220;ActionScript 1.0; Flash Player 8&#8243;</em></p>
<p>If this article was of any help to you please lave me a comment <img src='http://franto.com/blog2/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Download source FLA <a title="inverseMask.fla" href="http://www.franto.com/uploads/inverseMask.fla">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://franto.com/inverse-masking-disclosed/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
	</channel>
</rss>

