<?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>JaLeRu Blog &#187; Nieve</title>
	<atom:link href="http://jestudio.cl/blog/tag/nieve/feed/" rel="self" type="application/rss+xml" />
	<link>http://jestudio.cl/blog</link>
	<description></description>
	<lastBuildDate>Mon, 17 Jan 2011 22:16:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Efecto de Nieve en As3</title>
		<link>http://jestudio.cl/blog/efecto-de-nieve-en-as3/</link>
		<comments>http://jestudio.cl/blog/efecto-de-nieve-en-as3/#comments</comments>
		<pubDate>Sun, 20 Apr 2008 17:50:06 +0000</pubDate>
		<dc:creator>JaLeRu</dc:creator>
				<category><![CDATA[Computación]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[As3]]></category>
		<category><![CDATA[Efecto]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Nieve]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://jestudio.cl/blog/?p=24</guid>
		<description><![CDATA[En este Tip muestro como hacer el clásico efecto de nevada en ActionScript 3. Este tip, es más una traducción de un tutorial que yo vi hace tiempo. // Tamaños pantalla var width2 = stage.stageWidth; var height2 = stage.stageHeight; // Máximo tamaño copos y cantidad var max_tamaño = 10; var copos = 100; function init [...]]]></description>
			<content:encoded><![CDATA[<p>En este <a href="http://jestudio.cl/blog/category/tips/" target="_blank">Tip</a> muestro como hacer el clásico efecto de nevada en ActionScript 3.  Este tip, es más una traducción de un tutorial que yo vi hace tiempo.</p>
<pre>// Tamaños pantalla
var width2 = stage.stageWidth;
var height2 =  stage.stageHeight;
// Máximo tamaño copos y cantidad
var max_tamaño = 10;
var copos = 100;
function init ()  {
for (var i:Number=0; i&lt;copos; i++) {

var t:snow=new snow();
addChild(t);
t.alpha = 0.2+Math.random()*0.6;
t.x = -(width2/2)+Math.random()*(1.5*width2);
t.y = -(height2/2)+Math.random()*(1.5*height2);
t.scaleX = t.scaleY=0.5+Math.random()*(max_tamaño*0.1);
t.k = 1+Math.random()*2;
t.viento = -1.5+Math.random()*(1.4*3);
t.addEventListener(Event.ENTER_FRAME, mover);
}
};
function mover(e:*){
e.target.y  += e.target.k;
e.target.x += e.target.viento;
if (e.target.y&gt;height2+10) {

e.target.y = -20;

}

if (e.target.x&gt;width2+20)  {

e.target.x = -(width2/2)+Math.random()*(1.5*width2);
e.target.y = -20;

}
else  if (e.target.x&lt;-20)  {

e.target.x = -(width2/2)+Math.random()*(1.5*width2);
e.target.y = -20;
}
}
init();</pre>
<p>Ok,  para que esto funcione solamente creen un mc, que sea un punto blanco  difuminado (Blur) o un circulo que tenga un degradado radial de blanco  al centro y transparente al rededor.</p>
<p>Para que represente un copo de nieve.</p>
<p>Luego en la Biblioteca, le das clic derecho seleccionas Linkage y en Class, escribe snow.</p>
<p>Simple, pero bonito.</p>
<p>Recomiendo ocupar fondo oscuro.</p>
<div><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="300" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="quality" value="high" /><param name="src" value="http://www.cristalab.com/images/tips/actionscript_3/nevando/Nevando.swf" /><embed type="application/x-shockwave-flash" width="300" height="300" src="http://www.cristalab.com/images/tips/actionscript_3/nevando/Nevando.swf" quality="high"></embed></object></div>
<p>Para el ejemplo, el tamaño máximo de los copos es 5 y la cantidad máxima de copos es 150.</p>
<p>:!!:</p>
]]></content:encoded>
			<wfw:commentRss>http://jestudio.cl/blog/efecto-de-nieve-en-as3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

