<?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>SF-Zone.net &#187; Flash &#8211; AS3</title>
	<atom:link href="http://sf-zone.net/category/programming/flash-as3/feed/" rel="self" type="application/rss+xml" />
	<link>http://sf-zone.net</link>
	<description>Design and Programming Blog</description>
	<lastBuildDate>Thu, 02 Sep 2010 13:42:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>AS3 Score Protection System</title>
		<link>http://sf-zone.net/2009/12/07/as3-score-protection-system/</link>
		<comments>http://sf-zone.net/2009/12/07/as3-score-protection-system/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 20:20:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash - AS3]]></category>

		<guid isPermaLink="false">http://sf-zone.net/?p=339</guid>
		<description><![CDATA[In the past few weeks I&#8217;ve been working on a small game engine for flash. Well&#8230;I can&#8217;t say it is an actual game engine, but more like a collection of classes that make game development a lot easier. One of the first classes I made was a score system that protects the score from game hackers. I [...]]]></description>
			<content:encoded><![CDATA[<p>In the past few weeks I&#8217;ve been working on a small game engine for flash. Well&#8230;I can&#8217;t say it is an actual game engine, but more like a collection of classes that make game development a lot easier. One of the first classes I made was a score system that protects the score from game hackers. I decided to release this for anyone that may want to use it.<span id="more-339"></span><br />
<!--adsense#ad2--><br />
If you are a flash game developer you may know that that there are a lot of gamers that simply hack the game and this way they can submit a very big score. This is done while the game is player just by modifying the value of the variable where the score is stored. That is why it is very important to protect it.</p>
<p>That is exactly why I made a small class that does exactly that. The &#8220;Score&#8221; class does not store the actual score, but it stores another value that is calculated every time the score is updated. This way the &#8220;hacker&#8221; does not know exactly for what value to search. Ok&#8230;but how does this make the score so that it can;t be modified from outside? The script has another security layer. This one more secure.</p>
<p><!--adsense#ad1--><br />
The score is also kept in another variable, end if the script detects that the actual score and the security variable don;t match, it detects that the score has been hacked. The trick is that the security variable is an array, and not an actual number. I won;t discuss how this is calculated or anything like that&#8230;</p>
<p>OK! But how do you use it? First of all download the script and extract them in the same folder as your game. After that import the score class:<br />
<code>import zone.Score;</code></p>
<p>Next you need to make a new variable that holds the score:<br />
<code>var score:Score = new Score(0); //0 is the initial score</code></p>
<p>To retrieve the score all you need to do is this:<br />
<code>score.getScore()</code><br />
This returns the correct score <strong>IF</strong> the script does not detect any outside modifications. Otherwise it returns -9999. This is where you should verify the return value, and if it is -9999, make sure your game stops playing or something.</p>
<p>If you want to set a new score, just call this:<br />
<code>score.setScore(10) //10 is the new score. it can be any int value</code></p>
<p><!--adsense#ad1--><br />
I attached a FLA file that you should look over. It is really easy to keep the score in a secure way.</p>
<p>This small SWF file increments the score by 1 every time you press the button. If it detects that the score was modified from an outside source, it goes to the next frame where &#8220;Score hacked&#8221; is displayed.</p>
<p>[kml_flashembed publishmethod="static" fversion="9.0.0" movie="http://sf-zone.net/wp-content/uploads/2009/12/demo_score.swf" width="200" height="200" targetclass="flashmovie"]</p>
<p><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></p>
<p>[/kml_flashembed]</p>
<p>So,What are you waiting for? Download the class. Don&#8217;t forget to post a &#8220;thank you&#8221; if you find it useful. Also, this can be used to store any int variable that need to be protected (like ammo).</p>
<p style="text-align: center;"><a href="http://sf-zone.net/wp-content/uploads/2009/12/demo_score.zip"><img class="aligncenter" title="Download" src="http://sf-zone.net/wp-content/uploads/2008/02/zip.png" alt="" width="128" height="128" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://sf-zone.net/2009/12/07/as3-score-protection-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Graph &#8211; Free Script</title>
		<link>http://sf-zone.net/2009/05/27/flash-graph-free-script/</link>
		<comments>http://sf-zone.net/2009/05/27/flash-graph-free-script/#comments</comments>
		<pubDate>Wed, 27 May 2009 21:07:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash - AS3]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[flash graph]]></category>
		<category><![CDATA[flash graph script]]></category>
		<category><![CDATA[free flash script]]></category>
		<category><![CDATA[graph script free]]></category>

		<guid isPermaLink="false">http://sf-zone.net/?p=300</guid>
		<description><![CDATA[OK! I made a new sript and I am sure you will love this one. It is a flash Graph script. You can use it to display graphs on you website wery easy with no coding necesary. Just modify the XML file and you are ready to go. You can ad as many values as [...]]]></description>
			<content:encoded><![CDATA[<p>OK! I made a new sript and I am sure you will love this one. It is a flash Graph script. You can use it to display graphs on you website wery easy with no coding necesary. Just modify the XML file and you are ready to go. <span id="more-300"></span><br />
<!--adsense#ad2-->You can ad as many values as you want, as long as you follow the same XML structure.<br />
<code><br />
&lt;day&gt;<br />
&lt;label&gt;Day 1&lt;/label&gt;<br />
&lt;value&gt;768&lt;/value&gt;<br />
&lt;/day&gt;<br />
</code><br />
You can ad a label and a value.</p>
<p>Very important is to add the max value possible. This is to put the graph in an interval on the screen. For example, if your maximum value for one day is 996, you can put the &lt;max&gt; value to 1000.</p>
<p>Also, you can set in the XML file if you want the dots to be shown on the values or not and also if you want the graph to have a fill under it.</p>
<p><strong>How to include the graph</strong></p>
<p>I use swfobject to include the graph. THis is to use flashvars for the path to the XML file. I have included the HTML file so you can see how everything is done. All you have to modify is the flashvars.xmlPath to point to the actual path of your xmlFile.</p>
<p><strong><br />
</strong><br />
<!--adsense#ad1--><br />
<strong>Example</strong><br />
Below is an example. This is the blue one.<br />
<script type="text/javascript" src="swfobject.js"></script><br />
		<script type="text/javascript">
			var flashvars = {};
			flashvars.xmlPath = "http://sf-zone.net/uploads/graph.xml";
			var params = {};
			var attributes = {};
			swfobject.embedSWF("http://sf-zone.net/uploads/graph.swf", "graph", "560", "300", "9.1.0", "expressInstall.swf", flashvars, params, attributes);
		</script></p>
<div id="graph">
			<a href="http://www.adobe.com/go/getflashplayer"><br />
				<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /><br />
			</a>
		</div>
<p><strong>Color Variations</strong></p>
<p>In the zipfile I included more color variation: red, purple, blue, green and lime.</p>
<p><strong><a href="http://www.mediafire.com/file/jnmmzmoinhy/graph.zip"><img class="aligncenter size-full wp-image-9" title="Upload Zip" src="http://sf-zone.net/wp-content/uploads/2008/02/zip.png" alt="Upload Zip" width="128" height="128" /></a><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://sf-zone.net/2009/05/27/flash-graph-free-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free Flash Banner Rotator</title>
		<link>http://sf-zone.net/2009/05/24/free-flash-banner-rotator/</link>
		<comments>http://sf-zone.net/2009/05/24/free-flash-banner-rotator/#comments</comments>
		<pubDate>Sun, 24 May 2009 17:06:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash - AS3]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[banner rotator]]></category>
		<category><![CDATA[flash banner rotator]]></category>
		<category><![CDATA[free banner rotator]]></category>
		<category><![CDATA[free flash script]]></category>

		<guid isPermaLink="false">http://sf-zone.net/?p=295</guid>
		<description><![CDATA[Hello all! It has been a long time since I posted something new. Anyway&#8230;I made a small script for you all. It is a Flash banner rotator. It is really easy to change the the images, text and URL of the images. You don&#8217;t even need Flash. All the information is read from a XML [...]]]></description>
			<content:encoded><![CDATA[<p>Hello all! It has been a long time since I posted something new.</p>
<p>Anyway&#8230;I made a small script for you all. It is a Flash banner rotator.<span id="more-295"></span><br />
<!--adsense#ad2-->It is really easy to change the the images, text and URL of the images. You don&#8217;t even need Flash. All the information is read from a XML file (that can be opened with any text editor). There isn&#8217;t a max number of images that can be loaded&#8230;but I don;t recommend having more than 6&#8230;</p>
<p>Also,  since this is free there is also a link back to my website (the last image from the banner rotator&#8230;and this is loaded automatically every time). If you want this removed it costs only 3$. Just send me an email fro more information.</p>
<p>Also, if you want other size post a comment and I will try to make it as soon as possible&#8230;currently it is only at 400&#215;250</p>
<p><a href="http://www.mediafire.com/file/kwnmxty2nyh/bannerRotator.zip"><img class="aligncenter size-full wp-image-9" title="Upload Zip" src="http://sf-zone.net/wp-content/uploads/2008/02/zip.png" alt="Upload Zip" width="128" height="128" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://sf-zone.net/2009/05/24/free-flash-banner-rotator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Text with lines background &#8211; AS3 tutorial</title>
		<link>http://sf-zone.net/2009/02/12/text-with-lines-background-as3-tutorial/</link>
		<comments>http://sf-zone.net/2009/02/12/text-with-lines-background-as3-tutorial/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 21:15:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash - AS3]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[AS3 effect]]></category>
		<category><![CDATA[Flash text effect]]></category>

		<guid isPermaLink="false">http://sf-zone.net/?p=230</guid>
		<description><![CDATA[A friend showed me an effect made in Photoshop today. My response was: This can be done with only a few lines of code in Flash. I know that what you are about to see is not really that interesting&#8230;but hei&#8230;it is the 4th &#8220;tutorial&#8221; this week and I am running out of ideas.[kml_flashembed fversion="9.1.0" [...]]]></description>
			<content:encoded><![CDATA[<p>A friend showed me an effect made in Photoshop today. My response was: This can be done with only a few lines of code in Flash. I know that what you are about to see is not really that interesting&#8230;but hei&#8230;it is the 4th &#8220;tutorial&#8221; this week and I am running out of ideas.<span id="more-230"></span>[kml_flashembed fversion="9.1.0" movie="http://sf-zone.net/wp-content/uploads/2009/02/tutorial2.swf" targetclass="flashmovie" useexpressinstall="true" publishmethod="static" width="400" height="250"]<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></p>
<p>[/kml_flashembed]</p>
<p>Also, don&#8217;t forget to download the source.</p>
<p><a href="http://sf-zone.net/wp-content/uploads/2009/02/texteffect.zip"><img class="aligncenter size-full wp-image-213" title="download_fla" src="http://sf-zone.net/wp-content/uploads/2009/02/download_fla.png" alt="download_fla" width="229" height="57" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://sf-zone.net/2009/02/12/text-with-lines-background-as3-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving Stars Loader &#8211; AS3 Tutorial</title>
		<link>http://sf-zone.net/2009/02/11/moving-stars-loader-as3-tutorial/</link>
		<comments>http://sf-zone.net/2009/02/11/moving-stars-loader-as3-tutorial/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 21:30:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash - AS3]]></category>
		<category><![CDATA[AS3 load]]></category>
		<category><![CDATA[AS3 loader]]></category>
		<category><![CDATA[flash loader]]></category>
		<category><![CDATA[flash loading animation]]></category>
		<category><![CDATA[glow loader]]></category>
		<category><![CDATA[loading screen]]></category>

		<guid isPermaLink="false">http://sf-zone.net/?p=223</guid>
		<description><![CDATA[OK! This should have been an easy tutorial, but I ended up working on it a lot more than I expected. First&#8230;I did not get the effect I wanted (but I got this one and it looks cool&#8230;so it is not important). Bust what is important, is that flash runs strange&#8230;and I mean really strange [...]]]></description>
			<content:encoded><![CDATA[<p>OK! This should have been an easy tutorial, but I ended up working on it a lot more than I expected. First&#8230;I did not get the effect I wanted (but I got this one and it looks cool&#8230;so it is not important). Bust what is important, is that flash runs strange&#8230;and I mean really strange sometimes.<span id="more-223"></span><br />
It should have been easy: add an ellemet on the stage, make it fade every frame (with 0.1) , if it&#8217;s alpha exactly 0.8, add a new element. Simple, right?<br />
<!--adsense#ad1--><br />
The code should have been:<br />
[code lang="actionscript"]<br />
e.currentTarget.alpha-=0.1;<br />
if(e.currentTarget.alpha==0.8){<br />
//code to ad a new element on the stage<br />
}<br />
[/code]<br />
Well&#8230;guess what&#8230;apparently e.currentTarget.alpha will never be exactly 0.8<br />
Flash does not subtract 0.1 from the alpha of the element&#8230;but a strange number&#8230;and if we trace the alpha, we will get this:<br />
<code><br />
1<br />
0.8984375<br />
0.796875<br />
0.6953125<br />
0.59375<br />
0.4921875<br />
0.390625<br />
0.2890625<br />
0.1875<br />
0.0859375<br />
</code><br />
<!--adsense#ad1--><br />
So that is why, you will see a strange number in the source code when comparing the alpha of the element to see if we will ad a new one. Don&#8217;t know exactly why&#8230;this happens&#8230;will let you know if I figure it out. You can also try a simple example:<br />
[code lang="actionscript"]<br />
var i:Number;<br />
var n:Number=1;<br />
for (i=0;i<4;i++)<br />
{<br />
n-=0.1;<br />
trace(n)<br />
}<br />
[/code]<br />
And the result:<br />
<code><br />
1<br />
0.9<br />
0.8<br />
0.7000000000000001<br />
0.6000000000000001<br />
</code><br />
Anyway...here is how the loader should work (I think it has already finished loading whyle you read al this...so refresh the page to see the animation);<br />
[kml_flashembed fversion="9.1.0" movie="http://sf-zone.net/wp-content/uploads/2009/02/tutorial1.swf" targetclass="flashmovie" useexpressinstall="true" publishmethod="static" width="400" height="250"]</p>
<p><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></p>
<p>[/kml_flashembed]<br />
And also, don't forget about the source.<br />
<a href="http://sf-zone.net/wp-content/uploads/2009/02/glowloader.zip"><img class="aligncenter size-full wp-image-213" title="download_fla" src="http://sf-zone.net/wp-content/uploads/2009/02/download_fla.png" alt="download_fla" width="229" height="57" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://sf-zone.net/2009/02/11/moving-stars-loader-as3-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smoke in Flash &#8211; AS3 Tutorial</title>
		<link>http://sf-zone.net/2009/02/10/smoke-in-flash-as3-tutorial/</link>
		<comments>http://sf-zone.net/2009/02/10/smoke-in-flash-as3-tutorial/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 16:26:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash - AS3]]></category>
		<category><![CDATA[AS3 smoke]]></category>
		<category><![CDATA[flash smoke]]></category>
		<category><![CDATA[flash smoke effect]]></category>
		<category><![CDATA[smoke]]></category>
		<category><![CDATA[smoke effect]]></category>
		<category><![CDATA[smoke effect in flash]]></category>

		<guid isPermaLink="false">http://sf-zone.net/?p=217</guid>
		<description><![CDATA[OK! Here is my 2nd small tutorial for this week. Actually don&#8217;t know if this can be called a tutorial, since I don&#8217;t really give step-by-stem instructions on how to mek it, but I do give the code and it is well commented. Below are some examples of the smoke.[kml_flashembed fversion="9.1.0" movie="http://sf-zone.net/wp-content/uploads/2009/02/white_smoke.swf" targetclass="flashmovie" publishmethod="static" width="400" [...]]]></description>
			<content:encoded><![CDATA[<p>OK! Here is my 2nd small tutorial for this week. Actually don&#8217;t know if this can be called a tutorial, since I don&#8217;t really give step-by-stem instructions on how to mek it, but I do give the code and it is well commented. Below are some examples of the smoke.<span id="more-217"></span>[kml_flashembed fversion="9.1.0" movie="http://sf-zone.net/wp-content/uploads/2009/02/white_smoke.swf" targetclass="flashmovie" publishmethod="static" width="400" height="259"]<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><br />
[/kml_flashembed]<br />
Also, it is very easy to change the color of the smoke. Just edit the image in Photoshop and import it back into flash.<br />
<!--adsense#ad1--><br />
Below is an example with a different color.<br />
[kml_flashembed fversion="9.1.0" movie="http://sf-zone.net/wp-content/uploads/2009/02/turquaz_smoke.swf" targetclass="flashmovie" publishmethod="static" width="400" height="250"]</p>
<p><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></p>
<p>[/kml_flashembed]<br />
Remember to get the source file. It includes examples of different colors: white, black, red, turquoise and violet.<a href="http://sf-zone.net/wp-content/uploads/2009/02/smoke_-mouse.zip"><img class="aligncenter size-full wp-image-213" title="download_fla" src="http://sf-zone.net/wp-content/uploads/2009/02/download_fla.png" alt="download_fla" width="229" height="57" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://sf-zone.net/2009/02/10/smoke-in-flash-as3-tutorial/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Glowing Mouse Trail &#8211; AS3 tutorial</title>
		<link>http://sf-zone.net/2009/02/09/glowing-mouse-trail-as3-tutorial/</link>
		<comments>http://sf-zone.net/2009/02/09/glowing-mouse-trail-as3-tutorial/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 20:17:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash - AS3]]></category>
		<category><![CDATA[flash tutorial]]></category>
		<category><![CDATA[Glow trail]]></category>
		<category><![CDATA[mouse trail]]></category>

		<guid isPermaLink="false">http://sf-zone.net/?p=209</guid>
		<description><![CDATA[OK! I decided to make a very quick tutorial for you guis. It is something really easy for me, but I am sure most of you will find it interesting. So&#8230;below is a preview of what it does. Feel free to download the FLA file.[kml_flashembed fversion="9.1.0" movie="http://sf-zone.net/wp-content/uploads/2009/02/tutorial.swf" targetclass="flashmovie" useexpressinstall="true" publishmethod="static" width="400" height="250"] [/kml_flashembed] Also, download [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">OK! I decided to make a very quick tutorial for you guis. It is something really easy for me, but I am sure most of you will find it interesting. So&#8230;below is a preview of what it does. Feel free to download the FLA file.<span id="more-209"></span>[kml_flashembed fversion="9.1.0" movie="http://sf-zone.net/wp-content/uploads/2009/02/tutorial.swf" targetclass="flashmovie" useexpressinstall="true" publishmethod="static" width="400" height="250"]</p>
<p style="text-align: center;"><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></p>
<p style="text-align: center;">[/kml_flashembed]</p>
<p style="text-align: center;">
<p><!--adsense#ad1--><br />
Also, download the FLA from below:</p>
<p style="text-align: center;"><a href="http://sf-zone.net/wp-content/uploads/2009/02/glow_mouse_trail.zip"><img class="aligncenter size-full wp-image-213" title="download_fla" src="http://sf-zone.net/wp-content/uploads/2009/02/download_fla.png" alt="download_fla" width="229" height="57" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://sf-zone.net/2009/02/09/glowing-mouse-trail-as3-tutorial/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
