<?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>GUYA.NET &#187; Flash CS3</title>
	<atom:link href="http://blog.guya.net/category/flash-cs3/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.guya.net</link>
	<description>Flash and Everything Else</description>
	<lastBuildDate>Tue, 29 Nov 2011 15:42:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Security flaws in FLA files</title>
		<link>http://blog.guya.net/2008/03/20/security-flaws-in-fla-files/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=security-flaws-in-fla-files</link>
		<comments>http://blog.guya.net/2008/03/20/security-flaws-in-fla-files/#comments</comments>
		<pubDate>Fri, 21 Mar 2008 03:08:59 +0000</pubDate>
		<dc:creator>guya</dc:creator>
				<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Flash General]]></category>
		<category><![CDATA[Flash Security]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blog.guya.net/2008/03/20/security-flaws-in-fla-files/</guid>
		<description><![CDATA[FLA is one of these file format that we&#8217;re used to freely open without any fear. Our complete confidence is going to change since a new exploit has been found. This exploit enable an attacker to manipulate an FLA file &#8230; <a href="http://blog.guya.net/2008/03/20/security-flaws-in-fla-files/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>FLA is one of these file format that we&#8217;re used to freely open without any fear. Our complete confidence is going to change since a new exploit has been found. This exploit enable an attacker to manipulate an FLA file in a way that, when loaded into the Flash CS3 or 8 IDE, it will execute arbitrary code on our machine.</p>
<p>No need to panic, it&#8217;s unlikely that too many of the malicious FLA files are floating around. Just don&#8217;t run any untrusted FLA files until Adobe will issue the fix.</p>
<p><a title="Security hole in Adobe's Flash Basic, Professional and CS3" target="_blank" href="http://www.heise-online.co.uk/security/Security-hole-in-Adobe-s-Flash-Basic-Professional-and-CS3--/news/110370">More info</a></p>
<p><a target="_blank" title="Adobe Flash Professional/Basic Bug in Parsing FLA Files Lets Remote Users Execute Arbitrary Code" href="http://www.securitytracker.com/alerts/2008/Mar/1019681.html">Technical info</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.guya.net/2008/03/20/security-flaws-in-fla-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Call me now! Jajah new Flash widget</title>
		<link>http://blog.guya.net/2007/09/24/call-me-now-jajah-new-flash-widget/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=call-me-now-jajah-new-flash-widget</link>
		<comments>http://blog.guya.net/2007/09/24/call-me-now-jajah-new-flash-widget/#comments</comments>
		<pubDate>Mon, 24 Sep 2007 18:43:42 +0000</pubDate>
		<dc:creator>guya</dc:creator>
				<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Flash General]]></category>
		<category><![CDATA[JAJAH]]></category>
		<category><![CDATA[VOIP 2.0]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://blog.guya.net/2007/09/24/call-me-now-jajah-new-flash-widget/</guid>
		<description><![CDATA[We&#8217;ve just released the Jajah Buttons which enables you to receive calls from your website, blog, online community, email, etc&#8217; directly to your phone and all that without revealing your phone number. Check it out, call me now. [kml_flashembed movie="http://www.jajah.com/buttons/jjb.swf?v=1" &#8230; <a href="http://blog.guya.net/2007/09/24/call-me-now-jajah-new-flash-widget/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve just released the <a target="_blank" title="Jajah buttons" href="http://www.jajah.com/info/services/buttons/">Jajah Buttons</a> which enables you to receive calls from your website, blog, online community, email, etc&#8217; directly to your phone and all that without revealing your phone number. Check it out, call me now.</p>
<p>[kml_flashembed movie="http://www.jajah.com/buttons/jjb.swf?v=1" width="220" height="200" fvars="sn=guy" /]</p>
<p>The Jajah button let&#8217;s you determine when, where and to whom you are available for calls. It also give you a permanent short link that leads people straight to your phone. You can always reach me with this url &#8211; <a target="_blank" title="jajah.com/guy" href="http://www.jajah.com/guy">jajah.com/guy</a></p>
<p>The Flash widget is completely customizable in size, colors, supports multiple languages and have a unique look and feel. The widget was developed in Actionscript 2.0 mainly for compatibility reasons, it was intended to be released some time ago, before the <a target="_blank" title="Adobe Flash Player Version Penetration" href="http://www.adobe.com/products/player_census/flashplayer/version_penetration.html">Flash 9 Player reached 90%.</a> Over that time it was overdeveloped with many features and a complete set of controls that were developed from scratch. Many of these features did not make it to the final (first) release, but, are ready to be put back in when the time is right, so stay tuned if you&#8217;re interested in this kind of stuff.</p>
<p>The Jajah Button graphics were designed by the uber talented crew at <a target="_blank" title="Ichiban" href="http://www.ichiban.at">Ichiban.</a></p>
<p><img alt="Jajah widget colors" id="image155" src="http://blog.guya.net/wp-content/uploads/2007/09/widget_colors_cut.jpg" /></p>
<p>Call animation:</p>
<p><img alt="Jajah widget call animation" id="image164" src="http://blog.guya.net/wp-content/uploads/2007/09/callAnim_1.gif" /></p>
<p>Developing Actionscript 2.0 controls is a tiring and unappreciated task. Show it to a non-flash developer and they&#8217;ll tell you &#8211; &#8220;thats nice but I have that in HTML also, I simply write an input tag&#8230;&#8221;, they simply can&#8217;t see the difference. This strengthen my feeling that some people, mainly developers, are color blind and can&#8217;t differentiate between a circle and a box <img src='http://blog.guya.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . If Microsoft is expecting these guys to do something appropriate with Silverlight, then they shouldn&#8217;t, cause <a target="_blank" title="What Microsoft Doesn't Want You to Know about WPF" href="http://software.ericsink.com/entries/Ugly_WPF.html">it ain&#8217;t gonna happen</a>.</p>
<p>Using the macromedia&#8217;s V2 components, as always, didn&#8217;t seem right. The Flash CS3 Actionscript 3.0 component set, although modest, <a target="_blank" title=" Flash CS3 components" href="http://www.adobe.com/newsletters/edge/july2007/articles/article5/index.html">looks like something</a> that is more reasonable to inherit from. To complete your set, take a look at <a target="_blank" title="ASTRA: ActionScript Toolkit for Rich Applications" href="http://developer.yahoo.com/flash/">yahoo&#8217;s Flash components</a>.</p>
<p>This is the code I used to embed the Jajah flash widget inside this post using the <a target="_blank" title="Kimily Flash Embed" href="http://blog.guya.net/2006/03/29/easiest-way-to-embed-flash-inside-wordpress/">Kimily Flash Embed</a> wordpress plugin. There are more parameters you can add to make its colors look more like your style, check the <a target="_blank" title="Jajah Buttons Editor" href="http://www.jajah.com/buttons/editor/">editor</a> for that. The <a target="_blank" title="Jajah Buttons Editor" href="http://www.jajah.com/buttons/editor/">Jajah Buttons Editor</a> also gives you the code snippet suitable for your needs.<br />
[code] [kml_flashembed movie="http://www.jajah.com/buttons/jjb.swf?v=1" width="220" height="200" fvars="sn=guy" /] [/code]</p>
<p><strong>Screenshots from the editor:</strong></p>
<p>Customize colors and size</p>
<p><img alt="Editor - Customize colors" id="image160" src="http://blog.guya.net/wp-content/uploads/2007/09/editor_01b.jpg" /></p>
<p>Set your availability</p>
<p><img alt="Editor - Availability 1" id="image161" src="http://blog.guya.net/wp-content/uploads/2007/09/editor_02b.gif" /></p>
<p>Countries you wanna get calls from</p>
<p><img alt="Editor - Availability countries" id="image162" src="http://blog.guya.net/wp-content/uploads/2007/09/editor_03b.gif" /></p>
<p>Callers blacklist</p>
<p><img alt="Editor - Availability blacklist" id="image163" src="http://blog.guya.net/wp-content/uploads/2007/09/editor_04b.gif" /></p>
<p><a target="_blank" title="Jajah Buttons" href="http://www.jajah.com/info/services/buttons/">For more info go here&#8230;</a></p>
<p><a title="Editor - Availability 1" class="imagelink" href="http://blog.guya.net/wp-content/uploads/2007/09/editor_02.gif" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.guya.net/2007/09/24/call-me-now-jajah-new-flash-widget/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Too much focus will kill you</title>
		<link>http://blog.guya.net/2007/07/08/too-much-focus-will-kill-you/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=too-much-focus-will-kill-you</link>
		<comments>http://blog.guya.net/2007/07/08/too-much-focus-will-kill-you/#comments</comments>
		<pubDate>Sun, 08 Jul 2007 14:53:59 +0000</pubDate>
		<dc:creator>guya</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Flash General]]></category>
		<category><![CDATA[Flash Security]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blog.guya.net/2007/07/08/too-much-focus-will-kill-you/</guid>
		<description><![CDATA[I&#8217;ve just came across of a way to kill the Flash player with a few lines of AS 2.0. I know of at least one other way of killing the Flash player along with it&#8217;s host, may it be the &#8230; <a href="http://blog.guya.net/2007/07/08/too-much-focus-will-kill-you/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just came across of a way to kill the Flash player with a few lines of AS 2.0. <a title="Watch me bleead - Fatal Error in Flash 7" href="http://blog.guya.net/2006/05/21/watch-me-bleed-fatal-error-in-flash-70-72/">I know of at least one other way of killing the Flash player</a> along with it&#8217;s host, may it be the browser or the Flash IDE, but this was with the old 7th player, this time we&#8217;re talking about the latest 9th version. It&#8217;s a little awkward, and don&#8217;t ask me how I got it, but, it involves a MovieClip, a TextField, Selection, Macromedia&#8217;s Delegate, a filter, and a trace, yeah, it won&#8217;t work without a call to trace. I think the main trouble maker is the Selection.onSetFocus, but, I couldn&#8217;t recreate it without any of the above ingredients, and I have a feeling that AS2&#8242;s trace is also problematic in Flash Player 9. (You should anyway &#8220;Omit trace actions&#8221;, from the settings, when publishing swfs)</p>
<p><img id="image134" src="http://blog.guya.net/wp-content/uploads/2007/07/focus_kills.gif" alt="Focus Kills" /></p>
<p>I haven&#8217;t tried it, but, I doubt that it can be recreated with AS3 on the VM2, it&#8217;s the VM1 that we have to carry along for backward compatibility that causes all this trouble. I tested it on some different machines with different Flash players and so far it crushed them all, here is the list:</p>
<p>Ver: WIN 8,0,22,0 | Debug: true  | OS: Windows XP<br />
Ver: WIN 9,0,16,0 | Debug: true  | OS: Windows XP<br />
Ver: WIN 9,0,28,0 | Debug: false | OS: Windows XP<br />
Ver: WIN 9,0,45,0 | Debug: false | OS: Windows XP<br />
Ver: WIN 9,0,45,0 | Debug: false | OS: Windows (Server 2003)<br />
Ver: WIN 9,0,45,0 | Debug: true  | OS: Windows Vista<br />
Ver: WIN 9,0,45,0 | Debug: false | OS: Windows Vista<br />
Ver: WIN 9,0,47,0 | Debug: false | OS: Windows Vista<br />
Ver: MAC 9,0,28,0 | Debug: false | OS: Mac OS 10.4.9</p>
<p>Copy this code into an empty FLA first frame, or download the source below to see how it goes.</p>
<pre lang="Actionscript">
var mc:MovieClip = this.createEmptyMovieClip("mc", 0);

var tf:TextField = this.createTextField("tf", 1, 20, 20, 300, 100);
tf.type = "input";
tf.border = true;
tf.text = "Flash Player Varsion: " + System.capabilities.version + "nDebug Player: " + System.capabilities.isDebugger + "nOperating System: " + System.capabilities.os + "nnClick here or press the TAB key to kill Flash";

tf.onSetFocus = mx.utils.Delegate.create(this, glow);

Selection.addListener(this);

function onSetFocus(oldf:Object, newf:Object):Void{
Selection.setFocus(oldf);
}

function glow(){
mc.filters = [new flash.filters.BevelFilter()]; // any filter except BitmapFilter()
trace(mc.filters);
}
</pre>
<p><a title="Focus Kills source files" href="http://blog.guya.net/wp-content/uploads/2007/07/focus_kills.zip">Download source files.</a></p>
<p><a title="Crush you" href="http://blog.guya.net/wp-content/uploads/2007/07/focus_kills_F8.swf">Try it (Warnning!!!, it may crash your browser)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.guya.net/2007/07/08/too-much-focus-will-kill-you/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Shape Hints &#8211; Have you forgotten how good they taste ?</title>
		<link>http://blog.guya.net/2007/04/14/shape-hints-have-you-forgotten-how-good-they-taste/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=shape-hints-have-you-forgotten-how-good-they-taste</link>
		<comments>http://blog.guya.net/2007/04/14/shape-hints-have-you-forgotten-how-good-they-taste/#comments</comments>
		<pubDate>Sun, 15 Apr 2007 01:17:36 +0000</pubDate>
		<dc:creator>guya</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Flash General]]></category>

		<guid isPermaLink="false">http://blog.guya.net/2007/04/14/shape-hints-have-you-forgotten-how-good-they-taste/</guid>
		<description><![CDATA[These days it&#8217;s easy to forget that Flash is an amazing classic animation tool. Ever since the arrival of the fine Macromedia Tween Class and the amazing Fuse Kit (a new version was just released) and great books like Foundation &#8230; <a href="http://blog.guya.net/2007/04/14/shape-hints-have-you-forgotten-how-good-they-taste/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>These days it&#8217;s easy to forget that Flash is an amazing classic animation tool. Ever since the  arrival of the fine <a title="Macromedia's Tween Class" href="http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&#038;file=00004155.html">Macromedia Tween Class</a> and the amazing <a title="http://www.mosessupposes.com/Fuse/index.html" target="_blank" href="http://blog.guya.net/wp-admin/The%20Fuse%20Kit">Fuse Kit</a>  (a new version was just released) and great books like <a title="Not an affiliate link" target="_blank" href="http://www.amazon.com/gp/product/1590595181/qid=1131559860/sr=8-1/ref=pd_bbs_1/002-0952178-2854438?n=507846&#038;s=books&#038;v=glance">Foundation Actionscript Animation</a>, by: <a target="_blank" href="http://bit-101.com">keith peters</a>, <a title="Foundation Actionscript 3.0 Animation: Making Things Move!" target="_blank" href="http://www.amazon.com/Foundation-Actionscript-3-0-Animation-Making/dp/1590597915/ref=pd_bbs_sr_2/002-0079416-5943245?ie=UTF8&#038;s=books&#038;qid=1174500088&#038;sr=1-2">new version for Actionscript 3.0 is on the way</a> <span style="font-size: 9px">(not affiliat)</span>, it seems that we want to script our animation no matter what! Now, don&#8217;t get me wrong, I also think that scripted animation is very powerful and I use it all the time. But, I sometimes find myself over using it in places where I should have used a simple tweening instead.With the 8th version of Flash we received a nice improvement to the tweening capabilities, it is now possible to achieve a relatively complex tweening animation with only two key frames. Check out this tutorial: <a title="Achieving Amazing Easing Effects in Flash" target="_blank" href="http://www.adobe.com/devnet/flash/articles/custom_easing.html">Achieving Amazing Easing Effects in Flash</a>, by: Rafiq R. Elmansy.</p>
<p>And what about the new kid animation abilities?! With what I&#8217;ve seen so far in the main <a target="_blank" title="WPF Expression" href="http://www.microsoft.com/products/expression/en/default.mspx">WPF interactive editor</a> CTP (beta) vesions, it fall short of Flash, it has an interesting concept of having the animation of an object as just another property of that object. But, it lake of satisfactorily key-frames controll and things like shape tween are not existent. These things might be improved in the final version, but it seems to me that Microsoft is still donesn&#8217;t pay atantion to creativity as it should have, and is mainly thinking about GUI creation.</p>
<p>I just hope that Adobe wont forget the origins of Flash and one of the main reasons it is such a terrific tool, and is planing a tons more of animation and creativity features in the next Flash IDE release.</p>
<p>Note: I&#8217;ve written this post some time back, before the announcement of the new <a title="Flash CS3 feature list" target="_blank" href="http://www.adobe.com/products/flash/features/allfeatures/">Flash CS 3 (Flash 9) feature list.</a> It seems that we&#8217;ll get some animation improvements, the two most interesting improvements looks like, <strong>Custom easing control</strong> and <strong>Copy and paste animations</strong>. The first will &#8220;provides independent control of position, rotation, scale, color, and filters&#8221;, it will give us much finer control over every keyframe in our animation similar to high-end animation software. The second will let us copy timeline animations as fully editable Actionscript 3.0 XML objects for easy duplication and modification. It looks like even complex tweening that uses a <a title="flashmagazine - Flash CS3 Preview" target="_blank" href="http://www.flashmagazine.com/1394.htm">motion guide</a> can be copied and edited, no clarity about the coping of a shape tweens though. I guess no one at adobe have the nerve to dive into the Flash core and update something as the Shape Hints or even the Timeline itself, but overall, it seems like a nice update in terms of the animation abilities of Flash.</p>
<p>Flash CS3 will be released in April 20th.</p>
<p><strong>Behind The Curtains &#8211; Shape Hints Animation Tutorial</strong></p>
<p>Hover above this box:<br />
[kml_flashembed movie="http://blog.guya.net/wp-content/uploads/2007/04/curtain.swf" width="320" height="240"  /]</p>
<p>I was amazed when I first saw shape animation in flash, create two different shapes on two different frames and easily get a morphing animation between them&#8230;</p>
<p>Few years back I was asked to make a flash banner for <a target="_blank" href="http://www.habima.org.il/">Habima</a> Theater. I came with the, somewhat cheesy, idea of a animating a red curtain, and inside it, to fade images from few of the theater best shows.</p>
<p>Creating a curtain animation in Flash shouldn&#8217;t be a problem, I thought, I&#8217;ll create the start and finish frames and my beloved Flash will do the rest. The start frame of a simple curtain animation is simply a box and the end frame is an open curtain&#8230;</p>
<p><span style="font-weight: bold">1.</span> Create a new Flash Document, resize it to 320 x 240 and set the Frame rate to 30.</p>
<p><img alt="Document Properties" id="image124" src="http://blog.guya.net/wp-content/uploads/2007/04/document_properties_2.png" /></p>
<p><span style="font-weight: bold">2.</span> Create a red rectangle (R) anywhere on the stage no matter what size, select the rectangle and set it&#8217;s properties (Show/Hide Properties Ctrl+F3): width and height to 160 and 240 respectively, x and y both to 0.</p>
<p><span style="font-weight: bold">3.</span> With the rectangle still selected press F8 to turn it into a Movie clip, and name it curtain.</p>
<p><img alt="Convert to Movie clip" id="image123" src="http://blog.guya.net/wp-content/uploads/2007/04/convert_to_mc_2.png" /></p>
<p><span style="font-weight: bold">4.</span> Inside the properties panel name the instance of the curtain on stage to leftCurtain.</p>
<p><img alt="properties" id="image113" src="http://blog.guya.net/wp-content/uploads/2007/04/curtain_properties.png" /></p>
<p><span style="font-weight: bold">5.</span> Double click on leftCurtain to step inside it. On the Timeline (Show/Hide the Timeline Ctrl+Alt+T) name Layer 1 to curtain. Right click on the 30th frame and select Insert Keyframe (F6).</p>
<p><img alt="Insert Keyframe" id="image114" src="http://blog.guya.net/wp-content/uploads/2007/04/insert_keyframe.png" /></p>
<p><span style="font-weight: bold">6.</span> The first frame of our animation, the closed state of our curtain is already done on frame 1, we&#8217;ll now create the opened  frame on frame 30. Deselect the red rectangle by clicking anywhere outside it on the stage. Point your mouse to the bottom right corner of the rectangle until the mouse cursor turns into a right angle shape, this indicates that you can grab the corner. With the Shift Key pressed click and drag the rect corner to the left and to about 45px from the left edge.</p>
<p><img id="image116" alt="Drag Corner" src="http://blog.guya.net/wp-content/uploads/2007/04/drag_corner_2_cut.png" /></p>
<p><span style="font-weight: bold">7.</span> In order to achieve an open curtain look we&#8217;ll split it near the bottom. Point the cursor near the edge of the now diagonal line to about 50px from the bottom. When the cursor changes its shape to a small round line, press Ctrl and click to drag the new point to left to about 30px from the edge. Pressing on the Ctrl key while dragging a line breaks it and creates a new point where the break is.</p>
<p><img id="image117" alt="Drag Middle" src="http://blog.guya.net/wp-content/uploads/2007/04/drag_middle_2.png" /></p>
<p><span style="font-weight: bold">8.</span> Similar to the previous step, hover with the mouse near the right edge of the rectangle, when the cursor change it&#8217;s shape click and drag (without pressing Ctrl) the edge until it gets a nice belly, do the same for the small right edge.</p>
<p><img alt="Drag Belly" id="image118" src="http://blog.guya.net/wp-content/uploads/2007/04/drag_belly.png" /></p>
<p><span style="font-weight: bold">9.</span> We done the entire 2 frames of our animation, now it&#8217;s time to animate it. In the Timeline Select frame 1 and in the properties panel set Tween to Shape, also set Ease to 70, it will make the animation nicer by easing it near the end.</p>
<p><img id="image119" alt="Tween" src="http://blog.guya.net/wp-content/uploads/2007/04/tween.png" /></p>
<p><span style="font-weight: bold">10.</span> It looks like we got ourselves an opening curtain animation, but testing the movie (Ctrl+Enter) reveals that though we got an animation it&#8217;s nothing like a believable curtain. This is because Flash can&#8217;t know what exactly we&#8217;re animating and how we like the morphing to be done. Flash simply guess, and this time its guess is very wrong. This is where Shape Hints come to our aid.</p>
<p><span style="font-weight: bold">11.</span> Select frame 1 and click on Modify -> Shape -> Add Shape Hint (Ctrl+Shift+H)  5 times. This will create 5 Shape Hints identified by characters from a to e. Arrange the Hints in the 4 corners and 1 where the break is, look at the image. Go to frame 30 and arrange the Hints respectively to the 1th frame. Every Hint character in frame 1 must correspond to the Hint character in frame 30.</p>
<p><img id="image120" alt="Shape Hints" src="http://blog.guya.net/wp-content/uploads/2007/04/shape_hints.png" /></p>
<p>Tip: you can lock the layer and still be able to edit the Shape Hints.</p>
<p>Tip: Show/Hide all the Shape Hints Ctrl+Alt+H</p>
<p><span style="font-weight: bold">12.</span> Now lets test our movie (Ctrl+Enter) to see our curtain animate to its open state as it should.</p>
<p><span style="font-weight: bold">13.</span> To create the closing animation the simplest way is to duplicate the frames and then reverse it. Select all the frames in the curtain layer by clicking on its name and Right click -> Copy frame then Right click on frame 31 and select Paste frames. This will copy the opening animation, Shape Hints included. Click on frame 31 and while the Shift key is pressed click on frame 60 to select all of this frames range. Right click on the selected frames and click Reverse frames, it&#8217;ll reverse the animation but sadly it&#8217;ll also break the Shape Hints of this section, you&#8217;ll have to create it again for frame 31 and 60, similar to the previous step.</p>
<p><span style="font-weight: bold">14.</span> Select frame 31 and in the properties panel set the Ease to -50, this will create an ease-in effect so the closing animation will start a bit slower and then accelerate as it goes.</p>
<p><span style="font-weight: bold">15.</span> Test the movie to see the (half) curtain open and close. Thats it, we&#8217;re done our curtain animation it&#8217;s time to duplicate the half into a full curtain and put some interactivity into it.</p>
<p><span style="font-weight: bold">16.</span> Before you go back to the main stage add another Layer inside the curtain Movie clip and name it actions. Click on Window -> Actions (F9), while the first frame selected enter the code stop(); inside the Action panel. Create a new key frame on frame 30 of the actions layer and put a stop(); in there as well. This will prevent the curtain from animating on its own and we&#8217;ll control it with Actionscript.</p>
<p><img alt="Stop Action" id="image121" src="http://blog.guya.net/wp-content/uploads/2007/04/stop_action.png" /></p>
<p><span style="font-weight: bold">17.</span> Go back up to Scene 1 by double clicking on an empty area of the stage. Copy the leftCurtain Movie clip, paste it any where, set its x to 160, its y to 0 and its name to rightCurtain.</p>
<p><span style="font-weight: bold">18.</span> With the rightCurtain selected click on Modify -> Transform -> Flip Horizontal.</p>
<p><span style="font-weight: bold">19.</span> On the main Timeline in Scene 1 create another layer and name it actions open the actions panel (F9) and enter the following script:</p>
<p>function openCurtain():Void{<br />
leftCurtain.gotoAndPlay(1);<br />
rightCurtain.gotoAndPlay(1);<br />
}</p>
<p>function closeCurtain():Void{<br />
leftCurtain.gotoAndPlay(31);<br />
rightCurtain.gotoAndPlay(31);<br />
}</p>
<p><span style="font-weight: bold">20.</span> We can call these functions to open and close the curtain as we like, in this example we&#8217;ll open the curtain when the mouse roll over it and close it when it roll out.</p>
<p><span style="font-weight: bold">21.</span> Create another layer beneath the actions layer but above the curtain layer and name it hitArea. Draw a green rectangle and set it&#8217;s alpha to 0%, the color doesn&#8217;t really matter  since this rect will be invisible, also set it&#8217;s width to 320, height to 240 and x, y to 0. Click F8 to turn this rectangle to a Movie clip and name it hitArea. in the properties panel name the hitArea instance on the stage to <strong>hit</strong>.</p>
<p><span style="font-weight: bold">22.</span> Add this code to the actions layer:</p>
<p>hit.onRollOver = openCurtain;<br />
hit.onRollOut = closeCurtain;</p>
<p>Now every time we roll over the invisible hit Movie clip that is above the curtain the function openCurtain will be called and when we&#8217;ll roll out from it the closeCurtain will be called.</p>
<p><span style="font-weight: bold">23.</span> Test the movie to see that we now got our interactive animated curtain, roll over it and it opens, roll out and it closes. But, if you&#8217;ll play with it a little you&#8217;ll see that it&#8217;s not always act as it should. For example, when you roll out while the curtain is opening it jumps to beginning of the closing sequence instead of closing from the current position. To fix that we&#8217;ll add a simple calculation to find the right frame we need to jump to in order for the animation to look seamless.</p>
<p><span style="font-weight: bold">24.</span> Replace the code in the action frame with this:</p>
<p>hit.onRollOver = openCurtain;<br />
hit.onRollOut = closeCurtain;</p>
<p>var nTotalFrames:Number = leftCurtain._totalframes;</p>
<p>function openCurtain():Void{<br />
var nFrame:Number;<br />
if(leftCurtain._currentframe > nTotalFrames / 2){<br />
nFrame = leftCurtain._totalframes &#8211; leftCurtain._currentframe + 2;<br />
}else{<br />
nFrame = leftCurtain._currentframe;<br />
}<br />
leftCurtain.gotoAndPlay(nFrame);<br />
rightCurtain.gotoAndPlay(nFrame);<br />
}</p>
<p>function closeCurtain():Void{<br />
var nFrame:Number = leftCurtain._totalframes &#8211; leftCurtain._currentframe;<br />
leftCurtain.gotoAndPlay(nFrame);<br />
rightCurtain.gotoAndPlay(nFrame);<br />
}</p>
<p>We just changed the open and close functions to be a bit more smart ones, function that knows to which frame to gotoAndPlay, it does it according to the current frame and not just jump blindly to the beginning of each sequence.</p>
<p>Test the movie and behold, our interactive curtain is ready.</p>
<p>Tip: you can add this code, hit.useHandCursor = false; so the cusror won&#8217;t change into a hand when you hover the curtain.</p>
<p><a title="Curtain Animation source files" href="http://blog.guya.net/wp-content/uploads/2007/04/curtain.zip">Download Curtain Animation source files</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.guya.net/2007/04/14/shape-hints-have-you-forgotten-how-good-they-taste/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

