<?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>FlashFuck.it &#187; Source</title>
	<atom:link href="http://www.flashfuck.it/tag/source/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flashfuck.it</link>
	<description>flash platform, gaming and 3D</description>
	<lastBuildDate>Mon, 23 Jan 2012 18:11:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>FPSMonitor for AS3 and Flex projects</title>
		<link>http://www.flashfuck.it/2008/05/27/fpsmonitor-for-as3-and-flex-projects/</link>
		<comments>http://www.flashfuck.it/2008/05/27/fpsmonitor-for-as3-and-flex-projects/#comments</comments>
		<pubDate>Tue, 27 May 2008 00:59:34 +0000</pubDate>
		<dc:creator>pigiuz</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.flashfuck.it/2008/05/27/fpsmonitor-for-as3-and-flex-projects/</guid>
		<description><![CDATA[UPDATE: http://www.flashfuck.it/fps-monitor/ Here&#8217;s some (usefull i hope ) source.. I&#8217;ve made a little fps monitor for my projects (for both as3 and flex)&#8230; so, here&#8217;s some souce and some howtos about&#8230; There are 2 classes, FPSMonitor is made for as3 (or flash) projects, the other one, FlexFPSMonitor is made expecially for use in Flex. Usage [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE: <a href="http://www.flashfuck.it/fps-monitor/">http://www.flashfuck.it/fps-monitor/</a></strong></p>
<p>Here&#8217;s some (usefull i hope <img src='http://www.flashfuck.it/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) source..</p>
<p style="text-align: center"><img src="http://www.flashfuck.it/wp-content/uploads/2008/05/fpsmonitor.png" alt="fpsmonitor.png" /></p>
<p>I&#8217;ve made a little fps monitor for my projects (for both as3 and flex)&#8230; so, <a href="http://www.flashfuck.it/wp-content/uploads/2008/05/fpsmonitor.zip">here&#8217;s some souce</a> and some <em>howto</em>s about&#8230;</p>
<p>There are 2 classes, FPSMonitor is made for as3 (or flash) projects, the other one, FlexFPSMonitor is made expecially for use in Flex.</p>
<p>Usage AS3:</p>
<pre lang="actionscript">import it.flashfuck.debugger.FPSMonitor;
//[...]
addChild(new FPSMonitor());</pre>
<p>Usage Flex:</p>
<pre lang="actionscript">// new xmlns in application tag
xmlns:debugger="it.flashfuck.debugger.*"
//then add the tag, remember to add it at the end of your app so it's appearing in front of everything</pre>
<p>quite simple hm? <img src='http://www.flashfuck.it/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
The main difference between these classes&#8217; results is dragging. Flex one is draggable over the application stage, the other one is not draggable (just edit the code if you want to bring it away among the screen <img src='http://www.flashfuck.it/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )&#8230;.</p>
<p><strong>Features</strong><br />
FPSMonitor (as the flex one) is monitoring<br />
- OS, Player type, version, and &#8220;is debugger&#8221;<br />
- FPS<br />
- Memory usage (note: this parameter tells you the memory usage by ALL flash player instances you&#8217;re running, so if you&#8217;re running more than 1 player at once this value is altered!&#8230;even in 2 firefox tabs or a standalone and a browser player)</p>
<p><strong>Graph</strong>:<br />
FPSMonitor is displaying in a graph 2 values: FPS (white) and memory usage (black) (same note for this value <img src='http://www.flashfuck.it/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )<br />
Everything is blended with BlendMode.INVERT so you can see the monitor in quite every condition.</p>
<p>I hope you enjoy.<br />
<a title="FPSMonitor" href="http://www.flashfuck.it/wp-content/uploads/2008/05/fpsmonitor.zip">Download here both classes FPSMonitor.as and FlexFPSMonitor.as</a></p>
<p>&#8230;.just a note: feel free to use this code anywhere, if you&#8217;re improving functionalities, adding more features or anything else please just send me a smoke signal or a pidgeon with a message so i can update the source <img src='http://www.flashfuck.it/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashfuck.it/2008/05/27/fpsmonitor-for-as3-and-flex-projects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>360Flex Milan is HERE!</title>
		<link>http://www.flashfuck.it/2008/04/06/360flex-milan-is-here/</link>
		<comments>http://www.flashfuck.it/2008/04/06/360flex-milan-is-here/#comments</comments>
		<pubDate>Sun, 06 Apr 2008 09:42:19 +0000</pubDate>
		<dc:creator>pigiuz</dc:creator>
				<category><![CDATA[Speaking]]></category>
		<category><![CDATA[360 Flex]]></category>
		<category><![CDATA[Papervision 3D]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.flashfuck.it/2008/04/06/360flex-milan-is-here/</guid>
		<description><![CDATA[Domani inizia la prima 360 Conference europea, l&#8217;eccitazione âˆšÂ® alle stelle&#8230;Stasera ci sarâˆšâ€  il ricevimento degli speakers in quel di Milano, finalmente stringerâˆšâ‰¤ la mano a Tom e John&#8230;e da domani YEAH, 3 giornate ricche di sessions!Ricordo che la prima giornata (domani, lunedâˆšÂ¨ 7) âˆšÂ® GRATUITA, mentre la sera ci sarâˆšâ€  un &#8220;evento nell&#8217;evento&#8221; aperto [...]]]></description>
			<content:encoded><![CDATA[<p>Domani inizia la prima 360 Conference europea, l&#8217;eccitazione âˆšÂ® alle stelle&#8230;Stasera ci sarâˆšâ€  il ricevimento degli speakers in quel di Milano, finalmente stringerâˆšâ‰¤ la mano a Tom e John&#8230;e da domani YEAH, 3 giornate ricche di sessions!Ricordo che la prima giornata (domani, lunedâˆšÂ¨ 7) âˆšÂ® GRATUITA, mentre la sera ci sarâˆšâ€  un &#8220;evento nell&#8217;evento&#8221; aperto a tutti organizzato da Actionscript.it in cui si discuteranno i temi caldi della giornata <img src='http://www.flashfuck.it/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Vi lascio con <a href="http://www.flashfuck.it/360/Flag3D/">questo esempio in papervision</a> e vi aspetto alla mia session martedâˆšÂ¨ <img src='http://www.flashfuck.it/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Questo il codice sorgente:</p>
<pre lang="actionscript">
package{
	import flash.display.BlendMode;
	import flash.display.Sprite;
	import flash.events.AsyncErrorEvent;
	import flash.events.Event;
	import flash.events.NetStatusEvent;
	import flash.events.SecurityErrorEvent;
	import flash.geom.ColorTransform;
	import flash.media.Video;
	import flash.net.NetConnection;
	import flash.net.NetStream;
	import org.papervision3d.cameras.Camera3D;
	import org.papervision3d.core.effects.BitmapFireEffect;
	import org.papervision3d.core.effects.utils.BitmapDrawCommand;
	import org.papervision3d.core.geom.renderables.Vertex3D;
	import org.papervision3d.core.layers.BitmapEffectLayer;
	import org.papervision3d.materials.BitmapMaterial;
	import org.papervision3d.materials.VideoStreamMaterial;
	import org.papervision3d.objects.primitives.Plane;
	import org.papervision3d.render.BasicRenderEngine;
	import org.papervision3d.scenes.Scene3D;
	import org.papervision3d.view.Viewport3D;
	[SWF(width="400",height="400",frameRate="24",backgroundColor="0x111111")]
	public class Flag3D extends Sprite	{
		[Embed (source="assets/360.png")] private var FlagAsset:Class;
		private var _scene:Scene3D;
		private var _cam:Camera3D;
		private var _view:Viewport3D;
		private var _render:BasicRenderEngine;
		private var _bfx:BitmapEffectLayer;
		private var _p:Plane;
		private var _bgp:Plane;
		private var _sine:Number=0;
		private var _srcs:Array = [
		//"http://www.youtube.com/get_video?video_id=Qk1qSpM63u4&amp;t=OEgsToPDskIHja8NsMXSksfwHJKkwY2t",
		"http://www.flashfuck.it/360/get_video.flv"
		];
		private var _conn:NetConnection;
		private var _video:Video;
		private var _stream:NetStream;

		public function Flag3D()
		{
			super();
			stage.scaleMode = "noScale";
			stage.align = "TL";
			initVideo();
			init3D();
		}

		private function initVideo():void
		{
			_video = new Video(320,240);
			connection();
			trace("init video")
		}

		private function init3D():void
		{
			trace("init 3d")
			_view = new Viewport3D(0,0,true,true,true,true);
			_view.addEventListener(Event.ADDED_TO_STAGE,onViewPortReady);
			_cam = new Camera3D();
			_cam.focus=100;
			_cam.zoom=11;
			_cam.z=-1000;
			_scene = new Scene3D();
			_render = new BasicRenderEngine();
			addChild(_view);
		}

		private function onViewPortReady(e:Event):void
		{
			addElements();
			setupEffects();
		}

		private function setupEffects():void
		{
			_bfx = new BitmapEffectLayer(_view.width,_view.height);
			_bfx.addEffect( new BitmapFireEffect(1,1,1,1) );
			_bfx.drawCommand = new BitmapDrawCommand(null,new ColorTransform(1,1,1,1),BlendMode.HARDLIGHT,true);
			_bfx.drawLayer.blendMode = BlendMode.OVERLAY;
			_view.addRenderLayer(_bfx);
			_p.material.renderLayer = _bfx;
		}

		private function addElements():void
		{
			trace("add plane");
			_p = createFlag();
			_scene.addChild(_p);
			_bgp = createBG();
			_scene.addChild(_bgp);
			startRendering();
		}

		public function startRendering():void
		{
			this.addEventListener(Event.ENTER_FRAME,render);
		}

		public function stopRendering():void
		{
			this.removeEventListener(Event.ENTER_FRAME,render);
		}

		private function createFlag():Plane
		{
			trace("plane");
			var p:Plane = new Plane(createBitmapMaterial(),200,200,5,5);
			return p;
		}

		private function createBG():Plane
		{
			trace("plane");
			var p:Plane = new Plane(createVideoMaterial(),3200,2400,5,5);
			p.z = 1800;
			return p;
		}

		private function createBitmapMaterial():BitmapMaterial
		{
			var m:BitmapMaterial = new BitmapMaterial(new FlagAsset().bitmapData);
			m.doubleSided=true;
			m.smooth=true;
			return m;
		}

		private function createVideoMaterial():VideoStreamMaterial
		{
			var m:VideoStreamMaterial = new VideoStreamMaterial(_video,_stream);
			m.smooth=true;
			m.doubleSided=true;
			return m;
		}

		private function render(e:Event=null):void
		{
			_cam.hover(1,_view.containerSprite.mouseX/400,_view.containerSprite.mouseY/400);
			_p.yaw(.2);
			_render.renderScene(_scene,_cam,_view);
			_sine++;
			tweenPlaneMesh();
		}

		private function tweenPlaneMesh():void
		{
			var _deltaZ:Number= 30;
			var count:int=0;
			//plane waving:)
			for each(var v:Vertex3D in _p.geometry.vertices){
				var _vz:Number = Math.sin((count+_sine)/10)*_deltaZ;
				v.z = _vz;
				count++;
			}
		}
		private function connection():void
		{
			_conn = new NetConnection();
			_conn.addEventListener(NetStatusEvent.NET_STATUS,netHandler);
			_conn.addEventListener(SecurityErrorEvent.SECURITY_ERROR,crossdomainHandler);
			_conn.connect(null);
		}
		private function netHandler(e:NetStatusEvent):void
		{
			switch(e.info.code){
			case "NetConnection.Connect.Success":
                    startVideo();
                break;
                case "NetStream.Play.StreamNotFound":
                    trace("404!");
           		break;
			}
		}

		private function crossdomainHandler(e:SecurityErrorEvent):void
		{
			trace("security error: "+e);
		}

		private function startVideo():void
		{
			_stream = createStream();
			_video.attachNetStream(_stream);
			_stream.play(_srcs[0]);
		}

		private function createStream():NetStream
		{
			var stream:NetStream = new NetStream(_conn);
			stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR,manageAsync);
			stream.addEventListener(NetStatusEvent.NET_STATUS,netHandler);
			return stream;
		}

		private function manageAsync(e:AsyncErrorEvent):void
		{
			//nada de nada <img src='http://www.flashfuck.it/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />
		}
	}
}</pre>
<p><a href="http://www.flashfuck.it/360/Flag3D/Flag3D.as">Download Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashfuck.it/2008/04/06/360flex-milan-is-here/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gradient Masking &#8211; La sfumatura nelle maschere</title>
		<link>http://www.flashfuck.it/2008/01/06/gradient-masking-la-sfumatura-nelle-maschere/</link>
		<comments>http://www.flashfuck.it/2008/01/06/gradient-masking-la-sfumatura-nelle-maschere/#comments</comments>
		<pubDate>Sun, 06 Jan 2008 00:23:46 +0000</pubDate>
		<dc:creator>pigiuz</dc:creator>
				<category><![CDATA[ActionScript 2]]></category>
		<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.flashfuck.it/2008/01/06/gradient-masking-la-sfumatura-nelle-maschere/</guid>
		<description><![CDATA[Questo âˆšÂ® uno &#8220;microtutorial&#8221; piuttosto semplice sulle maschere (sono 2 linee di codice -.-) che perâˆšâ‰¤ ho notato non essere troppo conosciuto. Come creare un effetto &#8220;pila&#8221; o &#8220;occhio di bue&#8221;? o piâˆšÏ€ banalmente, come creare una maschera sfumata con flash8 o superiori? crea un movieclip da mascherare crea un altro movieclip contenente una forma [...]]]></description>
			<content:encoded><![CDATA[<p>Questo âˆšÂ® uno &#8220;microtutorial&#8221; piuttosto semplice sulle maschere (sono 2 linee di codice -.-) che perâˆšâ‰¤ ho notato non essere troppo conosciuto.</p>
<p>Come creare un effetto &#8220;pila&#8221; o &#8220;occhio di bue&#8221;? o piâˆšÏ€ banalmente, come creare una maschera sfumata con flash8 o superiori?</p>
<ol>
<li>crea un movieclip da mascherare</li>
<li>crea un altro movieclip contenente una forma con riempimento a gradiente nel quale almeno un colore abbia alpha minore di 100</li>
<li>posiziona nello stage (fisicamente o via actionscript) i due clip: il mascherato e la maschera</li>
<li>via actionscript imposta a true la proprietâˆšâ€  &#8220;cacheAsBitmap&#8221; di ciascun movieclip</li>
<li>sempre via actionscript imposta la maschera del movieclip da mascherare (setMask in AS2 o mask in AS3)</li>
</ol>
<p>ecco il risultato:<br />
[flash http://www.flashfuck.it/wp-content/uploads/2008/01/maschere_sfumate1.swf w=400 h=200]</p>
<p>questo il fla dell&#8217;esempio (CS3) <a href='http://www.flashfuck.it/wp-content/uploads/2008/01/maschere_sfumate_flasfuckit.zip' title='maschere_sfumate_flasfuckit.zip'>Download Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashfuck.it/2008/01/06/gradient-masking-la-sfumatura-nelle-maschere/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Papervision su Flex &#8211; effetti 3D sui componenti</title>
		<link>http://www.flashfuck.it/2007/12/08/papervision-su-flex-effetti-3d-sui-componenti/</link>
		<comments>http://www.flashfuck.it/2007/12/08/papervision-su-flex-effetti-3d-sui-componenti/#comments</comments>
		<pubDate>Sat, 08 Dec 2007 01:20:04 +0000</pubDate>
		<dc:creator>pigiuz</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Papervision 3D]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.flashfuck.it/2007/12/08/papervision-su-flex-effetti-3d-sui-componenti/</guid>
		<description><![CDATA[Il buon Tink, fondatore del LFPUG (London Flash Platform User Group) e co-autore di Flash 8 essentials ha reso pubblico il sorgente del suo progetto Papervision. In soldoni grazie al suo lavoro ora âˆšÂ® possibile utilizzare delle transizioni 3D tra i component, gli stati, i viewstack e quant&#8217;altro con un semplice tag&#8230;AWESOME ecco un po&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p>Il buon <a href="http://www.tink.ws/blog/">Tink</a>, fondatore del <a href="http://www.lfpug.com/">LFPUG</a> (London Flash Platform User Group) e co-autore di Flash 8 essentials <a href="http://www.tink.ws/blog/papervision3d-effects-for-flex-source/">ha reso pubblico il sorgente</a> del suo progetto Papervision.</p>
<p>In soldoni grazie al suo lavoro ora âˆšÂ® possibile utilizzare delle transizioni 3D tra i component, gli stati, i viewstack e quant&#8217;altro con un semplice tag&#8230;AWESOME <img src='http://www.flashfuck.it/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>ecco un po&#8217; di esempi&#8230;<br />
<span id="more-45"></span><br />
Zoom<br />
[flash http://www.tink.ws/blog/files/flex/ZoomExample.swf w=400 h=300]</p>
<p>Cube<br />
[flash http://www.tink.ws/blog/files/flex/CubeExample.swf w=400 h=300]</p>
<p>Flip<br />
[flash http://www.tink.ws/blog/files/flex/FlipExample.swf w=400 h=300]</p>
<p>Rotate<br />
[flash http://www.tink.ws/blog/files/flex/RotateExample.swf w=400 h=300]</p>
<p>&#8230;buon divertimento <img src='http://www.flashfuck.it/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashfuck.it/2007/12/08/papervision-su-flex-effetti-3d-sui-componenti/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex 2 Drag&#8217;n&#8217;Drop Howto &#8211; Datagrid Drop Into</title>
		<link>http://www.flashfuck.it/2007/11/22/flex-2-dragndrop-howto-datagrid-drop-into/</link>
		<comments>http://www.flashfuck.it/2007/11/22/flex-2-dragndrop-howto-datagrid-drop-into/#comments</comments>
		<pubDate>Thu, 22 Nov 2007 00:41:44 +0000</pubDate>
		<dc:creator>pigiuz</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.flashfuck.it/2007/11/22/flex-2-dragndrop-howto-datagrid-drop-into/</guid>
		<description><![CDATA[Inauguro con questo tutorial la finora linda categoria Flex Il breve tutorial che andrete a leggere verte su come fare un semplice drag n drop tra 2 list component in modo che gli item dell&#8217;uno fungano come target al drop degli elementi dell&#8217;altro (una possibile applicazione potrebbe essere quella di spostare dei files all&#8217;interno di [...]]]></description>
			<content:encoded><![CDATA[<p>Inauguro con questo tutorial la finora linda categoria Flex <img src='http://www.flashfuck.it/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Il breve tutorial che andrete a leggere verte su come fare un semplice drag n drop tra 2 list component in modo che gli item dell&#8217;uno fungano come target al drop degli elementi dell&#8217;altro (una possibile applicazione potrebbe essere quella di spostare dei files all&#8217;interno di una lista di cartelle).</p>
<p><strong>Il drag n drop standard:</strong></p>
<p>Flex permette di abilitare il drag n drop tra due component direttamente da mxml, senza tanti problemi, abilitando le proprietâˆšâ€  dragEnabled e dropEnabled dei componenti desiderati.</p>
<p>Il risultato che si ottiene abilitando dragEnabled e dropEnabled âˆšÂ® questo:</p>
<p>[flash http://www.flashfuck.it/wp-content/uploads/2007/11/dragdropintoko.swf w=400 h=300]</p>
<p><em>Droppando </em>gli elementi della tilelist all&#8217;interno del datagrid questi verranno clonati ed aggiunti allo stesso datagrid. Le righe del datagrid non sono selezionabili, i nuovi elementi sono aggiunti prima o dopo i record giâˆšâ€  presenti.</p>
<p><span id="more-42"></span><br />
<strong>Il drag n drop into: </strong></p>
<p>Mi ci sono scervellato un pâˆšâ‰¤, ho tirato in ballo varie community, ma alla fine la soluzione era nel langRef di flex (come al solito <img src='http://www.flashfuck.it/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</p>
<p>Prendiamo in considerazione la struttura dell&#8217;applicazione</p>
<p><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;<br />
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"&gt;<br />
&lt;mx:HBox width="100%" height="100%"&gt;<br />
&lt;mx:DataGrid width="50%" height="100%" id="drop_dg"&gt;<br />
&lt;mx:columns&gt;<br />
&lt;mx:DataGridColumn headerText="Directories" dataField="label"/&gt;<br />
&lt;/mx:columns&gt;<br />
&lt;mx:dataProvider&gt;<br />
&lt;mx:ArrayCollection&gt;<br />
&lt;mx:Array&gt;<br />
&lt;mx:Object label='directory 1'/&gt;<br />
&lt;mx:Object label='directory 2'/&gt;<br />
&lt;mx:Object label='directory 3'/&gt;<br />
&lt;mx:Object label='directory 4'/&gt;<br />
&lt;/mx:Array&gt;<br />
&lt;/mx:ArrayCollection&gt;<br />
&lt;/mx:dataProvider&gt;<br />
&lt;/mx:DataGrid&gt;<br />
&lt;mx:TileList width="50%"<br />
height="100%"<br />
labelField="label"<br />
dragEnabled="true"<br />
id="drag_tl"<br />
columnWidth="50"<br />
rowHeight="50"<br />
allowMultipleSelection="true"&gt;<br />
&lt;mx:dataProvider&gt;<br />
&lt;mx:ArrayCollection&gt;<br />
&lt;mx:Array&gt;<br />
&lt;mx:Object label='item 1'/&gt;<br />
&lt;mx:Object label='item 2'/&gt;<br />
&lt;mx:Object label='item 3'/&gt;<br />
&lt;mx:Object label='item 4'/&gt;<br />
&lt;/mx:Array&gt;<br />
&lt;/mx:ArrayCollection&gt;<br />
&lt;/mx:dataProvider&gt;<br />
&lt;/mx:TileList&gt;<br />
&lt;/mx:HBox&gt;<br />
&lt;/mx:Application&gt;</code></p>
<p>E&#8217; piuttosto semplice: una HBox contenente un datagrid (<em>drop_dg</em>) e una tilelist (<em>drag_tl</em>), entrambi con il loro dataprovider, e la tilelist ha abilitato il dragEnabled in modo che i suoi elementi possano essere draggati (il datagrid <strong>non </strong>ha dropEnabled=true).</p>
<p>A questo punto se testiamo l&#8217;applicazione il drag degli elementi non porterâˆšâ€  a nulla in quanto non esistono drop designati.</p>
<p>Iniziamo a scriptare questa struttura, sarâˆšâ€  necessario importare le classi<br />
- mx.core.DragSource<br />
- mx.events.ListEvent<br />
- mx.events.DragEvent<br />
- mx.managers.DragManager<br />
per far funzionare il tutto&#8230;e anche mx.controls.Alert ai fini dell&#8217;esempio portato nel tutorial.</p>
<p>Adesso âˆšÂ® necessario definire alcuni metodi</p>
<pre lang="actionscript">
private var _tempIndex:uint=0;//indice della cartella selezionata

//gestore dragEnter del datagrid
private function onDragEnter(e:DragEvent):void
{
	DragManager.acceptDragDrop(drop_dg);
}
//gestore dragOver del datagrid -> gestisce il "rollover" sugli elementi sotto il drag proxy
private function onDragOver(e:DragEvent):void
{
	drop_dg.selectedIndex = drop_dg.calculateDropIndex(e);
	DragManager.showFeedback(DragManager.MOVE);
}
//gestore del dragDrop del datagrid -> clona gli elementi droppati e li copia nel datagrid
private function onDragDrop(e:DragEvent):void
{
	var ds:DragSource = e.dragSource;
	var items:Array = ds.dataForFormat('items') as Array;
	var txt:String ="";
	for(var i:uint=0;i<items.length;i++){
		if(i>0){txt+=", ";}
		txt+=items[i].label;
	}
	txt+=" dropped into "+drop_dg.selectedItem.label;
	Alert.show(txt,"Dropped!");
	drop_dg.selectedIndex = _tempIndex;
}
//riposiziona il focus del datagrid al precedente indice
private function onDragComplete(e:DragEvent):void
{
	drop_dg.selectedIndex = _tempIndex;
}
//memorizza il focus da mantenere nel datagrid
private function onDgItemClick(e:ListEvent):void
{
	_tempIndex = drop_dg.selectedIndex;
}
</pre>
<p>dopo aver definito questi metodi per la gestione del drag\drop sarâˆšâ€  necessario aggiungerne i gestori al datagrid direttamente dall&#8217;mxml:</p>
<p><code><br />
dragEnter="onDragEnter(event)"<br />
dragOver="onDragOver(event)"<br />
dragComplete="onDragComplete(event)"<br />
dragDrop="onDragDrop(event)"<br />
itemClick="onDgItemClick(event)"<br />
</code></p>
<p>&#8230;e ora testando l&#8217;applicazione il risultato sarâˆšâ€  il seguente</p>
<p>[flash http://www.flashfuck.it/wp-content/uploads/2007/11/dragdropintook.swf w=400 h=300]</p>
<p>Trascinando gli elementi sul datagrid non si avrâˆšâ€  piâˆšÏ€ come riferimento il datagrid ma gli elementi del datagrid, grazie al metodo &#8220;<a href="http://livedocs.adobe.com/flex/201/langref/mx/controls/listClasses/ListBase.html#calculateDropIndex()">calculateDropIndex</a>&#8221; della classe ListBase (di cui DataGrid âˆšÂ® un discendente).</p>
<p>Qui potete scaricare i files del tutorial: <a href="http://www.flashfuck.it/wp-content/uploads/2007/11/flashfuckdragndropinto.zip" title="flashfuckdragndropinto.zip">flashfuckdragndropinto.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashfuck.it/2007/11/22/flex-2-dragndrop-howto-datagrid-drop-into/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eliminare gli SpamBot alla radice dal proprio sito con .htaccess!</title>
		<link>http://www.flashfuck.it/2007/09/29/eliminare-gli-spambot-alla-radice-dal-proprio-sito-con-htaccess/</link>
		<comments>http://www.flashfuck.it/2007/09/29/eliminare-gli-spambot-alla-radice-dal-proprio-sito-con-htaccess/#comments</comments>
		<pubDate>Fri, 28 Sep 2007 22:36:04 +0000</pubDate>
		<dc:creator>pigiuz</dc:creator>
				<category><![CDATA[Anything else]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.flashfuck.it/2007/09/29/eliminare-gli-spambot-alla-radice-dal-proprio-sito-con-htaccess/</guid>
		<description><![CDATA[Cosa sia uno spam bot âˆšÂ® presto detto: sono quegli &#8220;affari&#8221; che gironzolano in rete lasciando spam ovunque, specialmente nei commenti dei blog e nelle community con libera iscrizione. (foto di uno spambot) Esistono una marea di plugin anti spam, askimet su wordpress, tutta una sfilza di mod antispam per i forum di phpBB, e [...]]]></description>
			<content:encoded><![CDATA[<p>Cosa sia uno spam bot âˆšÂ® presto detto: sono quegli &#8220;affari&#8221; che gironzolano in rete lasciando spam ovunque, specialmente nei commenti dei blog e nelle community con libera iscrizione.</p>
<p align="center"><img src='http://www.flashfuck.it/wp-content/uploads/2007/09/spambot.jpg' alt='spambot.jpg' /><br />
(foto di uno spambot)</p>
<p>Esistono una marea di plugin anti spam, askimet su wordpress, tutta una sfilza di mod antispam per i forum di phpBB, e anche molti scriptini confezionati a mano che possono risultare piâˆšÏ€ o meno efficaci.<br />
Ma i metodi piâˆšÏ€ diffusi identificano l&#8217;utente &#8220;spam-bot&#8221; <strong>per esclusione</strong>, chiedendo un&#8217;interazione <strong>in piâˆšÏ€</strong> all&#8217;utente umano.<br />
<span id="more-30"></span></p>
<p>Percaritâˆšâ€ , lungi da me andare contro i metodi antispam di questo tipo (anche qui su <a href="http://www.flashfuck.it">FlashFuck</a> c&#8217;âˆšÂ® un antispam a pieno regime), ma la domanda a questo punto dev&#8217;essere &#8220;perchâˆšÂ® devo chiedere ai miei utenti un qualcosa in piâˆšÏ€ quando potrei negare direttamente l&#8217;accesso agli spam bot?&#8221;.</p>
<p>Per poter fare questo prima bisogna capire come funziona uno spam bot, o quantomeno come si presenta al nostro sito.</p>
<p>Un utente (umano o robot) viene identificato dal nostro server con un <a href="http://it.wikipedia.org/wiki/Indirizzo_IP">ip</a>, un <a href="http://it.wikipedia.org/wiki/Host">host</a>, un <a href="http://it.wikipedia.org/wiki/User_agent">user agent</a>, e altre informazioni.</p>
<p><strong>Prendiamo in considerazione l&#8217;user agent.</strong><br />
Tracciando l&#8217;user agent di un utente umano noteremo che corrisponde alle informazioni del suo browser<br />
es:<code>Mozilla/5.0 (Macintosh; U; PPC Mac OS X; it-it) AppleWebKit/419.3 (KHTML, like Gecko) Safari/419.3</code> (questo âˆšÂ® il mio Safari <img src='http://www.flashfuck.it/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> )<br />
L&#8217;user agent di un robot quindi traccia il programma usato dal bot per raggiungere il sito&#8230;.ossia il robot stesso <img src='http://www.flashfuck.it/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
Per liberarsi di buona parte dei bot basterâˆšâ€  quindi indirizzare tutti i robot indesiderati da un&#8217;altra parte (tipo su microsoft.com <img src='http://www.flashfuck.it/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> ) oppure vietar loro l&#8217;accesso.</p>
<p>Ecco una lista degli spambot piâˆšÏ€ noti da bannare dal sito dal vostro .htaccess:</p>
<pre lang="apache">
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^Alexibot [OR]
RewriteCond %{HTTP_USER_AGENT} ^asterias [OR]
RewriteCond %{HTTP_USER_AGENT} ^BackDoorBot [OR]
RewriteCond %{HTTP_USER_AGENT} ^Black.Hole [OR]
RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR]
RewriteCond %{HTTP_USER_AGENT} ^BlowFish [OR]
RewriteCond %{HTTP_USER_AGENT} ^BotALot [OR]
RewriteCond %{HTTP_USER_AGENT} ^BuiltBotTough [OR]
RewriteCond %{HTTP_USER_AGENT} ^Bullseye [OR]
RewriteCond %{HTTP_USER_AGENT} ^BunnySlippers [OR]
RewriteCond %{HTTP_USER_AGENT} ^Cegbfeieh [OR]
RewriteCond %{HTTP_USER_AGENT} ^CheeseBot [OR]
RewriteCond %{HTTP_USER_AGENT} ^CherryPicker [OR]
RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR]
RewriteCond %{HTTP_USER_AGENT} ^CopyRightCheck [OR]
RewriteCond %{HTTP_USER_AGENT} ^cosmos [OR]
RewriteCond %{HTTP_USER_AGENT} ^Crescent [OR]
RewriteCond %{HTTP_USER_AGENT} ^Custo [OR]
RewriteCond %{HTTP_USER_AGENT} ^DISCo [OR]
RewriteCond %{HTTP_USER_AGENT} ^DittoSpyder [OR]
RewriteCond %{HTTP_USER_AGENT} ^Download\ Demon [OR]
RewriteCond %{HTTP_USER_AGENT} ^eCatch [OR]
RewriteCond %{HTTP_USER_AGENT} ^EirGrabber [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailCollector [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [OR]
RewriteCond %{HTTP_USER_AGENT} ^EroCrawler [OR]
RewriteCond %{HTTP_USER_AGENT} ^Express\ WebPictures [OR]
RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro [OR]
RewriteCond %{HTTP_USER_AGENT} ^EyeNetIE [OR]
RewriteCond %{HTTP_USER_AGENT} ^FlashGet [OR]
RewriteCond %{HTTP_USER_AGENT} ^Foobot [OR]
RewriteCond %{HTTP_USER_AGENT} ^FrontPage [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^GetRight [OR]
RewriteCond %{HTTP_USER_AGENT} ^GetWeb! [OR]
RewriteCond %{HTTP_USER_AGENT} ^Go-Ahead-Got-It [OR]
RewriteCond %{HTTP_USER_AGENT} ^Go!Zilla [OR]
RewriteCond %{HTTP_USER_AGENT} ^GrabNet [OR]
RewriteCond %{HTTP_USER_AGENT} ^Grafula [OR]
RewriteCond %{HTTP_USER_AGENT} ^Harvest [OR]
RewriteCond %{HTTP_USER_AGENT} ^hloader [OR]
RewriteCond %{HTTP_USER_AGENT} ^HMView [OR]
RewriteCond %{HTTP_USER_AGENT} ^httplib [OR]
RewriteCond %{HTTP_USER_AGENT} ^HTTrack [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^humanlinks [OR]
RewriteCond %{HTTP_USER_AGENT} ^Image\ Stripper [OR]
RewriteCond %{HTTP_USER_AGENT} ^Image\ Sucker [OR]
RewriteCond %{HTTP_USER_AGENT} ^Indy\ Library [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^InfoNaviRobot [OR]
RewriteCond %{HTTP_USER_AGENT} ^InterGET [OR]
RewriteCond %{HTTP_USER_AGENT} ^Internet\ Ninja [OR]
RewriteCond %{HTTP_USER_AGENT} ^JennyBot [OR]
RewriteCond %{HTTP_USER_AGENT} ^JetCar [OR]
RewriteCond %{HTTP_USER_AGENT} ^JOC\ Web\ Spider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Kenjin.Spider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Keyword.Density [OR]
RewriteCond %{HTTP_USER_AGENT} ^larbin [OR]
RewriteCond %{HTTP_USER_AGENT} ^LeechFTP [OR]
RewriteCond %{HTTP_USER_AGENT} ^LexiBot [OR]
RewriteCond %{HTTP_USER_AGENT} ^libWeb/clsHTTP [OR]
RewriteCond %{HTTP_USER_AGENT} ^LinkextractorPro [OR]
RewriteCond %{HTTP_USER_AGENT} ^LinkScan/8.1a.Unix [OR]
RewriteCond %{HTTP_USER_AGENT} ^LinkWalker [OR]
RewriteCond %{HTTP_USER_AGENT} ^lwp-trivial [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mass\ Downloader [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mata.Hari [OR]
RewriteCond %{HTTP_USER_AGENT} ^MIDown\ tool [OR]
RewriteCond %{HTTP_USER_AGENT} ^MIIxpc [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mister.PiX [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mister\ PiX [OR]
RewriteCond %{HTTP_USER_AGENT} ^moget [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/2 [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/3.Mozilla/2.01 [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla.*NEWT [OR]
RewriteCond %{HTTP_USER_AGENT} ^Navroad [OR]
RewriteCond %{HTTP_USER_AGENT} ^NearSite [OR]
RewriteCond %{HTTP_USER_AGENT} ^NetAnts [OR]
RewriteCond %{HTTP_USER_AGENT} ^NetMechanic [OR]
RewriteCond %{HTTP_USER_AGENT} ^NetSpider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Net\ Vampire [OR]
RewriteCond %{HTTP_USER_AGENT} ^NetZIP [OR]
RewriteCond %{HTTP_USER_AGENT} ^NICErsPRO [OR]
RewriteCond %{HTTP_USER_AGENT} ^NPBot [OR]
RewriteCond %{HTTP_USER_AGENT} ^Octopus [OR]
RewriteCond %{HTTP_USER_AGENT} ^Offline.Explorer [OR]
RewriteCond %{HTTP_USER_AGENT} ^Offline\ Explorer [OR]
RewriteCond %{HTTP_USER_AGENT} ^Offline\ Navigator [OR]
RewriteCond %{HTTP_USER_AGENT} ^Openfind [OR]
RewriteCond %{HTTP_USER_AGENT} ^PageGrabber [OR]
RewriteCond %{HTTP_USER_AGENT} ^Papa\ Foto [OR]
RewriteCond %{HTTP_USER_AGENT} ^pavuk [OR]
RewriteCond %{HTTP_USER_AGENT} ^pcBrowser [OR]
RewriteCond %{HTTP_USER_AGENT} ^ProPowerBot/2.14 [OR]
RewriteCond %{HTTP_USER_AGENT} ^ProWebWalker [OR]
RewriteCond %{HTTP_USER_AGENT} ^ProWebWalker [OR]
RewriteCond %{HTTP_USER_AGENT} ^QueryN.Metasearch [OR]
RewriteCond %{HTTP_USER_AGENT} ^ReGet [OR]
RewriteCond %{HTTP_USER_AGENT} ^RepoMonkey [OR]
RewriteCond %{HTTP_USER_AGENT} ^RMA [OR]
RewriteCond %{HTTP_USER_AGENT} ^SiteSnagger [OR]
RewriteCond %{HTTP_USER_AGENT} ^SlySearch [OR]
RewriteCond %{HTTP_USER_AGENT} ^SmartDownload [OR]
RewriteCond %{HTTP_USER_AGENT} ^SpankBot [OR]
RewriteCond %{HTTP_USER_AGENT} ^spanner [OR]
RewriteCond %{HTTP_USER_AGENT} ^SuperBot [OR]
RewriteCond %{HTTP_USER_AGENT} ^SuperHTTP [OR]
RewriteCond %{HTTP_USER_AGENT} ^Surfbot [OR]
RewriteCond %{HTTP_USER_AGENT} ^suzuran [OR]
RewriteCond %{HTTP_USER_AGENT} ^Szukacz/1.4 [OR]
RewriteCond %{HTTP_USER_AGENT} ^tAkeOut [OR]
RewriteCond %{HTTP_USER_AGENT} ^Teleport [OR]
RewriteCond %{HTTP_USER_AGENT} ^Teleport\ Pro [OR]
RewriteCond %{HTTP_USER_AGENT} ^Telesoft [OR]
RewriteCond %{HTTP_USER_AGENT} ^The.Intraformant [OR]
RewriteCond %{HTTP_USER_AGENT} ^TheNomad [OR]
RewriteCond %{HTTP_USER_AGENT} ^TightTwatBot [OR]
RewriteCond %{HTTP_USER_AGENT} ^Titan [OR]
RewriteCond %{HTTP_USER_AGENT} ^toCrawl/UrlDispatcher [OR]
RewriteCond %{HTTP_USER_AGENT} ^toCrawl/UrlDispatcher [OR]
RewriteCond %{HTTP_USER_AGENT} ^True_Robot [OR]
RewriteCond %{HTTP_USER_AGENT} ^turingos [OR]
RewriteCond %{HTTP_USER_AGENT} ^TurnitinBot/1.5 [OR]
RewriteCond %{HTTP_USER_AGENT} ^URLy.Warning [OR]
RewriteCond %{HTTP_USER_AGENT} ^VCI [OR]
RewriteCond %{HTTP_USER_AGENT} ^VoidEYE [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebAuto [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebBandit [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebCopier [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebEMailExtrac.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebEnhancer [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebFetch [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebGo\ IS [OR]
RewriteCond %{HTTP_USER_AGENT} ^Web.Image.Collector [OR]
RewriteCond %{HTTP_USER_AGENT} ^Web\ Image\ Collector [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebLeacher [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebmasterWorldForumBot [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebReaper [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebSauger [OR]
RewriteCond %{HTTP_USER_AGENT} ^Website\ eXtractor [OR]
RewriteCond %{HTTP_USER_AGENT} ^Website.Quester [OR]
RewriteCond %{HTTP_USER_AGENT} ^Website\ Quester [OR]
RewriteCond %{HTTP_USER_AGENT} ^Webster.Pro [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebStripper [OR]
RewriteCond %{HTTP_USER_AGENT} ^Web\ Sucker [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebWhacker [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebZip [OR]
RewriteCond %{HTTP_USER_AGENT} ^Wget [OR]
RewriteCond %{HTTP_USER_AGENT} ^Widow [OR]
RewriteCond %{HTTP_USER_AGENT} ^[Ww]eb[Bb]andit [OR]
RewriteCond %{HTTP_USER_AGENT} ^WWW-Collector-E [OR]
RewriteCond %{HTTP_USER_AGENT} ^WWWOFFLE [OR]
RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Xenu's [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus
RewriteRule ^(.*)$ http://www.sitodidestinazione.com/
</pre>
<p>Il sito di destinazione puo&#8217; essere cambiato con quello che volete, anche con un divieto d&#8217;accesso sostituendo l&#8217;ultima riga di codice con:<br />
<code>RewriteRule ^.* - [F]</code><br />
ma l&#8217;user agent non âˆšÂ® la sola discriminante da tenere in considerazione</p>
<p><strong>Prendiamo in considerazione l&#8217;ip.</strong><br />
L&#8217;ip di un utente umano âˆšÂ® verosimilmente l&#8217;ip della macchina con cui sta navigando, oppure un ip mascherato da qualche proxy. Uno spambot invece si presenta verosimilmente con l&#8217;ip di qualche proxy per mascherarsi al suo passaggio&#8230;<br />
Quindi nelle regole di accesso al sito si dovrâˆšâ€  aggiungere tutti i proxy potenzialmente dannosi.<br />
Dal sito <a href="http://www.proxy.org">proxy.org</a> si puâˆšâ‰¤ recuperare una lista nera dei proxy <a href="http://tor.eff.org/index.html.it">tor</a> potenzialmente dannosi e aggiungerla al proprio .htaccess.<br />
<a href="http://proxy.org/tor_blacklist.txt">Ecco il link</a> al file contenente delle aggiunte per bannare <em>anche</em> gli &#8220;utenti&#8221; provenienti dai proxy <em>cattivi</em>.</p>
<p>Ecco, adesso non dico che si possa dormire tra due guanciali, ma almeno non si sarâˆšâ€  un bersaglio ghiotto per gli spambot&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashfuck.it/2007/09/29/eliminare-gli-spambot-alla-radice-dal-proprio-sito-con-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3 Data Structures For Game Developers</title>
		<link>http://www.flashfuck.it/2007/09/19/as3-data-structures-for-game-developers/</link>
		<comments>http://www.flashfuck.it/2007/09/19/as3-data-structures-for-game-developers/#comments</comments>
		<pubDate>Wed, 19 Sep 2007 08:33:11 +0000</pubDate>
		<dc:creator>pigiuz</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.flashfuck.it/2007/09/19/as3-data-structures-for-game-developers/</guid>
		<description><![CDATA[Dalla Germania con furore arriva un package indispensabile per chi vuole cimentarsi con qualcosa di piâˆšÏ€ di una semplice image gallery. Michael Baczynski, ha pubblicato sul suo blog il suo &#8220;Data Structures&#8220;. ma vediamo di cosa si tratta&#8230; &#8220;AS3 Data Structures For Game Developers&#8221; is a package containing common data structures useful for flash game [...]]]></description>
			<content:encoded><![CDATA[<p>Dalla Germania con furore arriva un package indispensabile per chi vuole cimentarsi con qualcosa di piâˆšÏ€ di una semplice image gallery.<br />
Michael Baczynski, ha pubblicato sul suo blog il suo &#8220;<a href="http://lab.polygonal.de/ds/">Data Structures</a>&#8220;.</p>
<p align="center"><img src="http://lab.polygonal.de/wp-content/uploads/ds_logo.gif" alt="AS3 Data Structures" /></p>
<p>ma vediamo di cosa si tratta&#8230;<br />
<span id="more-27"></span><br />
<em>&#8220;AS3 Data Structures For Game Developers&#8221; is a package containing common data structures useful for flash game programming and application development</em>, mai descrizione fu piâˆšÏ€ sintetica e completa.</p>
<p>Il package contiene infatti diverse strutture di dati utili alla rappresentazione delle diverse situazioni riscontrabili sia nella programmazione di videogames che in quella delle applicazioni (anche nelle piâˆšÏ€ semplici).</p>
<p>Le strutture di dati di questo package suppliscono alla &#8220;semplicitâˆšâ€ &#8221; dei tipi di <a href="http://www.flashfuck.it/category/flash/as/as3/">AS3</a>, vengono implementate infatti strutture largamente diffuse e utilizzate dai piâˆšÏ€ come</p>
<ul>
<li>array multidimensionali (2 e 3 dimensioni)</li>
<li>alberi e alberi binari</li>
<li>liste concatenate</li>
<li>code di prioritâˆšâ€ </li>
<li>grafici (graph)</li>
</ul>
<p>La documentazione del package âˆšÂ® ottima (http://www.polygonal.de/ds/api/) e non ci sono lacune di sorta o concetti lasciati all&#8217;interpretazione.</p>
<p>L&#8217;utilizzo di queste strutture di dati, o meglio, l&#8217;approccio a questo &#8220;nuovo&#8221; (che poi nuovo non âˆšÂ®, questo âˆšÂ® solo un porting in AS3 delle strutture piâˆšÏ€ utilizzate nella logica di programmazione) modo di archiviare i dati puâˆšâ‰¤ intimorire un newbie che sta solo cercando di fare la sua image gallery, ma una volta sperimentato questo package sarâˆšâ€  la base da cui partire, quindi<br />
<code><br />
import flash.display.Sprite;<br />
import de.polygonal.ds.*;<br />
</code><br />
e buon coding! <img src='http://www.flashfuck.it/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashfuck.it/2007/09/19/as3-data-structures-for-game-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adattare un swf alle dimensioni del browser con actionscript, oggetto stage, e CSS</title>
		<link>http://www.flashfuck.it/2007/08/20/adattare-un-swf-alle-dimensioni-del-browser-con-actionscript-oggetto-stage-e-css/</link>
		<comments>http://www.flashfuck.it/2007/08/20/adattare-un-swf-alle-dimensioni-del-browser-con-actionscript-oggetto-stage-e-css/#comments</comments>
		<pubDate>Mon, 20 Aug 2007 19:42:08 +0000</pubDate>
		<dc:creator>pigiuz</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[ActionScript 2]]></category>
		<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.flashfuck.it/2007/08/20/adattare-un-swf-alle-dimensioni-del-browser-con-actionscript-oggetto-stage-e-css/</guid>
		<description><![CDATA[Molti siti propongono swf a tutto schermo conseguendo l&#8217;obbiettivo in vari modi piâˆšÏ€ o meno compatibili con le specifiche W3c. Se la domanda che vi assilla âˆšÂ®: &#8220;Come si fa ad adattare un swf alle dimensioni della finestra del browser in modo che il risultato sia compatibile con i maggiori browser?&#8221; continuate pure a leggere [...]]]></description>
			<content:encoded><![CDATA[<p>Molti siti propongono swf a tutto schermo conseguendo l&#8217;obbiettivo in vari modi piâˆšÏ€ o meno compatibili con le specifiche W3c.</p>
<p>Se la domanda che vi assilla âˆšÂ®:<br />
<em>&#8220;Come si fa ad adattare un swf alle dimensioni della finestra del browser in modo che il risultato sia compatibile con i maggiori  browser?&#8221;</em> continuate pure a leggere <img src='http://www.flashfuck.it/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><span id="more-22"></span></p>
<p><strong>Partiamo dalle basi:</strong></p>
<p><em><strong>Dentro Flash:</strong> </em></p>
<p>Il flash player fornisce ad Actionscript una serie di API destinate all&#8217;interazione con lo stage del nostro swf fin dai tempi di flash mx.<br />
Utilizzare questi appigli per determinare le dimensioni del nostro swf in esecuzione âˆšÂ® piuttosto semplice e richiede davvero poche righe di codice:</p>
<p><strong>Actionscript 2</strong>:</p>
<pre lang="actionscript">
Stage.scaleMode = "noScale";
Stage.align = "TL";
var myListener:Object = new Object();
myListener.onResize = onScreenResize;
Stage.addListener(myListener);

function onScreenResize():Void
{
	trace(Stage.width);
	trace(Stage.height);
}</pre>
<p><strong>Actionscript 3:</strong></p>
<pre lang="actionscript">
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.*;

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
//assegno la funzione al gestore evento
stage.addEventListener(Event.RESIZE,onScreenResize);
//funzione per gestire il resize
//(e=null di default per evitare errori a runtime)
function onScreenResize(e:Event=null):void
{
	trace(stage.stageWidth);
	trace(stage.stageHeight);
}</pre>
<p>La logica come potete vedere âˆšÂ® la medesima:</p>
<ul>
<li>si blocca il ridimensionamento automatico dello stage (ossia lo &#8220;zoom&#8221; indesiderato)</li>
<li>si allinea lo stage in una delle 9 posizioni possibili (da top-left a bottom-right)</li>
<li>si va a gestire l&#8217;evento onResize dell&#8217;oggetto Stage in una funzione che esegue del codice a nostro uso e consumo</li>
</ul>
<p>Cambia un pochino la sintassi, ma âˆšÂ® solo questione di abitudine <img src='http://www.flashfuck.it/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
<em><strong>Nel codice HTML e nel foglio di stile CSS: </strong></em></p>
<p>ora possiamo passare alla parte xhtml e css, ossia quella parte che <strong>effettivamente </strong>va a gestire le dimensioni del player all&#8217;interno del browser.</p>
<p>Gli elementi della ricetta sono i seguenti:</p>
<ul>
<li>un div</li>
<li>le direttive di stile per gli elementi del DOM &#8220;html&#8221;, &#8220;body&#8221; e &#8220;#nomediv&#8221;</li>
<li><a href="http://blog.deconcept.com/swfobject/">SWFObject</a> a piacere per scrivere il nostro swf in #nomediv</li>
</ul>
<p>Il nostro CSS apparirâˆšâ€  simile a questo:</p>
<pre lang="css">
html {
	height: 100%;
	overflow: hidden;
}
#flashdiv {
	height: 100%;
}
body {
	height: 100%;
	margin: 0;
	padding: 0;
	background-color: #FFFFFF;
}</pre>
<p><strong>Conclusione e Sorgenti</strong></p>
<p>Questo âˆšÂ® solo uno dei vari modi in cui si puâˆšâ‰¤ ottenere un swf grande quanto la finestra del browser e compatibile con la maggior parte dei browser in circolazione.</p>
<p>Ad ogni modo, <a href="http://www.flashfuck.it/wp-content/uploads/2007/08/fitscreen.zip" title="FitScreen AS + CSS">nel file zip</a> ci sono i vari casi elencati in questo mini &#8220;tutorial&#8221;,</p>
<p>stay tuned <img src='http://www.flashfuck.it/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashfuck.it/2007/08/20/adattare-un-swf-alle-dimensioni-del-browser-con-actionscript-oggetto-stage-e-css/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AS2 Multi Mask &#8211; come assegnare la stessa maschera a piâˆšÏ€ movieclip</title>
		<link>http://www.flashfuck.it/2007/08/09/as2-multi-mask-come-assegnare-la-stessa-maschera-a-piu-movieclip/</link>
		<comments>http://www.flashfuck.it/2007/08/09/as2-multi-mask-come-assegnare-la-stessa-maschera-a-piu-movieclip/#comments</comments>
		<pubDate>Thu, 09 Aug 2007 10:50:36 +0000</pubDate>
		<dc:creator>pigiuz</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[ActionScript 2]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.flashfuck.it/2007/08/09/as2-multi-mask-come-assegnare-la-stessa-maschera-a-piu-movieclip/</guid>
		<description><![CDATA[La domanda da porsi âˆšÂ®: e se volessi mascherare piâˆšÏ€ di un movieclip con la stessa maschera partendo da un mc giâˆšâ€  mascherato? La risposta âˆšÂ®: esiste un hack a riguardo fin dai tempi di flash mx. Funziona cosâˆšÂ¨: si maschera un movieclip direttamente da timeline, gli si assegna un nome istanza (ad esempio &#8220;myClip&#8221;). [...]]]></description>
			<content:encoded><![CDATA[<p>La domanda da porsi âˆšÂ®:<br />
<em>e se volessi mascherare piâˆšÏ€ di un movieclip con la stessa maschera partendo da un mc giâˆšâ€  mascherato</em>?</p>
<p>La risposta âˆšÂ®:<br />
esiste un hack a riguardo fin dai tempi di flash mx.</p>
<p>Funziona cosâˆšÂ¨:<br />
si maschera un movieclip direttamente da timeline, gli si assegna un nome istanza (ad esempio &#8220;myClip&#8221;).<br />
Una volta mascherato si puâˆšâ‰¤ procedere con la parte di script.</p>
<pre lang="actionscript">
myClip.attachMovie("movieclipinlibreria","nome",myClip.getDepth()-1);
</pre>
<p>cosâˆšÂ¨ facendo il nuovo clip inserito nello stage sarâˆšâ€  mascherato esattamente come myClip.<br />
<span id="more-20"></span></p>
<p>Quanto vale per  attachMovie vale anche per createEmptyMovieClip, basterâˆšâ€  mantenere il livello &#8220;myClip.getDepth()-1&#8243; per rientrare nel caso.</p>
<p>Ma, <em>se volessi mascherare direttamente il mio clip via actionscript senza doverlo mascherare da timeline</em>?<br />
<a href="http://newweb.tread.net/download/prog_01/wav/animal/donkey.wav">Qui casca l&#8217;asino</a>.<br />
Con questo &#8220;hack&#8221; non si elude il metodo setmask della classe MovieClip, âˆšÂ® solo un modo per raggirarlo facendo leva sui livelli.<br />
Un modo per ovviare al problema perâˆšâ‰¤ esiste.<br />
Nessuno ha detto che myClip debba essere visibile o non vuoto.<br />
Creando in libreria un movieclip &#8220;mc_mascherato&#8221; nel quale posiziono una maschera e un &#8220;myClip&#8221; vuoto si potrebbe replicare la situazione all&#8217;infinito utilizzando come timeline di riferimento proprio quella di mc_mascherato anzichâˆšÂ® quella principale.<br />
Le applicazioni di questo &#8220;hack&#8221; per il multi masking sono davvero tante, dalla image gallery all&#8217;intro animata, ad una semplice transizione.</p>
<p>Quasi dimenticavo, qui potete scaricarvi un esempio base.<a href='http://www.flashfuck.it/wp-content/uploads/2007/08/multimask.zip' title='AS2 Flash multi mask'>qui potete scaricarvi un esempio base</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashfuck.it/2007/08/09/as2-multi-mask-come-assegnare-la-stessa-maschera-a-piu-movieclip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://newweb.tread.net/download/prog_01/wav/animal/donkey.wav" length="21478" type="audio/wav" />
		</item>
		<item>
		<title>Gestire onReleaseOutside con Actionscript 3</title>
		<link>http://www.flashfuck.it/2007/07/17/gestire-onreleaseoutside-con-actionscript-3/</link>
		<comments>http://www.flashfuck.it/2007/07/17/gestire-onreleaseoutside-con-actionscript-3/#comments</comments>
		<pubDate>Tue, 17 Jul 2007 17:44:48 +0000</pubDate>
		<dc:creator>pigiuz</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.flashfuck.it/2007/07/17/gestire-onreleaseoutside-con-actionscript-3/</guid>
		<description><![CDATA[Fino ad actionscript 2 pulsanti e movieclip gestivano anche l&#8217;evento onReleaseOutside. Con l&#8217;avvento di flash 9 (pardon, cs3), il release outside âˆšÂ® stato depennato, non si sa bene per quale motivo, perâˆšâ‰¤, per la disperazione di grandi e piccini, quell&#8217;evento non c&#8217;âˆšÂ® piâˆšÏ€. Gestire l&#8217;onReleaseOutside in actionscript 3 âˆšÂ® perâˆšâ‰¤ piâˆšÏ€ facile di quanto si [...]]]></description>
			<content:encoded><![CDATA[<p>Fino ad actionscript 2 pulsanti e movieclip gestivano anche l&#8217;evento onReleaseOutside. Con l&#8217;avvento di flash 9 (pardon, cs3), il release outside âˆšÂ® stato depennato, non si sa bene per quale motivo, perâˆšâ‰¤, per la disperazione di grandi e piccini, quell&#8217;evento non c&#8217;âˆšÂ® piâˆšÏ€.</p>
<p>Gestire l&#8217;onReleaseOutside in actionscript 3 âˆšÂ® perâˆšâ‰¤ piâˆšÏ€ facile di quanto si possa credere.<br />
Scaricatevi questo file &gt;&gt; <a href="http://www.flashfuck.it/wp-content/uploads/2007/07/as3onreleaseoutside-flashfuckit.zip" title="onReleaseOutside actionscript 3">onReleaseOutside actionscript 3<span id="more-13"></span></a></p>
<p>Dentro ci troverete due classi:<br />
la classe <em>interessante</em> âˆšÂ® &#8220;Button.as&#8221;.</p>
<p>La classe Button estende la classe nativa di actionscript 3 &#8220;SimpleButton&#8221; e aggiunge semplicemente il gestore dell&#8217;evento release outside.</p>
<p>Con as3 âˆšÂ® possibile rilevare l&#8217; onRelease e l&#8217; onRollOut di un SimpleButton tramite i gestori di evento della classe MouseEvent.<br />
Ma come âˆšÂ® possibile combinare questi due eventi per gestire l&#8217; onReleaseOutside?<br />
La logica âˆšÂ® la seguente:</p>
<ol>
<li>all&#8217; onRollOut del mouse sul pulsante controlla se il mouse âˆšÂ® ancora premuto</li>
<li>se il mouse âˆšÂ® ancora premuto aggiungi un event listener sul release del mouse rispetto allo stage</li>
</ol>
<p>Niente di complesso&#8230; diamo un&#8217;occhiata al codice:</p>
<pre line="1" lang="actionscript">
//gestore del press

internal function onPress(e:MouseEvent):void

{

 trace("press");

}//gestore del release

internal function onRelease(e:MouseEvent):void

{

 trace("release");

}

//gestore del FAMIGERATO release outside

internal function onReleaseOutside(e:MouseEvent):void

{

 trace("release outside");

}

//gestore del rollout

internal function onRollOut(e:MouseEvent):void

{

 trace("rollout");

 if(e.buttonDown){

//QUI AGGIUNGO L'EVENTO PER GESTIRE IL RELEASE OUTSIDE

 	e.target.stage.addEventListener(MouseEvent.MOUSE_UP, onReleaseOutside);

 }

}

//gestore del rollover

internal function onRollOver(e:MouseEvent):void

{

 trace("rollover");

//al rollover del mouse sul pulsante elimino il releaseoutside

 e.target.stage.removeEventListener(MouseEvent.MOUSE_UP, onReleaseOutside);

}</pre>
<p>Nel file zip allegato trovate il resto della classe Button e una classe flashfuckit (bel nome eh? <img src='http://www.flashfuck.it/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> ) per visualizzare l&#8217;esempio.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashfuck.it/2007/07/17/gestire-onreleaseoutside-con-actionscript-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

