<?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>Microsheep &#187; tutorial</title>
	<atom:link href="http://www.microsheep.com/tag/tutorial/feed" rel="self" type="application/rss+xml" />
	<link>http://www.microsheep.com</link>
	<description>Flash games and more</description>
	<lastBuildDate>Sun, 15 May 2011 12:28:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Flash tutorial: Dragon flame source</title>
		<link>http://www.microsheep.com/flash-tutorial-dragon-flame-source.html</link>
		<comments>http://www.microsheep.com/flash-tutorial-dragon-flame-source.html#comments</comments>
		<pubDate>Mon, 29 Jun 2009 16:30:12 +0000</pubDate>
		<dc:creator>microsheep</dc:creator>
				<category><![CDATA[Downloads]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[dragon]]></category>
		<category><![CDATA[fire]]></category>
		<category><![CDATA[flame]]></category>
		<category><![CDATA[spit]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.microsheep.com/?p=99</guid>
		<description><![CDATA[Buy this Flash tutorial source files: A flames spitting dragon]]></description>
			<content:encoded><![CDATA[<div class="single_entry_promo"><img src="wp-content/ez_media/tutorials/dragon_flame/tutorial_dragon_buynow.jpg" alt="Zigmond Deluxe" /></div>
<p>Read the tutorial <a href="http://www.microsheep.com/flash-tutorial-dragon-flame.html">here</a>.</p>
<p>Download these FLAs and see how to:</p>
<ul>
<li>Make a dragon head &#8220;look&#8221; at the mouse pointer</li>
<li>Create realistic flames</li>
</ul>
<p>Buy and instantly download <strong>Dragon flame source files</strong> for only $1.99</p>
]]></content:encoded>
			<wfw:commentRss>http://www.microsheep.com/flash-tutorial-dragon-flame-source.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flash tutorial: Dragon flame</title>
		<link>http://www.microsheep.com/flash-tutorial-dragon-flame.html</link>
		<comments>http://www.microsheep.com/flash-tutorial-dragon-flame.html#comments</comments>
		<pubDate>Sun, 28 Jun 2009 15:37:07 +0000</pubDate>
		<dc:creator>microsheep</dc:creator>
				<category><![CDATA[Micro Tutorials]]></category>
		<category><![CDATA[dragon]]></category>
		<category><![CDATA[fire]]></category>
		<category><![CDATA[flame]]></category>
		<category><![CDATA[spit]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.microsheep.com/?p=85</guid>
		<description><![CDATA[Flash tutorial: How to create a flames spitting dragon]]></description>
			<content:encoded><![CDATA[<p>In this tutorial, I&#8217;ll show you how to create a <strong>flames spitting dragon</strong>.<br />
You can see the final result at the <a href="#final">end</a> of this tutorial.<br />
<code></code><br />
Requires: <strong>Flash CS3</strong>, <strong>AS 2.0 knowledge</strong><br />
<code></code><br />
<code></code></p>
<h3>Step 1: Creating a flame movie-clip</h3>
<p>In this step, we&#8217;ll crate a realistic flame movie-clip, using some realistic explosion movie frames.<br />
<code></code><br />
1.1 Search the web for a nice looking animation of an explosion.<br />
Here are some samples:<br />
<a href="http://www.geocities.com/starlinesinc/" target="_blank">http://www.geocities.com/starlinesinc/</a><br />
<a href="http://www.polybeast.de/portfolio/_Explosions.htm" target="_blank">http://www.polybeast.de/portfolio/_Explosions.htm</a><br />
<a href="http://www.videocopilot.net/products/action2/" target="_blank">http://www.videocopilot.net/products/action2/</a><br />
<code></code><br />
I recommend on buying and using a great product by Wondertouch called Particle Illusion:<br />
<a href="http://www.wondertouch.com/" target="_blank">http://www.wondertouch.com/</a><br />
Using this tool you&#8217;ll be able to create a great looking explosion (and many other great effects)<br />
<code></code><br />
1.2 After you got yourself a nice explosion animation, break it into seperate frames, erase the background and save them as separate images<br />
<code></code><br />
1.3 Use these images to create a new movie-clip, for a single &#8220;flame&#8221;<br />
<code></code><br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_flames_sprites_322660240"
			class="flashmovie"
			width="560"
			height="420">
	<param name="movie" value="wp-content/ez_media/tutorials/dragon_flame/flames_sprites.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="wp-content/ez_media/tutorials/dragon_flame/flames_sprites.swf"
			name="fm_flames_sprites_322660240"
			width="560"
			height="420">
	<!--<![endif]-->
		<a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a> 
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object><br />
<code></code></p>
<h3>Step 2: Creating the dragon, and preparing the &#8220;flame&#8221;</h3>
<p>In this step, we&#8217;ll create the Flash document, draw the dragon and do everything but the coding<br />
<code></code><br />
2.1 Create a new Flash document<br />
<code></code><br />
2.2 Draw some sky and a dragon<br />
<code></code><br />
2.3 Get the &#8220;flame&#8221; movie-clip you&#8217;ve created on step 1, add it yo the library, name it &#8220;flame&#8221; and export it to Actionscript (linkage identifier should be &#8220;flame&#8221;)<br />
<code></code><br />
2.4 Create an empty movie-clip and add it to the stage. Name it &#8220;emitter_mc&#8221;. This would be the flames source point<br />
<code></code><br />
<code></code></p>
<h3>Step 3: Adding the logic (code)</h3>
<p>In this step, we&#8217;ll add the code which makes the magic<br />
<code></code><br />
3.1 Add another layer to your FLA, name it &#8220;action&#8221; and paste the following code into it<br />
<code></code></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">//############################################################</span>
<span style="color: #808080; font-style: italic;">// CONSTANTS</span>
<span style="color: #808080; font-style: italic;">//############################################################</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//############################################################</span>
<span style="color: #808080; font-style: italic;">// VARIABLES</span>
<span style="color: #808080; font-style: italic;">//############################################################</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> __flameCount:<span style="color: #0066CC;">Number</span>;
&nbsp;
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">//############################################################</span>
<span style="color: #808080; font-style: italic;">//FUNCTIONS</span>
<span style="color: #808080; font-style: italic;">//############################################################</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//------------------------------------------------------------</span>
<span style="color: #808080; font-style: italic;">// Init</span>
<span style="color: #808080; font-style: italic;">//------------------------------------------------------------</span>
<span style="color: #000000; font-weight: bold;">function</span> Init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">// variables</span>
	__flameCount = <span style="color: #cc66cc;">0</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">// dragon head mover</span>
	emitter_mc.<span style="color: #0066CC;">onEnterFrame</span> = EmitterMover;
&nbsp;
	<span style="color: #808080; font-style: italic;">// spit fire on mouse up</span>
	<span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">onMouseUp</span> = SpitFire;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//------------------------------------------------------------</span>
<span style="color: #808080; font-style: italic;">// SpitFire</span>
<span style="color: #808080; font-style: italic;">//------------------------------------------------------------</span>
<span style="color: #000000; font-weight: bold;">function</span> SpitFire<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">// set flame count</span>
	__flameCount = <span style="color: #cc66cc;">10</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//------------------------------------------------------------</span>
<span style="color: #808080; font-style: italic;">// CreateFlame</span>
<span style="color: #808080; font-style: italic;">//------------------------------------------------------------</span>
<span style="color: #000000; font-weight: bold;">function</span> CreateFlame<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">// add flame movie clip</span>
	<span style="color: #000000; font-weight: bold;">var</span> depth:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">getNextHighestDepth</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000000; font-weight: bold;">var</span> thisFlame_mc:<span style="color: #0066CC;">MovieClip</span> =
		<span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">attachMovie</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;flame&quot;</span>, <span style="color: #ff0000;">&quot;flame&quot;</span>, depth<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">// set flame position</span>
	thisFlame_mc.<span style="color: #0066CC;">_x</span> = emitter_mc.<span style="color: #0066CC;">_x</span>;
	thisFlame_mc.<span style="color: #0066CC;">_y</span> = emitter_mc.<span style="color: #0066CC;">_y</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">// flame rotation is random</span>
	thisFlame_mc.<span style="color: #0066CC;">_rotation</span> = <span style="color: #cc66cc;">360</span> <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">// set azimuth and speed</span>
	thisFlame_mc.<span style="color: #006600;">azimuth</span> 	= -<span style="color: #cc66cc;">35</span>;
	thisFlame_mc.<span style="color: #006600;">speed</span>	= <span style="color: #cc66cc;">25</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">// mover</span>
	thisFlame_mc.<span style="color: #0066CC;">onEnterFrame</span> = FlameMover;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//------------------------------------------------------------</span>
<span style="color: #808080; font-style: italic;">// EmitterMover</span>
<span style="color: #808080; font-style: italic;">//------------------------------------------------------------</span>
<span style="color: #000000; font-weight: bold;">function</span> EmitterMover<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">// if __flameCount &gt; 0, spit flame</span>
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>__flameCount <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #808080; font-style: italic;">// create the actual flame movie clip</span>
		CreateFlame<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		__flameCount--;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//------------------------------------------------------------</span>
<span style="color: #808080; font-style: italic;">// FlameMover</span>
<span style="color: #808080; font-style: italic;">//------------------------------------------------------------</span>
<span style="color: #000000; font-weight: bold;">function</span> FlameMover<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">// move speed (add lift speed)</span>
	<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_x</span> -= <span style="color: #0066CC;">this</span>.<span style="color: #006600;">speed</span> <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">cos</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.<span style="color: #006600;">azimuth</span> <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">PI</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">180</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_y</span> -= <span style="color: #0066CC;">this</span>.<span style="color: #006600;">speed</span> <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">sin</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.<span style="color: #006600;">azimuth</span> <span style="color: #66cc66;">*</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">PI</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">180</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #cc66cc;">5</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">// speed decay</span>
	<span style="color: #0066CC;">this</span>.<span style="color: #006600;">speed</span> <span style="color: #66cc66;">*</span>= <span style="color: #cc66cc;">0.95</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">//############################################################</span>
<span style="color: #808080; font-style: italic;">// MAIN</span>
<span style="color: #808080; font-style: italic;">//############################################################</span>
Init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>3.2 Publish your file and click anywhere on the screen: your dragon should be spitting flames<br />
<code></code><br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_tutorial_dragon_flame_2116569671"
			class="flashmovie"
			width="560"
			height="420">
	<param name="movie" value="wp-content/ez_media/tutorials/dragon_flame/tutorial_dragon_flame.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="wp-content/ez_media/tutorials/dragon_flame/tutorial_dragon_flame.swf"
			name="fm_tutorial_dragon_flame_2116569671"
			width="560"
			height="420">
	<!--<![endif]-->
		<a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a> 
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object><br />
<code></code><br />
<a name="final">That&#8217;s it!</a><br />
<code></code><br />
Here is your dragon, you could use it to create a cool knight / dragon game, or use the same technique to create flame-thrower tank etc.<br />
<code></code><br />
Here is my version of the flames spitting dragon, with the following changes:<br />
1. Better graphics<br />
2. The dragon &#8220;looks&#8221; at the mouse pointer<br />
3. A more realistic flame, using blendMode<br />
<code></code><br />
<a href="http://www.microsheep.com/flash-tutorial-dragon-flame-source.html">Download </a>the source files for this tutorial for only $1.99<br />
<code></code><br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_tutorial_dragon_flame_final_2130480829"
			class="flashmovie"
			width="560"
			height="420">
	<param name="movie" value="wp-content/ez_media/tutorials/dragon_flame/tutorial_dragon_flame_final.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="wp-content/ez_media/tutorials/dragon_flame/tutorial_dragon_flame_final.swf"
			name="fm_tutorial_dragon_flame_final_2130480829"
			width="560"
			height="420">
	<!--<![endif]-->
		<a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a> 
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object><br />
<a href="http://www.microsheep.com/flash-tutorial-dragon-flame-source.html">Download</a> the source files for this tutorial for only $1.99</p>
]]></content:encoded>
			<wfw:commentRss>http://www.microsheep.com/flash-tutorial-dragon-flame.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

