<?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>Undolog.com &#187; Flash CS3</title>
	<atom:link href="http://www.undolog.com/category/sviluppo/flash-cs3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.undolog.com</link>
	<description>Research &#38; Development  Blog</description>
	<lastBuildDate>Wed, 17 Mar 2010 14:52:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adobe Flash CS4: creare un Ajax Loader o Activity Indicator</title>
		<link>http://www.undolog.com/2009/11/04/adobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator/</link>
		<comments>http://www.undolog.com/2009/11/04/adobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 14:19:44 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Flash CS4]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Activity Indicator]]></category>
		<category><![CDATA[Adobe Flash CS4]]></category>
		<category><![CDATA[Ajax Loader]]></category>
		<category><![CDATA[PNG]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=2595</guid>
		<description><![CDATA[Creare un Ajax Loader (o Activity indicator per chi è ormai abituato ad usare l'Apple iPhone) per il Web non è una cosa difficile: esistono servizi che generano immagini gif animate di tutti i tipi. Tuttavia il formato GIF ha il grosso difetto di non supportare le trasparenze come si deve. La trasparenza, nel formato [...]]]></description>
			<content:encoded><![CDATA[<p>Creare un <strong>Ajax Loader</strong> (o <strong>Activity indicator</strong> per chi è ormai abituato ad usare l'Apple iPhone) per il Web non è una cosa difficile: esistono <a href="http://www.ajaxload.info/" target="_blank">servizi che generano immagini gif animate</a> di tutti i tipi. Tuttavia il formato GIF ha il grosso difetto di non supportare le trasparenze come si deve. La trasparenza, nel formato GIF attuale, coinvolge un solo piano di bit con la conseguenza che se non abbiamo un colore di sfondo uniforme, i bordi dell'immagine risultano notevolmente sgranati e frammentati.<br />
L'animazione mostrata qui sotto è stata realizzata impostando come colore di trasparenza il bianco.</p>
<p class="center"><img title="ajax-loader" src="/wp-content/uploads/2009/11/ajax-loader.gif" alt="ajax-loader" width="16" height="16" /></p>
<p>Quindi se lo sfondo è bianco (o un colore simile) non ci sono problemi. Al contrario, appena sostituiamo lo sfondo, ecco cosa accade:</p>
<div style="margin: 0pt auto; background: #000000 none repeat scroll 0% 0%; text-align: center; width: 48px; height: 48px;"><img style="margin-top:16px" title="ajax-loader" src="/wp-content/uploads/2009/11/ajax-loader.gif" alt="ajax-loader" width="16" height="16" /></div>
<p>In attesa, quindi, della diffusione del formato <a href="http://animatedpng.com/" target="_blank">APNG</a> (Animated PNG) - che supporterà un vero e proprio canale alpha per le trasparenze, importare GIF animati in contesti come Adobe Flash risulta "graficamente" una pessima scelta. Ecco allora come realizzare un'animazione in Adobe Flash del tutto simile a quelle presenti sul Web.</p>
<h4>Costruiamo il nostro Ajax Loader in Adobe Flash: il "petalo"</h4>
<p>Prima di tutto creiamo un MovieClip vuoto (o se preferite potete lavorare direttamente sullo stage) e disegnamo una linea verticale nera, il nostro petalo, alta 60/70 pixel per comodità, impostando uno spessore (tratto) di 10:</p>
<p class="center"><img style="border:1px solid #aaa" title="Ajax Loader in Adobe Flash" src="/wp-content/uploads/2009/11/Immagine-1.png" alt="Ajax Loader in Adobe Flash" width="63" height="113" /></p>
<p>Selezioniamo la nostra linea e trasformiamola temporaneamente in un oggetto immagine (F8). Dal pannello <strong>Allinea</strong>, centriamola nello stage. Adesso duplichiamo (CTRL+D o CMD+D) la nostra linea, centriamo la linea duplicata e ruotiamola dal pannello <strong>Trasforma</strong> di 30 gradi:</p>
<p class="center"><img style="border:1px solid #aaa" title="Ajax Loader in Adobe Flash" src="/wp-content/uploads/2009/11/Immagine-18.png" alt="Ajax Loader in Adobe Flash" /> <img style="border:1px solid #aaa" title="Ajax Loader in Adobe Flash" src="/wp-content/uploads/2009/11/Immagine-2.png" alt="Ajax Loader in Adobe Flash" width="103" height="102" /></p>
<p>Ripetiamo questa operazione (duplica, centra, ruota di 30 gradi) fino ad ottenere:</p>
<p class="center"><img style="border:1px solid #aaa" title="Ajax Loader in Adobe Flash" src="/wp-content/uploads/2009/11/Immagine-3.png" alt="Ajax Loader in Adobe Flash" width="116" height="109" /></p>
<p>Selezioniamo tutta l'immagine, cioè la somma degli oggetti:</p>
<p class="center"><img style="border:1px solid #aaa" title="Ajax Loader in Adobe Flash" src="/wp-content/uploads/2009/11/Immagine-4.png" alt="Ajax Loader in Adobe Flash" width="113" height="110" /></p>
<p>Dal menu <strong>Elabora</strong> selezionate <strong>Dividi</strong> (CTRL+B o CMD+B):</p>
<p class="center"><img style="border:1px solid #aaa" title="Ajax Loader in Adobe Flash" src="/wp-content/uploads/2009/11/Immagine-5.png" alt="Ajax Loader in Adobe Flash" width="113" height="108" /></p>
<p>Poi, sempre dal menu Elabora, selezionate <strong>Forma</strong> &gt; <strong>Converti linee in riempimenti</strong>. In questo modo abbiamo ottenuto una figura "unica".</p>
<p>Adesso dobbiamo "bucare" il centro della nostra immagine. Per fare questo aumentate un po' lo <strong>zoom</strong> (tipo 400). Create un <strong>nuovo livello</strong> e proteggiamo quello con il lavoro svolto fino adesso:</p>
<p class="center"><img style="border:1px solid #aaa" title="Ajax Loader in Adobe Flash" src="/wp-content/uploads/2009/11/Immagine-7.png" alt="Ajax Loader in Adobe Flash" width="228" height="74" /></p>
<p>Su questo nuovo livello potremmo lavorare in tranquillità, senza danneggiare l'altra nostra immagine. Disegniamo, partendo dal centro (mantenete premuto il tasto <strong>ALT</strong> insieme al tasto maiuscole <strong>SHIFT</strong>) un cerchio rosso senza bordo:</p>
<p class="center"><img style="border:1px solid #aaa" title="Ajax Loader in Adobe Flash" src="/wp-content/uploads/2009/11/Immagine-8.png" alt="Ajax Loader in Adobe Flash" width="355" height="361" /></p>
<p>Nella figura qui sopra ho impostato la trasparenza del cerchio per evidenziare la sua posizione rispetto alla nostra figura (che si trova sul livello sottostante). Notate che ho appositamente "tagliato" gli spigoli dove si congiungono i "petali" della nostra figura. Il cerchio, quindi, dev'essere della giusta grandezza, cosa che ci tornerà comoda più avanti. Fatto questo selezionate il cerchio, copiatelo (CTRL+C o CMD+C) ed eliminate pure l'ultimo livello creato, sbloccate il livello con la nostra figura, e incollate!</p>
<p class="center"><img style="border:1px solid #aaa" title="Ajax Loader in Adobe Flash" src="/wp-content/uploads/2009/11/Immagine-9.png" alt="Ajax Loader in Adobe Flash" width="206" height="230" /></p>
<p>Cliccate adesso sul bianco dello stage in modo da deselezionare il cerchio rosso. Ora abbiamo "fuso" i nostri due oggetti. Selezionate nuovamente il cerchio rosso ed eliminatelo!</p>
<p class="center"><img style="border:1px solid #aaa" title="Ajax Loader in Adobe Flash" src="/wp-content/uploads/2009/11/Immagine-11.png" alt="Ajax Loader in Adobe Flash" width="215" height="205" /></p>
<p>Ottimo! Adesso selezioniamo tutto il nostro oggetto e cambiamogli colore con un grigio chiaro:</p>
<p class="center"><img style="border:1px solid #aaa" title="Ajax Loader in Adobe Flash" src="/wp-content/uploads/2009/11/Immagine-12.png" alt="Ajax Loader in Adobe Flash" width="197" height="185" /></p>
<p>Selezioniamo poi il primo petalo (ore 12) e impostiamolo a nero (voi ovvimente potete scegliere la gradazione di colori che preferite):</p>
<p class="center"><img style="border:1px solid #aaa" title="Ajax Loader in Adobe Flash" src="/wp-content/uploads/2009/11/Immagine-13.png" alt="Ajax Loader in Adobe Flash" /></p>
<p>Impostiamo ora il secondo petalo (ore 13) ad un grigio scuro:</p>
<p class="center"><img style="border:1px solid #aaa" title="Ajax Loader in Adobe Flash" src="/wp-content/uploads/2009/11/Immagine-14.png" alt="Ajax Loader in Adobe Flash" /></p>
<p>Proseguiamo per gli altri due petali (scegliete vuoi quanta gradazione applicare) fino ad ottenere:</p>
<p class="center"><img style="border:1px solid #aaa" title="Ajax Loader in Adobe Flash" src="/wp-content/uploads/2009/11/Immagine-15.png" alt="Ajax Loader in Adobe Flash" /></p>
<h4>L'animazione</h4>
<p>Perfetto, ci siamo quasi, l'ultimo sforzo richiesto è creare la rotazione. Questa non deve riguardare i petali ma solo il colore. Per fare questo avremmo potuto procedere anche in altri modi (vedi ad esempio con luso delle maschere...), tuttavia questo mi sembra più semplice. Spostiamoci di qualche fotogramma avanti, tipo al 5 e inseriamo un <strong>Fotogramma chiave</strong>.</p>
<p class="center"><img style="border:1px solid #aaa" title="Ajax Loader in Adobe Flash" src="/wp-content/uploads/2009/11/Immagine-16.png" alt="Ajax Loader in Adobe Flash" /></p>
<p>Da pannello <strong>Trasforma</strong> ruotiamo la nostra immagine di 30 gradi, gli stessi gradi utilizzati durante la creazione dei nostri "petali". Ripetiamo questa operazione (inserimento Fotogramma chiave e rotazione di 30 gradi) mantenedo sempre costanti in numero di fotogrammi tra una chiave e un'altra, fino ad ottenere:</p>
<p class="center"><img style="border:1px solid #aaa" title="Ajax Loader in Adobe Flash" src="/wp-content/uploads/2009/11/Immagine-19.png" alt="Ajax Loader in Adobe Flash" /></p>
<p>Finito! Il nostro <strong>Ajax Loader in Adobe Flash</strong> è terminato! Ecco qui sotto la versione GIF esportata da Flash.</p>
<p class="center"><img title="Ajax Loader in Adobe Flash" src="/wp-content/uploads/2009/11/aaaa1.gif" alt="Ajax Loader in Adobe Flash" width="80" height="80" /></p>
<p>Qui sotto il filmato Flash con uno sfondo in movimento (notate che non ci sono distorzioni o sgranature):<br />

<object width="80" height="80">
<param name="movie" value="/wp-content/uploads/2009/11/ajax-loader.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#000000"></param>
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" width="80" height="80" src="/wp-content/uploads/2009/11/ajax-loader.swf" quality="high" bgcolor="#000000" wmode="window" menu="false" allowFullScreen="true" ></embed>
</object>
<br />
<a href="/wp-content/uploads/2009/11/ajax-loader.fla.zip">Il sorgente</a> <img src='http://www.undolog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F11%2F04%2Fadobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator%2F&amp;title=Adobe%20Flash%20CS4%3A%20creare%20un%20Ajax%20Loader%20o%20Activity%20Indicator&amp;bodytext=Creare%20un%20Ajax%20Loader%20%28o%20Activity%20indicator%20per%20chi%20%C3%A8%20ormai%20abituato%20ad%20usare%20l%27Apple%20iPhone%29%20per%20il%20Web%20non%20%C3%A8%20una%20cosa%20difficile%3A%20esistono%20servizi%20che%20generano%20immagini%20gif%20animate%20di%20tutti%20i%20tipi.%20Tuttavia%20il%20formato%20GIF%20ha%20il%20grosso%20difetto%20di%20n" title="Digg"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F11%2F04%2Fadobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator%2F&amp;title=Adobe%20Flash%20CS4%3A%20creare%20un%20Ajax%20Loader%20o%20Activity%20Indicator&amp;notes=Creare%20un%20Ajax%20Loader%20%28o%20Activity%20indicator%20per%20chi%20%C3%A8%20ormai%20abituato%20ad%20usare%20l%27Apple%20iPhone%29%20per%20il%20Web%20non%20%C3%A8%20una%20cosa%20difficile%3A%20esistono%20servizi%20che%20generano%20immagini%20gif%20animate%20di%20tutti%20i%20tipi.%20Tuttavia%20il%20formato%20GIF%20ha%20il%20grosso%20difetto%20di%20n" title="del.icio.us"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.undolog.com%2F2009%2F11%2F04%2Fadobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator%2F" title="Technorati"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.undolog.com%2F2009%2F11%2F04%2Fadobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator%2F&amp;t=Adobe%20Flash%20CS4%3A%20creare%20un%20Ajax%20Loader%20o%20Activity%20Indicator" title="Facebook"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.undolog.com%2F2009%2F11%2F04%2Fadobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator%2F&amp;title=Adobe%20Flash%20CS4%3A%20creare%20un%20Ajax%20Loader%20o%20Activity%20Indicator&amp;annotation=Creare%20un%20Ajax%20Loader%20%28o%20Activity%20indicator%20per%20chi%20%C3%A8%20ormai%20abituato%20ad%20usare%20l%27Apple%20iPhone%29%20per%20il%20Web%20non%20%C3%A8%20una%20cosa%20difficile%3A%20esistono%20servizi%20che%20generano%20immagini%20gif%20animate%20di%20tutti%20i%20tipi.%20Tuttavia%20il%20formato%20GIF%20ha%20il%20grosso%20difetto%20di%20n" title="Google Bookmarks"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Adobe%20Flash%20CS4%3A%20creare%20un%20Ajax%20Loader%20o%20Activity%20Indicator%20-%20http%3A%2F%2Fwww.undolog.com%2F2009%2F11%2F04%2Fadobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator%2F" title="Twitter"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://barrapunto.com/submit.pl?subj=Adobe%20Flash%20CS4%3A%20creare%20un%20Ajax%20Loader%20o%20Activity%20Indicator&amp;story=http%3A%2F%2Fwww.undolog.com%2F2009%2F11%2F04%2Fadobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator%2F" title="BarraPunto"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/barrapunto.png" title="BarraPunto" alt="BarraPunto" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://current.com/clipper.htm?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F11%2F04%2Fadobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator%2F&amp;title=Adobe%20Flash%20CS4%3A%20creare%20un%20Ajax%20Loader%20o%20Activity%20Indicator" title="Current"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Adobe%20Flash%20CS4%3A%20creare%20un%20Ajax%20Loader%20o%20Activity%20Indicator&amp;body=http%3A%2F%2Fwww.undolog.com%2F2009%2F11%2F04%2Fadobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator%2F" title="email"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Adobe%20Flash%20CS4%3A%20creare%20un%20Ajax%20Loader%20o%20Activity%20Indicator&amp;link=http%3A%2F%2Fwww.undolog.com%2F2009%2F11%2F04%2Fadobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator%2F" title="FriendFeed"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.undolog.com%2F2009%2F11%2F04%2Fadobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator%2F&amp;headline=Adobe%20Flash%20CS4%3A%20creare%20un%20Ajax%20Loader%20o%20Activity%20Indicator&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F11%2F04%2Fadobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator%2F&amp;title=Adobe%20Flash%20CS4%3A%20creare%20un%20Ajax%20Loader%20o%20Activity%20Indicator&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Creare%20un%20Ajax%20Loader%20%28o%20Activity%20indicator%20per%20chi%20%C3%A8%20ormai%20abituato%20ad%20usare%20l%27Apple%20iPhone%29%20per%20il%20Web%20non%20%C3%A8%20una%20cosa%20difficile%3A%20esistono%20servizi%20che%20generano%20immagini%20gif%20animate%20di%20tutti%20i%20tipi.%20Tuttavia%20il%20formato%20GIF%20ha%20il%20grosso%20difetto%20di%20n" title="LinkedIn"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F11%2F04%2Fadobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator%2F&amp;title=Adobe%20Flash%20CS4%3A%20creare%20un%20Ajax%20Loader%20o%20Activity%20Indicator" title="Live"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.undolog.com%2F2009%2F11%2F04%2Fadobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator%2F&amp;t=Adobe%20Flash%20CS4%3A%20creare%20un%20Ajax%20Loader%20o%20Activity%20Indicator" title="MySpace"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Adobe%20Flash%20CS4%3A%20creare%20un%20Ajax%20Loader%20o%20Activity%20Indicator&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F11%2F04%2Fadobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator%2F" title="Netvibes"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F11%2F04%2Fadobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator%2F&amp;partner=sociable" title="Print"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.undolog.com/feed/" title="RSS"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://segnalo.alice.it/post.html.php?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F11%2F04%2Fadobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator%2F&amp;title=Adobe%20Flash%20CS4%3A%20creare%20un%20Ajax%20Loader%20o%20Activity%20Indicator" title="Segnalo"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/segnalo.png" title="Segnalo" alt="Segnalo" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F11%2F04%2Fadobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator%2F&amp;title=Adobe%20Flash%20CS4%3A%20creare%20un%20Ajax%20Loader%20o%20Activity%20Indicator" title="StumbleUpon"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.it/vote?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F11%2F04%2Fadobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator%2F" title="Wikio IT"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio IT" alt="Wikio IT" class="sociable-hovers" /></a>


<br/><br/>
	Tags: <a href="http://www.undolog.com/category/sviluppo/flash-cs3/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/activity-indicator/" title="Activity Indicator" rel="tag">Activity Indicator</a>, <a href="http://www.undolog.com/tag/adobe-flash-cs4/" title="Adobe Flash CS4" rel="tag">Adobe Flash CS4</a>, <a href="http://www.undolog.com/tag/ajax-loader/" title="Ajax Loader" rel="tag">Ajax Loader</a>, <a href="http://www.undolog.com/category/sviluppo/flash/" title="Flash" rel="tag">Flash</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs4-sviluppo/" title="Flash CS4" rel="tag">Flash CS4</a>, <a href="http://www.undolog.com/tag/png/" title="PNG" rel="tag">PNG</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/category/tutorials/" title="Tutorials" rel="tag">Tutorials</a>, <a href="http://www.undolog.com/tag/tutorials/" title="Tutorials" rel="tag">Tutorials</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2009/07/03/wordpress-usare-gli-shortcodes/" title="Wordpress: usare gli shortcodes (3 luglio, 2009)">Wordpress: usare gli shortcodes</a> (5)</li>
	<li><a href="http://www.undolog.com/2008/11/01/wordpress-rimuovere-i-menu-dellamministrazione/" title="Wordpress: rimuovere i menu dell&#8217;amministrazione (1 novembre, 2008)">Wordpress: rimuovere i menu dell&#8217;amministrazione</a> (12)</li>
	<li><a href="http://www.undolog.com/2009/02/09/wordpress-personalizzare-la-navigazione-tra-i-post/" title="Wordpress: personalizzare la navigazione tra i post (9 febbraio, 2009)">Wordpress: personalizzare la navigazione tra i post</a> (5)</li>
	<li><a href="http://www.undolog.com/2008/10/03/wordpress-come-scrivere-un-reply-to-comment-usando-jquery/" title="Wordpress: come scrivere un reply to comment usando jQuery (3 ottobre, 2008)">Wordpress: come scrivere un reply to comment usando jQuery</a> (18)</li>
	<li><a href="http://www.undolog.com/2008/10/24/wordpress-come-creare-passo-passo-un-proprio-login/" title="Wordpress: come creare passo passo un proprio login (24 ottobre, 2008)">Wordpress: come creare passo passo un proprio login</a> (21)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2009/11/04/adobe-flash-cs4-creare-un-ajax-loader-o-activity-indicator/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Come usare Google Maps in Adobe Flash CS4</title>
		<link>http://www.undolog.com/2009/08/29/come-usare-google-maps-in-adobe-flash-cs4/</link>
		<comments>http://www.undolog.com/2009/08/29/come-usare-google-maps-in-adobe-flash-cs4/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 22:34:40 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Flash CS4]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe-Flash]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[Google Maps API]]></category>
		<category><![CDATA[Google Maps API ActionScript Reference]]></category>
		<category><![CDATA[Latitudine]]></category>
		<category><![CDATA[Longitudine]]></category>
		<category><![CDATA[Marker]]></category>
		<category><![CDATA[Overlay]]></category>
		<category><![CDATA[RIA]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=2360</guid>
		<description><![CDATA[Tutorial su come utilizzare le API di Google Maps in Adobe Flash CS4, per creare mappe interattive davvero accativanti con effetti (anche 3D) spettacolari]]></description>
			<content:encoded><![CDATA[<p>In <strong>Adobe Flash</strong> è possibile utilizzare un vasto assortimento di <strong>Web API</strong> esterne fornite da servizi come <a href="http://www.facebook.com" target="_blank">Facebook</a>, <a target="_blank" href="http://www.twitter.com">Twitter</a> o <a href="http://www.flickr.com" target="_blank">Flickr</a>. In questo tutorial vedremo come integrare, in modo davvero semplice, i servizi di <a href="http://code.google.com/intl/it-IT/apis/maps/documentation/flash/" target="_blank">Google Maps</a> in un filmato/applicazione Adobe Flash CS4. Premetto che il procedimento per poter utilizzare Google Maps in Flash è molto simile a quello che accade in HTML/Javascript (vedi per dettagli <a href="http://www.undolog.com/2007/01/23/come-inserire-google-map-nel-proprio-web/"><em>Come inserire Google Map nel proprio Web</em></a>).</p>
<h4>Download ed installazione delle SDK</h4>
<p>Per prima cosa memorizziamo nei bookmark del nostro browser l'indirizzo del sito <a href="http://code.google.com/intl/it-IT/apis/maps/documentation/flash/" target="_blank">Google Maps API per Flash</a>. Su questo sito troviamo tutto ciò che ci server per utilizzare le API di Google. Sulla destra della pagina è possibile accedere ad una serie di risorse, tra cui il <a target="_blank" href="http://maps.googleapis.com/maps/flash/release/sdk.zip">link per scaricare le SDK</a> da usare in Flash. Salvate lo ZIP sulla vostra scrivania (o Desktop) e scompattatelo. Nella cartella <code>sdk/lib</code> troverete un file chiamato <code>map_1_16.swc</code>. Copiate questo file nella clipboard (<code>Command-C</code> per Mac o <code>Ctrl-C</code> per PC) e posizionatelo all'interno di questo percorso:</p>
<div class="igBar"><span id="lcode-1"><a href="#" onclick="javascript:showCodeTxt('code-1'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-1">
<div class="code" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color:#FF9933; font-style:italic;">// Mac</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color:#006600; font-weight:bold;">&#91;</span>cartella utente<span style="color:#006600; font-weight:bold;">&#93;</span>/Library/Application Support/Adobe/Flash CS4/language/Configuration/Components</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color:#FF9933; font-style:italic;">// Windows</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color:#006600; font-weight:bold;">&#91;</span>cartella utente<span style="color:#006600; font-weight:bold;">&#93;</span>\Local Settings\Application Data\Adobe\Flash CS4\language\Configuration\Components</div>
</li>
</ol>
</div>
</div>
</div>
<p>
Se la cartella <code>Components</code> non esiste già, createla e in questa create una cartella <code>Google</code> e incollate il file <code>map_1_16.swc</code>. Se per caso avevate già aperto Flash (frettolosi...), chiudetelo e rapritelo, in modo che possa ricaricare il componente appena installato.</p>
<h4>Creiamo il filmato Flash</h4>
<p>A questo punto apriamo Flash e creiamo un nuovo filmato. Aprite la finestra <strong>Componenti</strong> e dovreste trovare Google Maps:</p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2009/08/Immagine-21.png" alt="Google Maps Library" title="Google Maps Library" width="215" height="169" style="border:1px solid #aaa" /></p>
<p>Selezionate il componente <code>GoogleMapsLibrary</code> e trascinatelo nello stage. Nel primo frame del nostro filmato inserite il seguente semplice codice:</p>
<div class="igBar"><span id="lactionscript3-2"><a href="#" onclick="javascript:showCodeTxt('actionscript3-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-2">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">// Importo le classi Google Maps</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">import</span> com<span style="color: #000066; font-weight: bold;">.</span>google<span style="color: #000066; font-weight: bold;">.</span>maps<span style="color: #000066; font-weight: bold;">.*;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">import</span> com<span style="color: #000066; font-weight: bold;">.</span>google<span style="color: #000066; font-weight: bold;">.</span>maps<span style="color: #000066; font-weight: bold;">.</span>overlays<span style="color: #000066; font-weight: bold;">.*;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">import</span> com<span style="color: #000066; font-weight: bold;">.</span>google<span style="color: #000066; font-weight: bold;">.</span>maps<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.*;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">map</span><span style="color: #000066; font-weight: bold;">:</span>Map = <span style="color: #0033ff; font-weight: bold;">new</span> Map<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #004993;">map</span><span style="color: #000066; font-weight: bold;">.</span>key &nbsp; &nbsp; = <span style="color: #990000;">&quot;API_KEY&quot;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// vedi sotto per ottenere una tua chiave</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">// In questo esempio imposto la dimensione della Mappa Google della</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">// stessa grandezza del filmato. In alternativa potete inserire le</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">// dimensioni che preferite.</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #004993;">map</span><span style="color: #000066; font-weight: bold;">.</span>setSize<span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=point%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:point.html"><span style="color: #004993;">Point</span></a><span style="color: #000000;">&#40;</span><span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageWidth</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageHeight</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">map</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
Nella riga 7 dovete sostituire la stringa <code>API_KEY</code> con la chiave di attivazione che fornisce Google. Per ottenerla basta tornare sul sito <a target="_blank" href="http://code.google.com/intl/it-IT/apis/maps/documentation/flash/">Google Maps API for Flash</a> e richiedere una <strong>API Key</strong> cliccando su <a target="_blank" href="http://code.google.com/apis/maps/signup.html">Sign up for a Google Maps API Key</a>. Quando vi verrà chiesto di <strong>inserire l'url del sito</strong> sul quale volete utilizzare il filmato Flash che accede alle API di Google, nel caso non lo sapete ancora o voletete semplicemente provare il filmato in locale, inserite <code>http://localost</code> e cliccate su <strong>Generate API Key</strong>:</p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2009/08/Immagine-31.png" alt="Google API Key" title="Google API Key" width="504" height="168" style="border:1px solid #aaa" /></p>
<p>A questo punto possiamo già provare il filmato, ottenendo:</p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2009/08/Immagine-22.png" alt="Filmato Flash con Google Maps" title="Filmato Flash con Google Maps" width="589" height="466" /></p>
<h4>Aggiungiamo qualche controllo</h4>
<p>Per prima cosa aggiungiamo i <a target="_blank" href="http://code.google.com/intl/it-IT/apis/maps/documentation/flash/controls.html">classici controlli</a> di <strong>Posizione</strong>, <strong>Zoom</strong> e <strong>Tipo Mappa</strong>. Per fare questo dobbiamo essere sicuri che la mappa sia pronta all'uso. Basta quindi creare un listener sull'evento <code>MapEvent.MAP_READY</code>. Aggiungiamo quindi le seguenti righe di codice:</p>
<div class="igBar"><span id="lactionscript3-3"><a href="#" onclick="javascript:showCodeTxt('actionscript3-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-3">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">// Aggiungiamo i controlli</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #004993;">map</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> MapEvent<span style="color: #000066; font-weight: bold;">.</span>MAP_READY<span style="color: #000066; font-weight: bold;">,</span> onMapReady <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339966; font-weight: bold;">function</span> onMapReady<span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span>MapEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #004993;">map</span><span style="color: #000066; font-weight: bold;">.</span>addControl<span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> PositionControl<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #004993;">map</span><span style="color: #000066; font-weight: bold;">.</span>addControl<span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> ZoomControl<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #004993;">map</span><span style="color: #000066; font-weight: bold;">.</span>addControl<span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> MapTypeControl<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h4>Impostiamo un indirizzo</h4>
<p>A questo punto possiamo impostare la mappa in modo che visualizzi un indirizzo specifico, come la sede della mia società <a target="_blank" href="http://www.saidmade.com">Saidmade</a> a Modena - o qualsiasi altro indirizzo che preferite.<br />
<strong>Suggerimento:</strong> per trovare le coordinate del nostro indirizzo, ovvero <strong>Latitudine e Longitudine</strong>, possiamo usare questo semplice e utile <strong>hack</strong>. Aprire il sito di <a target="_blank" href="http://maps.google.it/maps">Google Maps</a>. Una volta sulla mappa cercate l'indirizzo che desiderate (ad esempio Via Cortese 10, Modena). Quando l'indirizzo è visualizzato sulla mappa, inserite questa riga nella barra indirizzi del browser:</p>
<div class="igBar"><span id="ljavascript-4"><a href="#" onclick="javascript:showCodeTxt('javascript-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-4">
<div class="javascript" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">javascript<span style="color: #339933;">:</span><span style="color: #000066; font-weight: bold;">void</span><span style="color: #009900;">&#40;</span><span style="color: #000066;">prompt</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #339933;">,</span>gApplication.<span style="color: #660066;">getMap</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getCenter</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
Si aprirà una finestra pop-up con le coordinate utilizzabile nel codice:</p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2009/08/Immagine-23.png" alt="Latitudine e Longitudine" title="Latitudine e Longitudine" width="460" height="199" style="border:1px solid #aaa" /></p>
<p>Torniamo ad ActionScript e aggiungiamo le seguenti righe di codice nella funzione <code>onMapReady()</code>:</p>
<div class="igBar"><span id="lactionscript3-5"><a href="#" onclick="javascript:showCodeTxt('actionscript3-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-5">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">// centro la mappa su una specifica località</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #004993;">map</span><span style="color: #000066; font-weight: bold;">.</span>setCenter<span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> LatLng<span style="color: #000000;">&#40;</span> 44<span style="color: #000066; font-weight: bold;">.</span>639828<span style="color: #000066; font-weight: bold;">,</span> 10<span style="color: #000066; font-weight: bold;">.</span>941795<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span> 18<span style="color: #000066; font-weight: bold;">,</span> MapType<span style="color: #000066; font-weight: bold;">.</span>SATELLITE_MAP_TYPE <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
Eseguiamo il filmato:</p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2009/08/Immagine-5.png" alt="La sede di Saidmade Srl" title="La sede di Saidmade Srl" width="587" height="460" /></p>
<h4>Aggiungiamo un Marker</h4>
<p>Sempre all'interno della funzione <code>onMapReady()</code> aggiungiamo le seguenti righe di codice:</p>
<div class="igBar"><span id="lactionscript3-6"><a href="#" onclick="javascript:showCodeTxt('actionscript3-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-6">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">// aggiungiamo il default marker</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> m<span style="color: #000066; font-weight: bold;">:</span>Marker = <span style="color: #0033ff; font-weight: bold;">new</span> Marker<span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> LatLng<span style="color: #000000;">&#40;</span> 44<span style="color: #000066; font-weight: bold;">.</span>639828<span style="color: #000066; font-weight: bold;">,</span> 10<span style="color: #000066; font-weight: bold;">.</span>941795<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #004993;">map</span><span style="color: #000066; font-weight: bold;">.</span>addOverlay<span style="color: #000000;">&#40;</span>m<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2009/08/Immagine-6.png" alt="Marker overlay" title="Marker overlay" width="591" height="467" class="alignnone size-full wp-image-2391" /></p>
<p>I Marker possono essere personalizzati a piacimento, sia tramite gli stili fornite dalle API stesse di Google, sia tramite Flash. Ad esempio aggiungendo questa <code>import</code> all'inizio del codice:</p>
<div class="igBar"><span id="lactionscript3-7"><a href="#" onclick="javascript:showCodeTxt('actionscript3-7'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-7">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">import</span> com<span style="color: #000066; font-weight: bold;">.</span>google<span style="color: #000066; font-weight: bold;">.</span>maps<span style="color: #000066; font-weight: bold;">.</span>styles<span style="color: #000066; font-weight: bold;">.*;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
e sostituiendo il codice di creazione Marker visto prima con:</p>
<div class="igBar"><span id="lactionscript3-8"><a href="#" onclick="javascript:showCodeTxt('actionscript3-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-8">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">// aggiungiamo il default marker</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> m<span style="color: #000066; font-weight: bold;">:</span>Marker = <span style="color: #0033ff; font-weight: bold;">new</span> Marker<span style="color: #000000;">&#40;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span style="color: #0033ff; font-weight: bold;">new</span> LatLng<span style="color: #000000;">&#40;</span>44<span style="color: #000066; font-weight: bold;">.</span>639828<span style="color: #000066; font-weight: bold;">,</span> 10<span style="color: #000066; font-weight: bold;">.</span>941795<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span style="color: #0033ff; font-weight: bold;">new</span> MarkerOptions<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp;strokeStyle<span style="color: #000066; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">new</span> StrokeStyle<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span><span style="color: #004993;">color</span><span style="color: #000066; font-weight: bold;">:</span> 0x987654<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp;fillStyle<span style="color: #000066; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">new</span> FillStyle<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span><span style="color: #004993;">color</span><span style="color: #000066; font-weight: bold;">:</span> 0x223344<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">alpha</span><span style="color: #000066; font-weight: bold;">:</span> 0<span style="color: #000066; font-weight: bold;">.</span>8<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp;radius<span style="color: #000066; font-weight: bold;">:</span> 12<span style="color: #000066; font-weight: bold;">,</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp;hasShadow<span style="color: #000066; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">true</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #004993;">map</span><span style="color: #000066; font-weight: bold;">.</span>addOverlay<span style="color: #000000;">&#40;</span>m<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
otteniamo il seguento effetto:</p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2009/08/Immagine-7.png" alt="Personalizzare il Marker" title="Personalizzare il Marker" width="584" height="463" /></p>
<p>In alternativa è possibile associare <strong>direttamente un MovieClip</strong> come Marker. Essendo un MovieClip, ovviamente, esso potrà contenere <strong>animazioni</strong>, <strong>video</strong> o qualsiasi altro tipo di contenuto interattivo <strong>supportato in Flash</strong>. Inoltre è possibile disegnare linee e forme così da creare delle mappe interattive e ricche di contenuti multimediali.<br />
Per aggiungere un MovieClip e sufficiente crearlo, usando ad esempio un'immagine o un'animazione Flash, e impostare le sue proprietà in questo modo:</p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2009/08/property.jpg" alt="Impostazione proprietà MovieClip usato come Marker" title="Impostazione proprietà MovieClip usato come Marker" width="480" height="520" /></p>
<p>Fatto questo modificate il codice di creazione Marker in:</p>
<div class="igBar"><span id="lactionscript3-9"><a href="#" onclick="javascript:showCodeTxt('actionscript3-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-9">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">// aggiungiamo il default marker</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> m<span style="color: #000066; font-weight: bold;">:</span>Marker = <span style="color: #0033ff; font-weight: bold;">new</span> Marker<span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> LatLng<span style="color: #000000;">&#40;</span>44<span style="color: #000066; font-weight: bold;">.</span>639828<span style="color: #000066; font-weight: bold;">,</span> 10<span style="color: #000066; font-weight: bold;">.</span>941795<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0033ff; font-weight: bold;">new</span> MarkerOptions<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span>icon<span style="color: #000066; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">new</span> myMarkerMovieClip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #004993;">map</span><span style="color: #000066; font-weight: bold;">.</span>addOverlay<span style="color: #000000;">&#40;</span>m<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2009/08/Immagine-9.png" alt="Un Marker davvero speciale" title="Un Marker davvero speciale" width="587" height="466" /></p>
<p>Tutte le informazioni sulle API, le classi, metodi, eventi e proprietà sono disponibili su <a target="_blank" href="http://code.google.com/intl/it-IT/apis/maps/documentation/flash/reference.html">Google Maps API ActionScript Reference</a>.<br />
Inoltre l'intero pacchetto è stato recentemente aggiornato con molte novità interessanti, come le <a target="_blank" href="http://code.google.com/intl/it-IT/apis/maps/documentation/flash/3d-maps.html">Mappe 3D</a>.</p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F29%2Fcome-usare-google-maps-in-adobe-flash-cs4%2F&amp;title=Come%20usare%20Google%20Maps%20in%20Adobe%20Flash%20CS4&amp;bodytext=Tutorial%20su%20come%20utilizzare%20le%20API%20di%20Google%20Maps%20in%20Adobe%20Flash%20CS4%2C%20per%20creare%20mappe%20interattive%20davvero%20accativanti%20con%20effetti%20%28anche%203D%29%20spettacolari" title="Digg"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F29%2Fcome-usare-google-maps-in-adobe-flash-cs4%2F&amp;title=Come%20usare%20Google%20Maps%20in%20Adobe%20Flash%20CS4&amp;notes=Tutorial%20su%20come%20utilizzare%20le%20API%20di%20Google%20Maps%20in%20Adobe%20Flash%20CS4%2C%20per%20creare%20mappe%20interattive%20davvero%20accativanti%20con%20effetti%20%28anche%203D%29%20spettacolari" title="del.icio.us"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F29%2Fcome-usare-google-maps-in-adobe-flash-cs4%2F" title="Technorati"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F29%2Fcome-usare-google-maps-in-adobe-flash-cs4%2F&amp;t=Come%20usare%20Google%20Maps%20in%20Adobe%20Flash%20CS4" title="Facebook"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F29%2Fcome-usare-google-maps-in-adobe-flash-cs4%2F&amp;title=Come%20usare%20Google%20Maps%20in%20Adobe%20Flash%20CS4&amp;annotation=Tutorial%20su%20come%20utilizzare%20le%20API%20di%20Google%20Maps%20in%20Adobe%20Flash%20CS4%2C%20per%20creare%20mappe%20interattive%20davvero%20accativanti%20con%20effetti%20%28anche%203D%29%20spettacolari" title="Google Bookmarks"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Come%20usare%20Google%20Maps%20in%20Adobe%20Flash%20CS4%20-%20http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F29%2Fcome-usare-google-maps-in-adobe-flash-cs4%2F" title="Twitter"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://barrapunto.com/submit.pl?subj=Come%20usare%20Google%20Maps%20in%20Adobe%20Flash%20CS4&amp;story=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F29%2Fcome-usare-google-maps-in-adobe-flash-cs4%2F" title="BarraPunto"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/barrapunto.png" title="BarraPunto" alt="BarraPunto" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://current.com/clipper.htm?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F29%2Fcome-usare-google-maps-in-adobe-flash-cs4%2F&amp;title=Come%20usare%20Google%20Maps%20in%20Adobe%20Flash%20CS4" title="Current"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Come%20usare%20Google%20Maps%20in%20Adobe%20Flash%20CS4&amp;body=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F29%2Fcome-usare-google-maps-in-adobe-flash-cs4%2F" title="email"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Come%20usare%20Google%20Maps%20in%20Adobe%20Flash%20CS4&amp;link=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F29%2Fcome-usare-google-maps-in-adobe-flash-cs4%2F" title="FriendFeed"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F29%2Fcome-usare-google-maps-in-adobe-flash-cs4%2F&amp;headline=Come%20usare%20Google%20Maps%20in%20Adobe%20Flash%20CS4&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F29%2Fcome-usare-google-maps-in-adobe-flash-cs4%2F&amp;title=Come%20usare%20Google%20Maps%20in%20Adobe%20Flash%20CS4&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Tutorial%20su%20come%20utilizzare%20le%20API%20di%20Google%20Maps%20in%20Adobe%20Flash%20CS4%2C%20per%20creare%20mappe%20interattive%20davvero%20accativanti%20con%20effetti%20%28anche%203D%29%20spettacolari" title="LinkedIn"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F29%2Fcome-usare-google-maps-in-adobe-flash-cs4%2F&amp;title=Come%20usare%20Google%20Maps%20in%20Adobe%20Flash%20CS4" title="Live"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F29%2Fcome-usare-google-maps-in-adobe-flash-cs4%2F&amp;t=Come%20usare%20Google%20Maps%20in%20Adobe%20Flash%20CS4" title="MySpace"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Come%20usare%20Google%20Maps%20in%20Adobe%20Flash%20CS4&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F29%2Fcome-usare-google-maps-in-adobe-flash-cs4%2F" title="Netvibes"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F29%2Fcome-usare-google-maps-in-adobe-flash-cs4%2F&amp;partner=sociable" title="Print"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.undolog.com/feed/" title="RSS"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://segnalo.alice.it/post.html.php?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F29%2Fcome-usare-google-maps-in-adobe-flash-cs4%2F&amp;title=Come%20usare%20Google%20Maps%20in%20Adobe%20Flash%20CS4" title="Segnalo"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/segnalo.png" title="Segnalo" alt="Segnalo" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F29%2Fcome-usare-google-maps-in-adobe-flash-cs4%2F&amp;title=Come%20usare%20Google%20Maps%20in%20Adobe%20Flash%20CS4" title="StumbleUpon"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.it/vote?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F29%2Fcome-usare-google-maps-in-adobe-flash-cs4%2F" title="Wikio IT"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio IT" alt="Wikio IT" class="sociable-hovers" /></a>


<br/><br/>
	Tags: <a href="http://www.undolog.com/tag/actionscript/" title="ActionScript" rel="tag">ActionScript</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/adobe-flash/" title="Adobe-Flash" rel="tag">Adobe-Flash</a>, <a href="http://www.undolog.com/tag/api/" title="api" rel="tag">api</a>, <a href="http://www.undolog.com/category/featured/" title="Featured" rel="tag">Featured</a>, <a href="http://www.undolog.com/tag/flash-cs4/" title="Flash CS4" rel="tag">Flash CS4</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs4-sviluppo/" title="Flash CS4" rel="tag">Flash CS4</a>, <a href="http://www.undolog.com/tag/google-maps-api/" title="Google Maps API" rel="tag">Google Maps API</a>, <a href="http://www.undolog.com/tag/google-maps-api-actionscript-reference/" title="Google Maps API ActionScript Reference" rel="tag">Google Maps API ActionScript Reference</a>, <a href="http://www.undolog.com/tag/latitudine/" title="Latitudine" rel="tag">Latitudine</a>, <a href="http://www.undolog.com/tag/longitudine/" title="Longitudine" rel="tag">Longitudine</a>, <a href="http://www.undolog.com/tag/marker/" title="Marker" rel="tag">Marker</a>, <a href="http://www.undolog.com/tag/overlay/" title="Overlay" rel="tag">Overlay</a>, <a href="http://www.undolog.com/tag/ria/" title="RIA" rel="tag">RIA</a>, <a href="http://www.undolog.com/category/tutorials/" title="Tutorials" rel="tag">Tutorials</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2007/02/13/web20-adobe-ci-prova-con-apollo/" title="Web2.0: Adobe ci prova con Apollo? (13 febbraio, 2007)">Web2.0: Adobe ci prova con Apollo?</a> (2)</li>
	<li><a href="http://www.undolog.com/2007/03/12/web20-gran-paradiso-firefox-30-e-apollo/" title="Web2.0: Gran Paradiso-Firefox 3.0 e Apollo (12 marzo, 2007)">Web2.0: Gran Paradiso-Firefox 3.0 e Apollo</a> (2)</li>
	<li><a href="http://www.undolog.com/2008/02/29/umap-flash-component-beta-v06/" title="UMap Flash Component (Beta v0.6) (29 febbraio, 2008)">UMap Flash Component (Beta v0.6)</a> (0)</li>
	<li><a href="http://www.undolog.com/2007/03/15/papervision3d/" title="Papervision3D (15 marzo, 2007)">Papervision3D</a> (0)</li>
	<li><a href="http://www.undolog.com/2007/03/02/net-software/" title="Net Software (2 marzo, 2007)">Net Software</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2009/08/29/come-usare-google-maps-in-adobe-flash-cs4/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Da Actionscript ad Objective-C</title>
		<link>http://www.undolog.com/2009/06/12/da-actionscript-ad-objective-c/</link>
		<comments>http://www.undolog.com/2009/06/12/da-actionscript-ad-objective-c/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 08:00:26 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tecnologia]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[ANSI-C]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Object-Oriented]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=1725</guid>
		<description><![CDATA[Ho pensato che potrebbe essere utile a chi si è avvicinato da poco allo sviluppo di applicazioni per Apple iPhone, confrontare Adobe Actionscript - il linguaggio utilizzato in Adobe Flash e Adobe Flex, più diffuso tra i neo-programmatori - e Objective-C, il linguaggio utilizzato da Apple per sviluppare le sue applicazioni. Objective-C è a tutti [...]]]></description>
			<content:encoded><![CDATA[<p>Ho pensato che potrebbe essere utile a chi si è avvicinato da poco allo sviluppo di <strong>applicazioni per Apple iPhone</strong>, <strong>confrontare Adobe Actionscript</strong> - il linguaggio utilizzato in <strong>Adobe Flash e Adobe Flex</strong>, più diffuso tra i neo-programmatori - e <strong>Objective-C</strong>, il linguaggio utilizzato da Apple per sviluppare le sue applicazioni. Objective-C è a tutti gli effetti un linguaggio ad oggetti nel senso puro, non che Actionscript non lo sia, ma Objective-C ha sicuramente una marcia in più in quanto è un'estensione dell'ANSI C e la sua sintassi è un mix tra C/C++ e Smalltalk; è un vero OO (Object-oriented language). Moltissime caratteristiche dell'Objective-C non sono presenti in Actionscript che, nell'ultima release 3.0, ha dimostrato di poter crescere nonostante sia ancora lontano dal profilo di un buon linguaggio di sviluppo ad oggetti.</p>
<h4>Classi</h4>
<p>Ad esempio vediamo come vengono diversamente strutturate le definizioni delle classi in Actionscript e Objective-C.</p>
<div class="igBar"><span id="lactionscript3-17"><a href="#" onclick="javascript:showCodeTxt('actionscript3-17'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-17">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">// pakage - per il namespacing di Adobe</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">pakage <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// definizione della classe vera e propria</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> MyClass <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// definizione delle proprietà (pubbliche o private)</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> myPropertyVar<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// costruttore</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> MyClass<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// todo</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// metodo pubblico</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> myMethod<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// todo</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>In Objective-C la prima differenza (ereditata dal C) è la separazione tra le "definizioni" e l'implementazione. In Objective-C avrete sempre a che fare con due tipi di file distinti: .h e .m (in C avremmo .h e .c). I file .h (header file) contengono solo le definizioni, quindi nessuna impostazione o implementazione.</p>
<div class="igBar"><span id="lobjc-18"><a href="#" onclick="javascript:showCodeTxt('objc-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Objective-C:</span>
<div id="objc-18">
<div class="objc" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #11740a; font-style: italic;">// myClass.h</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #a61390;">@interface</span> myClass <span style="color: #002200;">:</span> <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/"><span style="color: #400080;">NSObject</span></a> <span style="color: #002200;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #a61390;">@public</span> <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span style="color: #400080;">NSString</span></a> <span style="color: #002200;">*</span>myPropertyVar;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #002200;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>myMethod;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #a61390;">@end</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Nel file .m abbiamo invece:</p>
<div class="igBar"><span id="lobjc-19"><a href="#" onclick="javascript:showCodeTxt('objc-19'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Objective-C:</span>
<div id="objc-19">
<div class="objc" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #11740a; font-style: italic;">// myClass.m</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #a61390;">@implementation</span> myClass</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> myMethod <span style="color: #002200;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #11740a; font-style: italic;">// todo</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #002200;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #a61390;">@end</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Objective-C gestisce le proprietà e i metodi in modo abbastanza differente da Actionscript. Ad esempio il metodo <code>myMethod</code> visto in precedenza viene chiamato (o invocato) in questo modo:</p>
<div class="igBar"><span id="lobjc-20"><a href="#" onclick="javascript:showCodeTxt('objc-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Objective-C:</span>
<div id="objc-20">
<div class="objc" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #002200;">&#91;</span>self myMethod<span style="color: #002200;">&#93;</span>;</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Si parla, infatti, di Sending Message, più che di chiamata ad un metodo!</p>
<blockquote><p><strong>Nota</strong>: questa caratteristica è reale. Quando si invoca un metodo in Objective-C non si chiama un indirizzo fisico o puntatore a funzione. In Objective-C si spedisce effettivamente all'oggetto un vero e proprio messaggio dove gli si chiede di eseguire un particolare "metodo"</p>
</blockquote>
<p>La sintassi con le parentesi quadre, forse la cosa più difficile da digerire anche per gli sviluppatori ANSI C, risulta più chiara e semplice se consideriamo che:</p>
<div class="igBar"><span id="lobjc-21"><a href="#" onclick="javascript:showCodeTxt('objc-21'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Objective-C:</span>
<div id="objc-21">
<div class="objc" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">myClass.myMethod<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #11740a; font-style: italic;">// è uguale a</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #002200;">&#91;</span>myClass myMethod<span style="color: #002200;">&#93;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #11740a; font-style: italic;">// oppure</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">myClass.myPropertyVar <span style="color: #002200;">=</span> <span style="color: #2400d9;color:#800000;">1978</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #11740a; font-style: italic;">// uguale a</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #002200;">&#91;</span>myClass setMyPropertyVar<span style="color: #002200;">:</span>1978<span style="color: #002200;">&#93;</span>;</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Per quanto riguarda la creazione di oggetti, quindi la creazione di una instanza di una classe, abbiamo:</p>
<div class="igBar"><span id="lactionscript3-22"><a href="#" onclick="javascript:showCodeTxt('actionscript3-22'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-22">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> istanceMyClass<span style="color: #000066; font-weight: bold;">:</span>MyClass = <span style="color: #0033ff; font-weight: bold;">new</span> MyClass<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="lobjc-23"><a href="#" onclick="javascript:showCodeTxt('objc-23'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Objective-C:</span>
<div id="objc-23">
<div class="objc" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">MyClass <span style="color: #002200;">*</span>istanceMyClass <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>MyClass alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #11740a; font-style: italic;">// o più semplicemente</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">MyClass <span style="color: #002200;">*</span>istanceMyClass <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>MyClass alloc<span style="color: #002200;">&#93;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #11740a; font-style: italic;">// Objective-C non supporta in realtà un unico costruttore, come</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #11740a; font-style: italic;">// avviene invece in Actionscript: vedi ad esempio initWithName,</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #11740a; font-style: italic;">// initWithFrame o semplicemente init</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Tutto questo è solo un semplice aiuto, che lascia inesplorate moltissime altre funzionalità dell'Objective-C; ci sono concetti come i puntatori (simili ai riferimenti in Actionscript - ma non uguali), i protocolli, le categorie e molto altro ancora. Se siete proprio sconfortati nell'affrontare Objective-C, come ho già consigliato altre volte, <a target="_blank" href="http://books.google.it/books?id=QR_FfKzNHPMC&#038;pg=PT1&#038;lpg=PT1&#038;dq=compra+kernigan+e+ritch+C&#038;source=bl&#038;ots=-p2gIo3xDI&#038;sig=1NZFB2QAKEpC8T8HFFpuYwh3lHc&#038;hl=it&#038;ei=isojSoamIIaU_Qa-7pzDBg&#038;sa=X&#038;oi=book_result&#038;ct=result&#038;resnum=5#PPP1,M1">partite dall'ANSI C</a>, lasciate stare - per adesso - Actionscript, Javascript o PHP! Quest'ultimi, conoscendo bene l'ANSI C, li riscoprirete sotto una luce davvero differente.</p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F12%2Fda-actionscript-ad-objective-c%2F&amp;title=Da%20Actionscript%20ad%20Objective-C&amp;bodytext=Ho%20pensato%20che%20potrebbe%20essere%20utile%20a%20chi%20si%20%C3%A8%20avvicinato%20da%20poco%20allo%20sviluppo%20di%20applicazioni%20per%20Apple%20iPhone%2C%20confrontare%20Adobe%20Actionscript%20-%20il%20linguaggio%20utilizzato%20in%20Adobe%20Flash%20e%20Adobe%20Flex%2C%20pi%C3%B9%20diffuso%20tra%20i%20neo-programmatori%20-%20e%20Object" title="Digg"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F12%2Fda-actionscript-ad-objective-c%2F&amp;title=Da%20Actionscript%20ad%20Objective-C&amp;notes=Ho%20pensato%20che%20potrebbe%20essere%20utile%20a%20chi%20si%20%C3%A8%20avvicinato%20da%20poco%20allo%20sviluppo%20di%20applicazioni%20per%20Apple%20iPhone%2C%20confrontare%20Adobe%20Actionscript%20-%20il%20linguaggio%20utilizzato%20in%20Adobe%20Flash%20e%20Adobe%20Flex%2C%20pi%C3%B9%20diffuso%20tra%20i%20neo-programmatori%20-%20e%20Object" title="del.icio.us"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F12%2Fda-actionscript-ad-objective-c%2F" title="Technorati"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F12%2Fda-actionscript-ad-objective-c%2F&amp;t=Da%20Actionscript%20ad%20Objective-C" title="Facebook"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F12%2Fda-actionscript-ad-objective-c%2F&amp;title=Da%20Actionscript%20ad%20Objective-C&amp;annotation=Ho%20pensato%20che%20potrebbe%20essere%20utile%20a%20chi%20si%20%C3%A8%20avvicinato%20da%20poco%20allo%20sviluppo%20di%20applicazioni%20per%20Apple%20iPhone%2C%20confrontare%20Adobe%20Actionscript%20-%20il%20linguaggio%20utilizzato%20in%20Adobe%20Flash%20e%20Adobe%20Flex%2C%20pi%C3%B9%20diffuso%20tra%20i%20neo-programmatori%20-%20e%20Object" title="Google Bookmarks"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Da%20Actionscript%20ad%20Objective-C%20-%20http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F12%2Fda-actionscript-ad-objective-c%2F" title="Twitter"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://barrapunto.com/submit.pl?subj=Da%20Actionscript%20ad%20Objective-C&amp;story=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F12%2Fda-actionscript-ad-objective-c%2F" title="BarraPunto"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/barrapunto.png" title="BarraPunto" alt="BarraPunto" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://current.com/clipper.htm?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F12%2Fda-actionscript-ad-objective-c%2F&amp;title=Da%20Actionscript%20ad%20Objective-C" title="Current"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Da%20Actionscript%20ad%20Objective-C&amp;body=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F12%2Fda-actionscript-ad-objective-c%2F" title="email"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Da%20Actionscript%20ad%20Objective-C&amp;link=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F12%2Fda-actionscript-ad-objective-c%2F" title="FriendFeed"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F12%2Fda-actionscript-ad-objective-c%2F&amp;headline=Da%20Actionscript%20ad%20Objective-C&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F12%2Fda-actionscript-ad-objective-c%2F&amp;title=Da%20Actionscript%20ad%20Objective-C&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Ho%20pensato%20che%20potrebbe%20essere%20utile%20a%20chi%20si%20%C3%A8%20avvicinato%20da%20poco%20allo%20sviluppo%20di%20applicazioni%20per%20Apple%20iPhone%2C%20confrontare%20Adobe%20Actionscript%20-%20il%20linguaggio%20utilizzato%20in%20Adobe%20Flash%20e%20Adobe%20Flex%2C%20pi%C3%B9%20diffuso%20tra%20i%20neo-programmatori%20-%20e%20Object" title="LinkedIn"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F12%2Fda-actionscript-ad-objective-c%2F&amp;title=Da%20Actionscript%20ad%20Objective-C" title="Live"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F12%2Fda-actionscript-ad-objective-c%2F&amp;t=Da%20Actionscript%20ad%20Objective-C" title="MySpace"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Da%20Actionscript%20ad%20Objective-C&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F12%2Fda-actionscript-ad-objective-c%2F" title="Netvibes"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F12%2Fda-actionscript-ad-objective-c%2F&amp;partner=sociable" title="Print"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.undolog.com/feed/" title="RSS"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://segnalo.alice.it/post.html.php?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F12%2Fda-actionscript-ad-objective-c%2F&amp;title=Da%20Actionscript%20ad%20Objective-C" title="Segnalo"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/segnalo.png" title="Segnalo" alt="Segnalo" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F12%2Fda-actionscript-ad-objective-c%2F&amp;title=Da%20Actionscript%20ad%20Objective-C" title="StumbleUpon"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.it/vote?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F12%2Fda-actionscript-ad-objective-c%2F" title="Wikio IT"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio IT" alt="Wikio IT" class="sociable-hovers" /></a>


<br/><br/>
	Tags: <a href="http://www.undolog.com/category/sviluppo/flash/actionscript/" title="ActionScript" rel="tag">ActionScript</a>, <a href="http://www.undolog.com/tag/actionscript/" title="ActionScript" rel="tag">ActionScript</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/ansi-c/" title="ANSI-C" rel="tag">ANSI-C</a>, <a href="http://www.undolog.com/tag/apple/" title="Apple" rel="tag">Apple</a>, <a href="http://www.undolog.com/tag/c/" title="c" rel="tag">c</a>, <a href="http://www.undolog.com/tag/cc/" title="C/C++" rel="tag">C/C++</a>, <a href="http://www.undolog.com/category/sviluppo/flash/" title="Flash" rel="tag">Flash</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/tag/iphone/" title="iPhone" rel="tag">iPhone</a>, <a href="http://www.undolog.com/category/sviluppo/iphone-sviluppo/" title="iPhone" rel="tag">iPhone</a>, <a href="http://www.undolog.com/category/mobile/" title="Mobile" rel="tag">Mobile</a>, <a href="http://www.undolog.com/tag/object-oriented/" title="Object-Oriented" rel="tag">Object-Oriented</a>, <a href="http://www.undolog.com/tag/objective-c/" title="Objective-C" rel="tag">Objective-C</a>, <a href="http://www.undolog.com/category/sviluppo/iphone-sviluppo/objective-c-sviluppo/" title="Objective-C" rel="tag">Objective-C</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/category/tecnologia/" title="Tecnologia" rel="tag">Tecnologia</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2009/06/01/hi-phone/" title="Hi phone (1 giugno, 2009)">Hi phone</a> (7)</li>
	<li><a href="http://www.undolog.com/2008/03/05/linguaggi-di-sviluppo/" title="Linguaggi di sviluppo (5 marzo, 2008)">Linguaggi di sviluppo</a> (0)</li>
	<li><a href="http://www.undolog.com/2009/07/10/xcode-organizzare-il-codice-con-la-direttiva-pragma-mark/" title="XCode: organizzare il codice con la direttiva #pragma mark (10 luglio, 2009)">XCode: organizzare il codice con la direttiva #pragma mark</a> (0)</li>
	<li><a href="http://www.undolog.com/2009/07/23/xcode-shortcut/" title="Xcode shortcut (23 luglio, 2009)">Xcode shortcut</a> (0)</li>
	<li><a href="http://www.undolog.com/2009/06/16/very-short-trick-fermare-nstimer/" title="Very short trick: fermare NSTimer (16 giugno, 2009)">Very short trick: fermare NSTimer</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2009/06/12/da-actionscript-ad-objective-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Very short snippet: estendere un array Actionscript con il metodo shuffle()</title>
		<link>http://www.undolog.com/2009/04/02/very-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle/</link>
		<comments>http://www.undolog.com/2009/04/02/very-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 13:40:06 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Codice]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Math.floor()]]></category>
		<category><![CDATA[Math.random()]]></category>
		<category><![CDATA[Matrix]]></category>
		<category><![CDATA[MatrixArray]]></category>
		<category><![CDATA[mescolare]]></category>
		<category><![CDATA[parseInt()]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Prototype]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[shuffle()]]></category>
		<category><![CDATA[Snipp]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=1512</guid>
		<description><![CDATA[Avevo parlato già di come realizzare il metodo shuffle() in Javascript e Actionscript. Mi sono accorto, tuttaavia, di non aver sottolineato che anche Actionscript è in grado di estendere, nel medesimo modo di Javascript, il proprio oggetto Array:
PLAIN TEXT
Actionscript:




Array.prototype.shuffle = function&#40;&#41; &#123;


&#160; &#160; for&#40;var j:uint, x:*, i:uint = this.length; i; j = Math.floor&#40;Math.random&#40;&#41; * i&#41;, [...]]]></description>
			<content:encoded><![CDATA[<p>Avevo parlato già di <a href="http://www.undolog.com/2009/02/16/very-short-snippet-shuffle-in-javascript-e-actionscript/">come realizzare il metodo shuffle() in Javascript e Actionscript</a>. Mi sono accorto, tuttaavia, di non aver sottolineato che anche Actionscript è in grado di estendere, nel medesimo modo di Javascript, il proprio oggetto <code>Array</code>:</p>
<div class="igBar"><span id="lactionscript3-27"><a href="#" onclick="javascript:showCodeTxt('actionscript3-27'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-27">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><a href="http://www.google.com/search?q=array%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:array.html"><span style="color: #004993;">Array</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">prototype</span><span style="color: #000066; font-weight: bold;">.</span>shuffle = <span style="color: #339966; font-weight: bold;">function</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> j<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=uint%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:uint.html"><span style="color: #004993;">uint</span></a><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">:*,</span> i<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=uint%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:uint.html"><span style="color: #004993;">uint</span></a> = <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span><span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">;</span> j = <a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">floor</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">*</span> i<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">x</span> = <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#91;</span><span style="color: #000066; font-weight: bold;">--</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span> = <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span> = <span style="color: #004993;">x</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Questo codice può essere inserito anche all'interno di una classe, ad esempio nel costruttore:</p>
<div class="igBar"><span id="lactionscript3-28"><a href="#" onclick="javascript:showCodeTxt('actionscript3-28'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-28">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Hello <span style="color: #0033ff; font-weight: bold;">extends</span> <a href="http://www.google.com/search?q=movieclip%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:movieclip.html"><span style="color: #004993;">MovieClip</span></a> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Hello<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=array%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:array.html"><span style="color: #004993;">Array</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">prototype</span><span style="color: #000066; font-weight: bold;">.</span>shuffle = <span style="color: #339966; font-weight: bold;">function</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> j<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=uint%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:uint.html"><span style="color: #004993;">uint</span></a><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">:*,</span> i<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=uint%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:uint.html"><span style="color: #004993;">uint</span></a> = <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span><span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">;</span> j = <a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">floor</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">*</span> i<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">x</span> = <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#91;</span><span style="color: #000066; font-weight: bold;">--</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span> = <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span> = <span style="color: #004993;">x</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Per usare poi tale "estensione" è sufficiente chiamare il meotodo <code>shuffle()</code> da qualsiasi istanza di un <code>array</code>:</p>
<div class="igBar"><span id="lactionscript3-29"><a href="#" onclick="javascript:showCodeTxt('actionscript3-29'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-29">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> a<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=array%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:array.html"><span style="color: #004993;">Array</span></a> = <span style="color: #000000;">&#91;</span><span style="color: #990000;">&quot;ciao&quot;</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #990000;">&quot;come&quot;</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #990000;">&quot;va&quot;</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">a<span style="color: #000066; font-weight: bold;">.</span>shuffle<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F02%2Fvery-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle%2F&amp;title=Very%20short%20snippet%3A%20estendere%20un%20array%20Actionscript%20con%20il%20metodo%20shuffle%28%29&amp;bodytext=Avevo%20parlato%20gi%C3%A0%20di%20come%20realizzare%20il%20metodo%20shuffle%28%29%20in%20Javascript%20e%20Actionscript.%20Mi%20sono%20accorto%2C%20tuttaavia%2C%20di%20non%20aver%20sottolineato%20che%20anche%20Actionscript%20%C3%A8%20in%20grado%20di%20estendere%2C%20nel%20medesimo%20modo%20di%20Javascript%2C%20il%20proprio%20oggetto%20Array%3A%0D%0A" title="Digg"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F02%2Fvery-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle%2F&amp;title=Very%20short%20snippet%3A%20estendere%20un%20array%20Actionscript%20con%20il%20metodo%20shuffle%28%29&amp;notes=Avevo%20parlato%20gi%C3%A0%20di%20come%20realizzare%20il%20metodo%20shuffle%28%29%20in%20Javascript%20e%20Actionscript.%20Mi%20sono%20accorto%2C%20tuttaavia%2C%20di%20non%20aver%20sottolineato%20che%20anche%20Actionscript%20%C3%A8%20in%20grado%20di%20estendere%2C%20nel%20medesimo%20modo%20di%20Javascript%2C%20il%20proprio%20oggetto%20Array%3A%0D%0A" title="del.icio.us"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F02%2Fvery-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle%2F" title="Technorati"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F02%2Fvery-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle%2F&amp;t=Very%20short%20snippet%3A%20estendere%20un%20array%20Actionscript%20con%20il%20metodo%20shuffle%28%29" title="Facebook"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F02%2Fvery-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle%2F&amp;title=Very%20short%20snippet%3A%20estendere%20un%20array%20Actionscript%20con%20il%20metodo%20shuffle%28%29&amp;annotation=Avevo%20parlato%20gi%C3%A0%20di%20come%20realizzare%20il%20metodo%20shuffle%28%29%20in%20Javascript%20e%20Actionscript.%20Mi%20sono%20accorto%2C%20tuttaavia%2C%20di%20non%20aver%20sottolineato%20che%20anche%20Actionscript%20%C3%A8%20in%20grado%20di%20estendere%2C%20nel%20medesimo%20modo%20di%20Javascript%2C%20il%20proprio%20oggetto%20Array%3A%0D%0A" title="Google Bookmarks"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Very%20short%20snippet%3A%20estendere%20un%20array%20Actionscript%20con%20il%20metodo%20shuffle%28%29%20-%20http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F02%2Fvery-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle%2F" title="Twitter"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://barrapunto.com/submit.pl?subj=Very%20short%20snippet%3A%20estendere%20un%20array%20Actionscript%20con%20il%20metodo%20shuffle%28%29&amp;story=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F02%2Fvery-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle%2F" title="BarraPunto"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/barrapunto.png" title="BarraPunto" alt="BarraPunto" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://current.com/clipper.htm?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F02%2Fvery-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle%2F&amp;title=Very%20short%20snippet%3A%20estendere%20un%20array%20Actionscript%20con%20il%20metodo%20shuffle%28%29" title="Current"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Very%20short%20snippet%3A%20estendere%20un%20array%20Actionscript%20con%20il%20metodo%20shuffle%28%29&amp;body=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F02%2Fvery-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle%2F" title="email"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Very%20short%20snippet%3A%20estendere%20un%20array%20Actionscript%20con%20il%20metodo%20shuffle%28%29&amp;link=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F02%2Fvery-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle%2F" title="FriendFeed"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F02%2Fvery-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle%2F&amp;headline=Very%20short%20snippet%3A%20estendere%20un%20array%20Actionscript%20con%20il%20metodo%20shuffle%28%29&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F02%2Fvery-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle%2F&amp;title=Very%20short%20snippet%3A%20estendere%20un%20array%20Actionscript%20con%20il%20metodo%20shuffle%28%29&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Avevo%20parlato%20gi%C3%A0%20di%20come%20realizzare%20il%20metodo%20shuffle%28%29%20in%20Javascript%20e%20Actionscript.%20Mi%20sono%20accorto%2C%20tuttaavia%2C%20di%20non%20aver%20sottolineato%20che%20anche%20Actionscript%20%C3%A8%20in%20grado%20di%20estendere%2C%20nel%20medesimo%20modo%20di%20Javascript%2C%20il%20proprio%20oggetto%20Array%3A%0D%0A" title="LinkedIn"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F02%2Fvery-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle%2F&amp;title=Very%20short%20snippet%3A%20estendere%20un%20array%20Actionscript%20con%20il%20metodo%20shuffle%28%29" title="Live"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F02%2Fvery-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle%2F&amp;t=Very%20short%20snippet%3A%20estendere%20un%20array%20Actionscript%20con%20il%20metodo%20shuffle%28%29" title="MySpace"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Very%20short%20snippet%3A%20estendere%20un%20array%20Actionscript%20con%20il%20metodo%20shuffle%28%29&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F02%2Fvery-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle%2F" title="Netvibes"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F02%2Fvery-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle%2F&amp;partner=sociable" title="Print"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.undolog.com/feed/" title="RSS"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://segnalo.alice.it/post.html.php?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F02%2Fvery-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle%2F&amp;title=Very%20short%20snippet%3A%20estendere%20un%20array%20Actionscript%20con%20il%20metodo%20shuffle%28%29" title="Segnalo"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/segnalo.png" title="Segnalo" alt="Segnalo" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F02%2Fvery-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle%2F&amp;title=Very%20short%20snippet%3A%20estendere%20un%20array%20Actionscript%20con%20il%20metodo%20shuffle%28%29" title="StumbleUpon"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.it/vote?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F02%2Fvery-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle%2F" title="Wikio IT"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio IT" alt="Wikio IT" class="sociable-hovers" /></a>


<br/><br/>
	Tags: <a href="http://www.undolog.com/category/sviluppo/flash/actionscript/" title="ActionScript" rel="tag">ActionScript</a>, <a href="http://www.undolog.com/tag/actionscript/" title="ActionScript" rel="tag">ActionScript</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/array/" title="Array" rel="tag">Array</a>, <a href="http://www.undolog.com/tag/as3/" title="AS3" rel="tag">AS3</a>, <a href="http://www.undolog.com/tag/codice/" title="Codice" rel="tag">Codice</a>, <a href="http://www.undolog.com/category/sviluppo/flash/" title="Flash" rel="tag">Flash</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/category/sviluppo/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/javascript/" title="Javascript" rel="tag">Javascript</a>, <a href="http://www.undolog.com/tag/mathfloor/" title="Math.floor()" rel="tag">Math.floor()</a>, <a href="http://www.undolog.com/tag/mathrandom/" title="Math.random()" rel="tag">Math.random()</a>, <a href="http://www.undolog.com/tag/matrix/" title="Matrix" rel="tag">Matrix</a>, <a href="http://www.undolog.com/tag/matrixarray/" title="MatrixArray" rel="tag">MatrixArray</a>, <a href="http://www.undolog.com/tag/mescolare/" title="mescolare" rel="tag">mescolare</a>, <a href="http://www.undolog.com/tag/parseint/" title="parseInt()" rel="tag">parseInt()</a>, <a href="http://www.undolog.com/tag/php/" title="PHP" rel="tag">PHP</a>, <a href="http://www.undolog.com/tag/prototype/" title="Prototype" rel="tag">Prototype</a>, <a href="http://www.undolog.com/tag/random/" title="Random" rel="tag">Random</a>, <a href="http://www.undolog.com/tag/shuffle/" title="shuffle()" rel="tag">shuffle()</a>, <a href="http://www.undolog.com/tag/snipp/" title="Snipp" rel="tag">Snipp</a>, <a href="http://www.undolog.com/tag/source/" title="Source" rel="tag">Source</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2009/02/16/very-short-snippet-shuffle-in-javascript-e-actionscript/" title="Very short snippet: shuffle() in Javascript e Actionscript (16 febbraio, 2009)">Very short snippet: shuffle() in Javascript e Actionscript</a> (3)</li>
	<li><a href="http://www.undolog.com/2008/04/26/snipplr-code-20-frammenti-snipp-di-codice-utile/" title="Snipplr code 2.0: frammenti (snipp) di codice utile (26 aprile, 2008)">Snipplr code 2.0: frammenti (snipp) di codice utile</a> (0)</li>
	<li><a href="http://www.undolog.com/2008/08/05/considerazioni-sullevoluzione-dei-linguaggi-di-svilluppo-as2-vs-as3/" title="Considerazioni sull&#8217;evoluzione dei linguaggi di svilluppo: AS2 vs AS3 (5 agosto, 2008)">Considerazioni sull&#8217;evoluzione dei linguaggi di svilluppo: AS2 vs AS3</a> (4)</li>
	<li><a href="http://www.undolog.com/2008/09/15/undolibrary-matrixarray-unestensione-della-classe-array/" title="Undolibrary MatrixArray: un&#8217;estensione della classe Array (15 settembre, 2008)">Undolibrary MatrixArray: un&#8217;estensione della classe Array</a> (0)</li>
	<li><a href="http://www.undolog.com/2008/10/03/wordpress-come-scrivere-un-reply-to-comment-usando-jquery/" title="Wordpress: come scrivere un reply to comment usando jQuery (3 ottobre, 2008)">Wordpress: come scrivere un reply to comment usando jQuery</a> (18)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2009/04/02/very-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Papervision 3D: mostrare il cursor hand sugli elementi 3D interattivi</title>
		<link>http://www.undolog.com/2009/03/15/papervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi/</link>
		<comments>http://www.undolog.com/2009/03/15/papervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 12:48:24 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Papervsion3D]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[addEventListener]]></category>
		<category><![CDATA[BasicView]]></category>
		<category><![CDATA[buttonMode]]></category>
		<category><![CDATA[cursor]]></category>
		<category><![CDATA[interactive]]></category>
		<category><![CDATA[InteractiveScene3DEvent]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[MouseEvent]]></category>
		<category><![CDATA[Papervision3D]]></category>
		<category><![CDATA[Plane]]></category>
		<category><![CDATA[useHandCursor]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=1459</guid>
		<description><![CDATA[Impostato un materiale in modalità interactive e agganciando un evento ad un piano:
PLAIN TEXT
Actionscript:




var mymaterial:BitmapAssetMaterial = new BitmapAssetMaterial&#40;&#34;foto1&#34;&#41;;


mymaterial.interactive &#160; &#160; &#160; &#160; &#160; &#160; = true;


var myplane:Plane &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;= new Plane&#40; my_material, 200, 100, 0, 0&#41;;


myplane.addEventListener&#40; InteractiveScene3DEvent.OBJECT_PRESS,


&#160; &#160; function&#40;e:InteractiveScene3DEvent&#41;:void &#123;


&#160; &#160; // todo


&#160; &#160; &#125;


&#41;;






è possibile attivare la [...]]]></description>
			<content:encoded><![CDATA[<p>Impostato un materiale in modalità <code>interactive</code> e agganciando un evento ad un piano:</p>
<div class="igBar"><span id="lactionscript3-32"><a href="#" onclick="javascript:showCodeTxt('actionscript3-32'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-32">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> mymaterial<span style="color: #000066; font-weight: bold;">:</span>BitmapAssetMaterial = <span style="color: #0033ff; font-weight: bold;">new</span> BitmapAssetMaterial<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;foto1&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">mymaterial<span style="color: #000066; font-weight: bold;">.</span>interactive &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> myplane<span style="color: #000066; font-weight: bold;">:</span>Plane &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= <span style="color: #0033ff; font-weight: bold;">new</span> Plane<span style="color: #000000;">&#40;</span> my_material<span style="color: #000066; font-weight: bold;">,</span> 200<span style="color: #000066; font-weight: bold;">,</span> 100<span style="color: #000066; font-weight: bold;">,</span> 0<span style="color: #000066; font-weight: bold;">,</span> 0<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">myplane<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> InteractiveScene3DEvent<span style="color: #000066; font-weight: bold;">.</span>OBJECT_PRESS<span style="color: #000066; font-weight: bold;">,</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #339966; font-weight: bold;">function</span><span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span>InteractiveScene3DEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// todo</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>è possibile attivare la visualizzazione della "manina" agendo sulla <code>BasicView</code> che lo contiene e lo "renderizza", e non sui singoli elementi tridimensianali:</p>
<div class="igBar"><span id="lactionscript3-33"><a href="#" onclick="javascript:showCodeTxt('actionscript3-33'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-33">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> bv<span style="color: #000066; font-weight: bold;">:</span>BasicView = <span style="color: #0033ff; font-weight: bold;">new</span> BasicView<span style="color: #000000;">&#40;</span><span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageWidth</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageHeight</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">bv<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">buttonMode</span> &nbsp; &nbsp;= <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">bv<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">useHandCursor</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F15%2Fpapervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi%2F&amp;title=Papervision%203D%3A%20mostrare%20il%20cursor%20hand%20sugli%20elementi%203D%20interattivi&amp;bodytext=Impostato%20un%20materiale%20in%20modalit%C3%A0%20interactive%20e%20agganciando%20un%20evento%20ad%20un%20piano%3A%0D%0A%5Bas%5D%0D%0Avar%20mymaterial%3ABitmapAssetMaterial%20%3D%20new%20BitmapAssetMaterial%28%22foto1%22%29%3B%0D%0Amymaterial.interactive%20%09%20%20%20%20%20%20%20%20%20%20%20%3D%20true%3B%0D%0Avar%20myplane%3APlane%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3D%20new%20P" title="Digg"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F15%2Fpapervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi%2F&amp;title=Papervision%203D%3A%20mostrare%20il%20cursor%20hand%20sugli%20elementi%203D%20interattivi&amp;notes=Impostato%20un%20materiale%20in%20modalit%C3%A0%20interactive%20e%20agganciando%20un%20evento%20ad%20un%20piano%3A%0D%0A%5Bas%5D%0D%0Avar%20mymaterial%3ABitmapAssetMaterial%20%3D%20new%20BitmapAssetMaterial%28%22foto1%22%29%3B%0D%0Amymaterial.interactive%20%09%20%20%20%20%20%20%20%20%20%20%20%3D%20true%3B%0D%0Avar%20myplane%3APlane%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3D%20new%20P" title="del.icio.us"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F15%2Fpapervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi%2F" title="Technorati"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F15%2Fpapervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi%2F&amp;t=Papervision%203D%3A%20mostrare%20il%20cursor%20hand%20sugli%20elementi%203D%20interattivi" title="Facebook"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F15%2Fpapervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi%2F&amp;title=Papervision%203D%3A%20mostrare%20il%20cursor%20hand%20sugli%20elementi%203D%20interattivi&amp;annotation=Impostato%20un%20materiale%20in%20modalit%C3%A0%20interactive%20e%20agganciando%20un%20evento%20ad%20un%20piano%3A%0D%0A%5Bas%5D%0D%0Avar%20mymaterial%3ABitmapAssetMaterial%20%3D%20new%20BitmapAssetMaterial%28%22foto1%22%29%3B%0D%0Amymaterial.interactive%20%09%20%20%20%20%20%20%20%20%20%20%20%3D%20true%3B%0D%0Avar%20myplane%3APlane%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3D%20new%20P" title="Google Bookmarks"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Papervision%203D%3A%20mostrare%20il%20cursor%20hand%20sugli%20elementi%203D%20interattivi%20-%20http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F15%2Fpapervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi%2F" title="Twitter"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://barrapunto.com/submit.pl?subj=Papervision%203D%3A%20mostrare%20il%20cursor%20hand%20sugli%20elementi%203D%20interattivi&amp;story=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F15%2Fpapervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi%2F" title="BarraPunto"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/barrapunto.png" title="BarraPunto" alt="BarraPunto" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://current.com/clipper.htm?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F15%2Fpapervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi%2F&amp;title=Papervision%203D%3A%20mostrare%20il%20cursor%20hand%20sugli%20elementi%203D%20interattivi" title="Current"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Papervision%203D%3A%20mostrare%20il%20cursor%20hand%20sugli%20elementi%203D%20interattivi&amp;body=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F15%2Fpapervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi%2F" title="email"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Papervision%203D%3A%20mostrare%20il%20cursor%20hand%20sugli%20elementi%203D%20interattivi&amp;link=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F15%2Fpapervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi%2F" title="FriendFeed"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F15%2Fpapervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi%2F&amp;headline=Papervision%203D%3A%20mostrare%20il%20cursor%20hand%20sugli%20elementi%203D%20interattivi&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F15%2Fpapervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi%2F&amp;title=Papervision%203D%3A%20mostrare%20il%20cursor%20hand%20sugli%20elementi%203D%20interattivi&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Impostato%20un%20materiale%20in%20modalit%C3%A0%20interactive%20e%20agganciando%20un%20evento%20ad%20un%20piano%3A%0D%0A%5Bas%5D%0D%0Avar%20mymaterial%3ABitmapAssetMaterial%20%3D%20new%20BitmapAssetMaterial%28%22foto1%22%29%3B%0D%0Amymaterial.interactive%20%09%20%20%20%20%20%20%20%20%20%20%20%3D%20true%3B%0D%0Avar%20myplane%3APlane%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3D%20new%20P" title="LinkedIn"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F15%2Fpapervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi%2F&amp;title=Papervision%203D%3A%20mostrare%20il%20cursor%20hand%20sugli%20elementi%203D%20interattivi" title="Live"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F15%2Fpapervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi%2F&amp;t=Papervision%203D%3A%20mostrare%20il%20cursor%20hand%20sugli%20elementi%203D%20interattivi" title="MySpace"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Papervision%203D%3A%20mostrare%20il%20cursor%20hand%20sugli%20elementi%203D%20interattivi&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F15%2Fpapervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi%2F" title="Netvibes"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F15%2Fpapervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi%2F&amp;partner=sociable" title="Print"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.undolog.com/feed/" title="RSS"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://segnalo.alice.it/post.html.php?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F15%2Fpapervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi%2F&amp;title=Papervision%203D%3A%20mostrare%20il%20cursor%20hand%20sugli%20elementi%203D%20interattivi" title="Segnalo"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/segnalo.png" title="Segnalo" alt="Segnalo" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F15%2Fpapervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi%2F&amp;title=Papervision%203D%3A%20mostrare%20il%20cursor%20hand%20sugli%20elementi%203D%20interattivi" title="StumbleUpon"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.it/vote?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F15%2Fpapervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi%2F" title="Wikio IT"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio IT" alt="Wikio IT" class="sociable-hovers" /></a>


<br/><br/>
	Tags: <a href="http://www.undolog.com/category/sviluppo/flash-cs3/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/addeventlistener/" title="addEventListener" rel="tag">addEventListener</a>, <a href="http://www.undolog.com/tag/basicview/" title="BasicView" rel="tag">BasicView</a>, <a href="http://www.undolog.com/tag/buttonmode/" title="buttonMode" rel="tag">buttonMode</a>, <a href="http://www.undolog.com/tag/cursor/" title="cursor" rel="tag">cursor</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/tag/interactive/" title="interactive" rel="tag">interactive</a>, <a href="http://www.undolog.com/tag/interactivescene3devent/" title="InteractiveScene3DEvent" rel="tag">InteractiveScene3DEvent</a>, <a href="http://www.undolog.com/category/sviluppo/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/mouse/" title="mouse" rel="tag">mouse</a>, <a href="http://www.undolog.com/tag/mouseevent/" title="MouseEvent" rel="tag">MouseEvent</a>, <a href="http://www.undolog.com/tag/papervision3d/" title="Papervision3D" rel="tag">Papervision3D</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/3d-flash-cs3-sviluppo/papervsion3d/" title="Papervsion3D" rel="tag">Papervsion3D</a>, <a href="http://www.undolog.com/tag/plane/" title="Plane" rel="tag">Plane</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/tag/usehandcursor/" title="useHandCursor" rel="tag">useHandCursor</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2009/01/06/very-short-trick-addeventlistener-as3-un-handler-piu-eventi/" title="Very short trick: addEventListener() AS3, un handler più eventi (6 gennaio, 2009)">Very short trick: addEventListener() AS3, un handler più eventi</a> (9)</li>
	<li><a href="http://www.undolog.com/2008/05/05/papervision3d-gestire-le-bitmap-come-in-five3d/" title="Papervision3D: gestire le Bitmap come in FIVe3D (5 maggio, 2008)">Papervision3D: gestire le Bitmap come in FIVe3D</a> (0)</li>
	<li><a href="http://www.undolog.com/2008/05/30/papervision3d-basicview/" title="Papervision3D: BasicView (30 maggio, 2008)">Papervision3D: BasicView</a> (0)</li>
	<li><a href="http://www.undolog.com/2007/12/19/flash-cs3-la-nuova-gestione-degli-eventi/" title="Flash CS3: la nuova gestione degli eventi (19 dicembre, 2007)">Flash CS3: la nuova gestione degli eventi</a> (1)</li>
	<li><a href="http://www.undolog.com/2008/11/18/adobe-air-e-le-api-di-feedburner-reloaded/" title="Adobe AIR e le API di Feedburner: reloaded (18 novembre, 2008)">Adobe AIR e le API di Feedburner: reloaded</a> (3)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2009/03/15/papervision-3d-mostrare-il-cursor-hand-sugli-elementi-3d-interattivi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Biglietto da visita in 3D con Papervision</title>
		<link>http://www.undolog.com/2009/03/05/biglietto-da-visita-in-3d-con-papervision/</link>
		<comments>http://www.undolog.com/2009/03/05/biglietto-da-visita-in-3d-con-papervision/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 21:15:50 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Case Study]]></category>
		<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Grafica & Design]]></category>
		<category><![CDATA[Papervsion3D]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Card]]></category>
		<category><![CDATA[Great White]]></category>
		<category><![CDATA[Papervision3D]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=1436</guid>
		<description><![CDATA[Ecco un modo originale di proporre e presentare il proprio biglietto da vista sul Web! Il sorgente qui.















	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	



	Tags: 3D, Actionscript 3.0, Card, Case Study, Flash CS3, Flash CS3, Grafica &#38; Design, Great White, Papervision3D, Papervsion3D, Sviluppo

	Post correlati
	
	PicLens in Flash con Papervision3D 2.0: parte II (14)
	Piclens in Flash con Papervision3D 2.0 (2)
	Papervision3D: BasicView (0)
	Installare Papervision3D 2.0 [...]]]></description>
			<content:encoded><![CDATA[<p>Ecco un modo originale di proporre e presentare il proprio biglietto da vista sul Web! Il <a target="_blank" href="http://code.google.com/p/undolibrary/source/browse/trunk/as3/card/">sorgente qui</a>.</p>
<div style="border-right: #666 1px solid; border-top: #666 1px solid; margin: 0px auto 12px; border-left: #666 1px solid; width: 640px; border-bottom: #666 1px solid">
<object width="640" height="400">
<param name="movie" value="/wp-content/uploads/2009/03/card.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#000000"></param>
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" width="640" height="400" src="/wp-content/uploads/2009/03/card.swf" quality="high" bgcolor="#000000" wmode="window" menu="false" allowFullScreen="true" ></embed>
</object>
</div>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F05%2Fbiglietto-da-visita-in-3d-con-papervision%2F&amp;title=Biglietto%20da%20visita%20in%203D%20con%20Papervision&amp;bodytext=Ecco%20un%20modo%20originale%20di%20proporre%20e%20presentare%20il%20proprio%20biglietto%20da%20vista%20sul%20Web%21%20Il%20sorgente%20qui.%0D%0A%5Bswf%5D%2Fwp-content%2Fuploads%2F2009%2F03%2Fcard.swf%2C640%2C400%5B%2Fswf%5D" title="Digg"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F05%2Fbiglietto-da-visita-in-3d-con-papervision%2F&amp;title=Biglietto%20da%20visita%20in%203D%20con%20Papervision&amp;notes=Ecco%20un%20modo%20originale%20di%20proporre%20e%20presentare%20il%20proprio%20biglietto%20da%20vista%20sul%20Web%21%20Il%20sorgente%20qui.%0D%0A%5Bswf%5D%2Fwp-content%2Fuploads%2F2009%2F03%2Fcard.swf%2C640%2C400%5B%2Fswf%5D" title="del.icio.us"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F05%2Fbiglietto-da-visita-in-3d-con-papervision%2F" title="Technorati"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F05%2Fbiglietto-da-visita-in-3d-con-papervision%2F&amp;t=Biglietto%20da%20visita%20in%203D%20con%20Papervision" title="Facebook"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F05%2Fbiglietto-da-visita-in-3d-con-papervision%2F&amp;title=Biglietto%20da%20visita%20in%203D%20con%20Papervision&amp;annotation=Ecco%20un%20modo%20originale%20di%20proporre%20e%20presentare%20il%20proprio%20biglietto%20da%20vista%20sul%20Web%21%20Il%20sorgente%20qui.%0D%0A%5Bswf%5D%2Fwp-content%2Fuploads%2F2009%2F03%2Fcard.swf%2C640%2C400%5B%2Fswf%5D" title="Google Bookmarks"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Biglietto%20da%20visita%20in%203D%20con%20Papervision%20-%20http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F05%2Fbiglietto-da-visita-in-3d-con-papervision%2F" title="Twitter"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://barrapunto.com/submit.pl?subj=Biglietto%20da%20visita%20in%203D%20con%20Papervision&amp;story=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F05%2Fbiglietto-da-visita-in-3d-con-papervision%2F" title="BarraPunto"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/barrapunto.png" title="BarraPunto" alt="BarraPunto" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://current.com/clipper.htm?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F05%2Fbiglietto-da-visita-in-3d-con-papervision%2F&amp;title=Biglietto%20da%20visita%20in%203D%20con%20Papervision" title="Current"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Biglietto%20da%20visita%20in%203D%20con%20Papervision&amp;body=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F05%2Fbiglietto-da-visita-in-3d-con-papervision%2F" title="email"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Biglietto%20da%20visita%20in%203D%20con%20Papervision&amp;link=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F05%2Fbiglietto-da-visita-in-3d-con-papervision%2F" title="FriendFeed"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F05%2Fbiglietto-da-visita-in-3d-con-papervision%2F&amp;headline=Biglietto%20da%20visita%20in%203D%20con%20Papervision&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F05%2Fbiglietto-da-visita-in-3d-con-papervision%2F&amp;title=Biglietto%20da%20visita%20in%203D%20con%20Papervision&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Ecco%20un%20modo%20originale%20di%20proporre%20e%20presentare%20il%20proprio%20biglietto%20da%20vista%20sul%20Web%21%20Il%20sorgente%20qui.%0D%0A%5Bswf%5D%2Fwp-content%2Fuploads%2F2009%2F03%2Fcard.swf%2C640%2C400%5B%2Fswf%5D" title="LinkedIn"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F05%2Fbiglietto-da-visita-in-3d-con-papervision%2F&amp;title=Biglietto%20da%20visita%20in%203D%20con%20Papervision" title="Live"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F05%2Fbiglietto-da-visita-in-3d-con-papervision%2F&amp;t=Biglietto%20da%20visita%20in%203D%20con%20Papervision" title="MySpace"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Biglietto%20da%20visita%20in%203D%20con%20Papervision&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F05%2Fbiglietto-da-visita-in-3d-con-papervision%2F" title="Netvibes"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F05%2Fbiglietto-da-visita-in-3d-con-papervision%2F&amp;partner=sociable" title="Print"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.undolog.com/feed/" title="RSS"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://segnalo.alice.it/post.html.php?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F05%2Fbiglietto-da-visita-in-3d-con-papervision%2F&amp;title=Biglietto%20da%20visita%20in%203D%20con%20Papervision" title="Segnalo"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/segnalo.png" title="Segnalo" alt="Segnalo" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F05%2Fbiglietto-da-visita-in-3d-con-papervision%2F&amp;title=Biglietto%20da%20visita%20in%203D%20con%20Papervision" title="StumbleUpon"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.it/vote?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F05%2Fbiglietto-da-visita-in-3d-con-papervision%2F" title="Wikio IT"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio IT" alt="Wikio IT" class="sociable-hovers" /></a>


<br/><br/>
	Tags: <a href="http://www.undolog.com/category/sviluppo/flash-cs3/3d-flash-cs3-sviluppo/" title="3D" rel="tag">3D</a>, <a href="http://www.undolog.com/tag/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/card/" title="Card" rel="tag">Card</a>, <a href="http://www.undolog.com/category/grafica-design/photoshop/case-study/" title="Case Study" rel="tag">Case Study</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/tag/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/category/grafica-design/" title="Grafica &amp; Design" rel="tag">Grafica &amp; Design</a>, <a href="http://www.undolog.com/tag/great-white/" title="Great White" rel="tag">Great White</a>, <a href="http://www.undolog.com/tag/papervision3d/" title="Papervision3D" rel="tag">Papervision3D</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/3d-flash-cs3-sviluppo/papervsion3d/" title="Papervsion3D" rel="tag">Papervsion3D</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2008/06/17/piclens-in-flash-con-papervision3d-20-parte-ii/" title="PicLens in Flash con Papervision3D 2.0: parte II (17 giugno, 2008)">PicLens in Flash con Papervision3D 2.0: parte II</a> (14)</li>
	<li><a href="http://www.undolog.com/2008/04/28/piclens-in-flash-con-papervision3d-20/" title="Piclens in Flash con Papervision3D 2.0 (28 aprile, 2008)">Piclens in Flash con Papervision3D 2.0</a> (2)</li>
	<li><a href="http://www.undolog.com/2008/05/30/papervision3d-basicview/" title="Papervision3D: BasicView (30 maggio, 2008)">Papervision3D: BasicView</a> (0)</li>
	<li><a href="http://www.undolog.com/2008/04/17/installare-papervision3d-20-great-white-tortoisesvn/" title="Installare Papervision3D 2.0 Great White: TortoiseSVN (17 aprile, 2008)">Installare Papervision3D 2.0 Great White: TortoiseSVN</a> (6)</li>
	<li><a href="http://www.undolog.com/2008/05/16/five3d-effetti-speciali-su-un-cubo-in-attesa-di-flash-10/" title="FIVe3D: effetti speciali su un cubo! In attesa di Flash 10 (16 maggio, 2008)">FIVe3D: effetti speciali su un cubo! In attesa di Flash 10</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2009/03/05/biglietto-da-visita-in-3d-con-papervision/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Very short snippet: shuffle() in Javascript e Actionscript</title>
		<link>http://www.undolog.com/2009/02/16/very-short-snippet-shuffle-in-javascript-e-actionscript/</link>
		<comments>http://www.undolog.com/2009/02/16/very-short-snippet-shuffle-in-javascript-e-actionscript/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 22:23:08 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Codice]]></category>
		<category><![CDATA[Math.floor()]]></category>
		<category><![CDATA[Math.random()]]></category>
		<category><![CDATA[Matrix]]></category>
		<category><![CDATA[MatrixArray]]></category>
		<category><![CDATA[mescolare]]></category>
		<category><![CDATA[parseInt()]]></category>
		<category><![CDATA[Prototype]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[shuffle()]]></category>
		<category><![CDATA[Snipp]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[Undolibrary]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=1371</guid>
		<description><![CDATA[In PHP esiste una comoda funzione chiamata shuffle() che permette di mescolare un array (vedi Very short trick: prendere elementi casuali da un array in PHP). Un'ottima versione per Javascript l'ho trovata qui. Qui sotto il codice leggermente rivisto:
PLAIN TEXT
JavaScript:




Array.prototype.shuffle = function&#40;&#41; &#123;


for&#40;var j, x, i = this.length; i; j = Math.floor&#40;Math.random&#40;&#41; * i&#41;, x [...]]]></description>
			<content:encoded><![CDATA[<p>In PHP esiste una comoda funzione chiamata <code>shuffle()</code> che permette di mescolare un array (vedi <em><a href="http://www.undolog.com/2009/01/27/very-short-trick-prendere-elementi-casuali-da-un-array-in-php/">Very short trick: prendere elementi casuali da un array in PHP</a></em>). Un'ottima versione per Javascript l'ho trovata <a target="_blank" href="http://jsfromhell.com/array/shuffle">qui</a>. Qui sotto il codice leggermente rivisto:</p>
<div class="igBar"><span id="ljavascript-36"><a href="#" onclick="javascript:showCodeTxt('javascript-36'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-36">
<div class="javascript" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Array.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">shuffle</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> j<span style="color: #339933;">,</span> x<span style="color: #339933;">,</span> i <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">;</span> j <span style="color: #339933;">=</span> Math.<span style="color: #660066;">floor</span><span style="color: #009900;">&#40;</span>Math.<span style="color: #660066;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> i<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> x <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#91;</span><span style="color: #339933;">--</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> x<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Rispetto <a target="_blank" href="http://jsfromhell.com/array/shuffle">all'originale</a> ho esteso l'oggetto <code>Array</code> e inserito <code>Math.floor()</code> al posto di <code>parseInt()</code>, in quanto da test effettuati è risultato estremamente più veloce, almeno sulla mia macchina e con FireFox 3.</p>
<p>In ActionScript 3.0 l'ho usata all'interno della classe <a target="_blank" href="http://code.google.com/p/undolibrary/source/browse/trunk/as3/undolibrary/utils/MatrixArray.as">MatrixArray</a>:</p>
<div class="igBar"><span id="lactionscript3-37"><a href="#" onclick="javascript:showCodeTxt('actionscript3-37'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-37">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">/**</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Mescola in modo casuale la matrice</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*/</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> shuffle<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// thanks to http://jsfromhell.com/array/shuffle</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> j<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">,</span> i = __len<span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">;</span> j = <a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">floor</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">*</span> __len<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">x</span> = <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#91;</span><span style="color: #000066; font-weight: bold;">--</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span> = <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span> = <span style="color: #004993;">x</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F16%2Fvery-short-snippet-shuffle-in-javascript-e-actionscript%2F&amp;title=Very%20short%20snippet%3A%20shuffle%28%29%20in%20Javascript%20e%20Actionscript&amp;bodytext=In%20PHP%20esiste%20una%20comoda%20funzione%20chiamata%20shuffle%28%29%20che%20permette%20di%20mescolare%20un%20array%20%28vedi%20Very%20short%20trick%3A%20prendere%20elementi%20casuali%20da%20un%20array%20in%20PHP%29.%20Un%27ottima%20versione%20per%20Javascript%20l%27ho%20trovata%20qui.%20Qui%20sotto%20il%20codice%20leggermente%20rivisto" title="Digg"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F16%2Fvery-short-snippet-shuffle-in-javascript-e-actionscript%2F&amp;title=Very%20short%20snippet%3A%20shuffle%28%29%20in%20Javascript%20e%20Actionscript&amp;notes=In%20PHP%20esiste%20una%20comoda%20funzione%20chiamata%20shuffle%28%29%20che%20permette%20di%20mescolare%20un%20array%20%28vedi%20Very%20short%20trick%3A%20prendere%20elementi%20casuali%20da%20un%20array%20in%20PHP%29.%20Un%27ottima%20versione%20per%20Javascript%20l%27ho%20trovata%20qui.%20Qui%20sotto%20il%20codice%20leggermente%20rivisto" title="del.icio.us"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F16%2Fvery-short-snippet-shuffle-in-javascript-e-actionscript%2F" title="Technorati"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F16%2Fvery-short-snippet-shuffle-in-javascript-e-actionscript%2F&amp;t=Very%20short%20snippet%3A%20shuffle%28%29%20in%20Javascript%20e%20Actionscript" title="Facebook"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F16%2Fvery-short-snippet-shuffle-in-javascript-e-actionscript%2F&amp;title=Very%20short%20snippet%3A%20shuffle%28%29%20in%20Javascript%20e%20Actionscript&amp;annotation=In%20PHP%20esiste%20una%20comoda%20funzione%20chiamata%20shuffle%28%29%20che%20permette%20di%20mescolare%20un%20array%20%28vedi%20Very%20short%20trick%3A%20prendere%20elementi%20casuali%20da%20un%20array%20in%20PHP%29.%20Un%27ottima%20versione%20per%20Javascript%20l%27ho%20trovata%20qui.%20Qui%20sotto%20il%20codice%20leggermente%20rivisto" title="Google Bookmarks"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Very%20short%20snippet%3A%20shuffle%28%29%20in%20Javascript%20e%20Actionscript%20-%20http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F16%2Fvery-short-snippet-shuffle-in-javascript-e-actionscript%2F" title="Twitter"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://barrapunto.com/submit.pl?subj=Very%20short%20snippet%3A%20shuffle%28%29%20in%20Javascript%20e%20Actionscript&amp;story=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F16%2Fvery-short-snippet-shuffle-in-javascript-e-actionscript%2F" title="BarraPunto"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/barrapunto.png" title="BarraPunto" alt="BarraPunto" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://current.com/clipper.htm?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F16%2Fvery-short-snippet-shuffle-in-javascript-e-actionscript%2F&amp;title=Very%20short%20snippet%3A%20shuffle%28%29%20in%20Javascript%20e%20Actionscript" title="Current"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Very%20short%20snippet%3A%20shuffle%28%29%20in%20Javascript%20e%20Actionscript&amp;body=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F16%2Fvery-short-snippet-shuffle-in-javascript-e-actionscript%2F" title="email"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Very%20short%20snippet%3A%20shuffle%28%29%20in%20Javascript%20e%20Actionscript&amp;link=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F16%2Fvery-short-snippet-shuffle-in-javascript-e-actionscript%2F" title="FriendFeed"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F16%2Fvery-short-snippet-shuffle-in-javascript-e-actionscript%2F&amp;headline=Very%20short%20snippet%3A%20shuffle%28%29%20in%20Javascript%20e%20Actionscript&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F16%2Fvery-short-snippet-shuffle-in-javascript-e-actionscript%2F&amp;title=Very%20short%20snippet%3A%20shuffle%28%29%20in%20Javascript%20e%20Actionscript&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=In%20PHP%20esiste%20una%20comoda%20funzione%20chiamata%20shuffle%28%29%20che%20permette%20di%20mescolare%20un%20array%20%28vedi%20Very%20short%20trick%3A%20prendere%20elementi%20casuali%20da%20un%20array%20in%20PHP%29.%20Un%27ottima%20versione%20per%20Javascript%20l%27ho%20trovata%20qui.%20Qui%20sotto%20il%20codice%20leggermente%20rivisto" title="LinkedIn"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F16%2Fvery-short-snippet-shuffle-in-javascript-e-actionscript%2F&amp;title=Very%20short%20snippet%3A%20shuffle%28%29%20in%20Javascript%20e%20Actionscript" title="Live"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F16%2Fvery-short-snippet-shuffle-in-javascript-e-actionscript%2F&amp;t=Very%20short%20snippet%3A%20shuffle%28%29%20in%20Javascript%20e%20Actionscript" title="MySpace"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Very%20short%20snippet%3A%20shuffle%28%29%20in%20Javascript%20e%20Actionscript&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F16%2Fvery-short-snippet-shuffle-in-javascript-e-actionscript%2F" title="Netvibes"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F16%2Fvery-short-snippet-shuffle-in-javascript-e-actionscript%2F&amp;partner=sociable" title="Print"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.undolog.com/feed/" title="RSS"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://segnalo.alice.it/post.html.php?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F16%2Fvery-short-snippet-shuffle-in-javascript-e-actionscript%2F&amp;title=Very%20short%20snippet%3A%20shuffle%28%29%20in%20Javascript%20e%20Actionscript" title="Segnalo"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/segnalo.png" title="Segnalo" alt="Segnalo" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F16%2Fvery-short-snippet-shuffle-in-javascript-e-actionscript%2F&amp;title=Very%20short%20snippet%3A%20shuffle%28%29%20in%20Javascript%20e%20Actionscript" title="StumbleUpon"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.it/vote?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F16%2Fvery-short-snippet-shuffle-in-javascript-e-actionscript%2F" title="Wikio IT"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio IT" alt="Wikio IT" class="sociable-hovers" /></a>


<br/><br/>
	Tags: <a href="http://www.undolog.com/category/sviluppo/flash/actionscript/" title="ActionScript" rel="tag">ActionScript</a>, <a href="http://www.undolog.com/tag/actionscript/" title="ActionScript" rel="tag">ActionScript</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/array/" title="Array" rel="tag">Array</a>, <a href="http://www.undolog.com/tag/as3/" title="AS3" rel="tag">AS3</a>, <a href="http://www.undolog.com/tag/codice/" title="Codice" rel="tag">Codice</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/category/sviluppo/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/category/sviluppo/internet/javascript/" title="Javascript" rel="tag">Javascript</a>, <a href="http://www.undolog.com/tag/javascript/" title="Javascript" rel="tag">Javascript</a>, <a href="http://www.undolog.com/tag/mathfloor/" title="Math.floor()" rel="tag">Math.floor()</a>, <a href="http://www.undolog.com/tag/mathrandom/" title="Math.random()" rel="tag">Math.random()</a>, <a href="http://www.undolog.com/tag/matrix/" title="Matrix" rel="tag">Matrix</a>, <a href="http://www.undolog.com/tag/matrixarray/" title="MatrixArray" rel="tag">MatrixArray</a>, <a href="http://www.undolog.com/tag/mescolare/" title="mescolare" rel="tag">mescolare</a>, <a href="http://www.undolog.com/tag/parseint/" title="parseInt()" rel="tag">parseInt()</a>, <a href="http://www.undolog.com/category/sviluppo/internet/php/" title="PHP" rel="tag">PHP</a>, <a href="http://www.undolog.com/tag/php/" title="PHP" rel="tag">PHP</a>, <a href="http://www.undolog.com/tag/prototype/" title="Prototype" rel="tag">Prototype</a>, <a href="http://www.undolog.com/tag/random/" title="Random" rel="tag">Random</a>, <a href="http://www.undolog.com/tag/shuffle/" title="shuffle()" rel="tag">shuffle()</a>, <a href="http://www.undolog.com/tag/snipp/" title="Snipp" rel="tag">Snipp</a>, <a href="http://www.undolog.com/tag/source/" title="Source" rel="tag">Source</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/tag/undolibrary/" title="Undolibrary" rel="tag">Undolibrary</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2009/04/02/very-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle/" title="Very short snippet: estendere un array Actionscript con il metodo shuffle() (2 aprile, 2009)">Very short snippet: estendere un array Actionscript con il metodo shuffle()</a> (2)</li>
	<li><a href="http://www.undolog.com/2008/09/15/undolibrary-matrixarray-unestensione-della-classe-array/" title="Undolibrary MatrixArray: un&#8217;estensione della classe Array (15 settembre, 2008)">Undolibrary MatrixArray: un&#8217;estensione della classe Array</a> (0)</li>
	<li><a href="http://www.undolog.com/2008/04/26/snipplr-code-20-frammenti-snipp-di-codice-utile/" title="Snipplr code 2.0: frammenti (snipp) di codice utile (26 aprile, 2008)">Snipplr code 2.0: frammenti (snipp) di codice utile</a> (0)</li>
	<li><a href="http://www.undolog.com/2008/08/05/considerazioni-sullevoluzione-dei-linguaggi-di-svilluppo-as2-vs-as3/" title="Considerazioni sull&#8217;evoluzione dei linguaggi di svilluppo: AS2 vs AS3 (5 agosto, 2008)">Considerazioni sull&#8217;evoluzione dei linguaggi di svilluppo: AS2 vs AS3</a> (4)</li>
	<li><a href="http://www.undolog.com/2008/10/03/wordpress-come-scrivere-un-reply-to-comment-usando-jquery/" title="Wordpress: come scrivere un reply to comment usando jQuery (3 ottobre, 2008)">Wordpress: come scrivere un reply to comment usando jQuery</a> (18)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2009/02/16/very-short-snippet-shuffle-in-javascript-e-actionscript/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Actionscript 3.0 for beginners: lesson #5</title>
		<link>http://www.undolog.com/2009/01/22/actionscript-30-for-beginners-lesson-5/</link>
		<comments>http://www.undolog.com/2009/01/22/actionscript-30-for-beginners-lesson-5/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 05:00:10 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[Const]]></category>
		<category><![CDATA[Corso]]></category>
		<category><![CDATA[costanti]]></category>
		<category><![CDATA[Lezione]]></category>
		<category><![CDATA[public]]></category>
		<category><![CDATA[static]]></category>
		<category><![CDATA[variabili]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=1221</guid>
		<description><![CDATA[Chi ha iniziato a sviluppare codice con linguaggi di scripting come Javascript o lo stesso Actionscript, potrebbe non conoscere affatto il concetto di tipo dato. Con alcuni linguaggi ad alto livello, infatti, si è abituati - nella migliore delle ipotesi - a dichiarare le variabili senza assegnargli un tipo dato specifico, senza contare quei linguaggi [...]]]></description>
			<content:encoded><![CDATA[<p>Chi ha iniziato a sviluppare codice con linguaggi di scripting come Javascript o lo stesso Actionscript, potrebbe non conoscere affatto il concetto di tipo dato. Con alcuni linguaggi ad alto livello, infatti, si è abituati - nella migliore delle ipotesi - a dichiarare le variabili senza assegnargli un tipo dato specifico, senza contare quei linguaggi che non richiedono nessuna dichiarazione (come ad esempio il <a title="PHP" href="http://www.php.net" target="_blank">PHP</a> – non nella versione <em>strict</em> 5). Chi viene dal C, al contrario, non saprebbe nemmeno come fare ad usare una variabile senza dichiararla in modo rigoroso.<br />Nell’esempio qui sotto vediamo la <strong>dichiarazione</strong> di due variabili senza specificare il <strong>tipo dato</strong> che conterranno:</p>
<div class="igBar"><span id="lactionscript3-43"><a href="#" onclick="javascript:showCodeTxt('actionscript3-43'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-43">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> mio_numero = <span style="color: #000000; font-weight:bold;color:#800000;">0</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> mia_stringa = <span style="color: #990000;">&quot;stringa di testo&quot;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
<span id="more-1221"></span></p>
<p>Lo stesso Actionscript, come annunciato, prevede la <strong>non dichiarazione</strong> dei tipi e delle variabili! Quest’ultimo comportamento va forzato eliminando la spunta nella casella “Modalità rigorosa” della finestra di Impostazioni Actionscript 3.0:</p>
<p class="center"><img title="Flash CS3" height="329" alt="Flash CS3" src="http://www.undolog.com/wp-content/uploads/2009/01/image.png" width="500" border="0"></p>
<p>Così facendo un codice come questo qui sotto non produrrà nessun errore:</p>
<div class="igBar"><span id="lactionscript3-44"><a href="#" onclick="javascript:showCodeTxt('actionscript3-44'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-44">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> mio_numero = <span style="color: #000000; font-weight:bold;color:#800000;">3</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">mio_nove = <span style="color: #000000; font-weight:bold;color:#800000;">9</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span> mio_nove <span style="color: #000066; font-weight: bold;">+</span> mio_numero <span style="color: #000066; font-weight: bold;">+</span> 5 <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Alla riga 2 la variabile <code>mio_nove</code> non solo non contiene il tipo, ma non è nemmeno stata dichiarata tramite la keyword <code>var</code>. Nonostante sia stata mantenuta la possibilità di dichiarare le variabili in questa modalità “blanda”, è estremamente più corretto, utile ed efficacie specificare il tipo dato associato alla nostra variabile:</p>
<div class="igBar"><span id="lactionscript3-45"><a href="#" onclick="javascript:showCodeTxt('actionscript3-45'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-45">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> mio_numero<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=uint%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:uint.html"><span style="color: #004993;">uint</span></a> = <span style="color: #000000; font-weight:bold;color:#800000;">0</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> mia_stringa<span style="color: #000066; font-weight: bold;">:</span>string = <span style="color: #990000;">&quot;stringa di testo&quot;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Questo è il modo corretto per dichiarare le variabili, utile per migliorare le performance e la solidità della nostra applicazione.</p>
<h4>Vantaggi nell’uso dei tipi</h4>
<p>C’era un tempo in cui un programmatore <em>doveva</em> risparmiare memoria a livello bit! Quando il codice aveva pochi Kilobyte a disposizione, usare 8 bit per mantenere i mesi dell’anno era davvero uno spreco immane. Con 4 bit, infatti, possiamo memorizzare 16 valori, dallo 0 (<code>0000</code>) al 15 (<code>1111</code>). Oggi, evidentemente, i tempi sono cambiati. Un personal computer dispone in media di qualche Giga di RAM (il mio ne ha 8!). Diventa quindi di uso comune non fare più attenzione al “consumo” di RAM e risorse.<br />Ad un esame più attento, poi, il problema del consumo maggiore di RAM non riguarda solo uno “spreco” fine a se stesso; una cattiva gestione dei tipi può rendere il codice più lento in quanto obbliga compilatore, interprete ed eseguibile finale a lavorare su tipi più “capienti” del necessario.</p>
<p>Actionscript 3.0 ha introdotto alcuni tipi dati nuovi che permettono di sviluppare applicazioni sicuramente più performanti grazie all’indicazione – preventiva – della tipologia di dato da trattare. Un esempio classico riguarda i cicli <code>for</code>. Partendo da questa tabella:</p>
<ul>
<li><code>Number</code>: (64 bit) da -9.007.199.254.740.992 a 9.007.199.254.740.992 (per gli interi)</li>
<li><code>int</code>: (32 bit) da -2.147.483.648 (-2<sup>31</sup>) a 2.147.483.647 (2<sup>31</sup> - 1)</li>
<li><code>uint</code>: (32 bit) da 0 a 4.294.967.295 (2<sup>32 </sup>- 1)</li>
</ul>
<p>Scrivere:</p>
<div class="igBar"><span id="lactionscript3-46"><a href="#" onclick="javascript:showCodeTxt('actionscript3-46'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-46">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span> <span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html"><span style="color: #004993;">Number</span></a> = <span style="color: #000000; font-weight:bold;color:#800000;">0</span><span style="color: #000066; font-weight: bold;">;</span> i <span style="color: #000066; font-weight: bold;">&lt;</span><span style="color: #000000; font-weight:bold;color:#800000;">100</span><span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;<span style="color: #009900; font-style: italic;">// ...</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>rappresenta palesemente uno “spreco di risorse”, molto meglio e sufficiente sarebbe:</p>
<div class="igBar"><span id="lactionscript3-47"><a href="#" onclick="javascript:showCodeTxt('actionscript3-47'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-47">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span> <span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=uint%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:uint.html"><span style="color: #004993;">uint</span></a> = <span style="color: #000000; font-weight:bold;color:#800000;">0</span><span style="color: #000066; font-weight: bold;">;</span> i <span style="color: #000066; font-weight: bold;">&lt;</span><span style="color: #000000; font-weight:bold;color:#800000;">100</span><span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;<span style="color: #009900; font-style: italic;">// ...</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>In linea generale sarebbe buona regola fare riferimento a questa tabella:</p>
<ul>
<li><code>Number</code>: qualsiasi valore numerico, con o senza decimali</li>
<li><code>int</code>: numero intero senza decimali</li>
<li><code>uint</code>: numero intero senza segno, vale a dire un numero intero non negativo</li>
</ul>
<p>Questo significa che se dobbiamo memorizzare valori interi, cioè non decimali, positivi, <code>uint</code> è il tipo dato perfetto! Se abbiamo necessità anche del "segno", cioè valori interi negativi, possiamo avvalerci di <code>int</code>. Nei casi di numeri molto molto grandi e con decimali, allora il tipo <code>Number</code> è l'unica soluzione a nostro disposizione.</p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F22%2Factionscript-30-for-beginners-lesson-5%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%235&amp;bodytext=Chi%20ha%20iniziato%20a%20sviluppare%20codice%20con%20linguaggi%20di%20scripting%20come%20Javascript%20o%20lo%20stesso%20Actionscript%2C%20potrebbe%20non%20conoscere%20affatto%20il%20concetto%20di%20tipo%20dato.%20Con%20alcuni%20linguaggi%20ad%20alto%20livello%2C%20infatti%2C%20si%20%C3%A8%20abituati%20-%20nella%20migliore%20delle%20ipo" title="Digg"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F22%2Factionscript-30-for-beginners-lesson-5%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%235&amp;notes=Chi%20ha%20iniziato%20a%20sviluppare%20codice%20con%20linguaggi%20di%20scripting%20come%20Javascript%20o%20lo%20stesso%20Actionscript%2C%20potrebbe%20non%20conoscere%20affatto%20il%20concetto%20di%20tipo%20dato.%20Con%20alcuni%20linguaggi%20ad%20alto%20livello%2C%20infatti%2C%20si%20%C3%A8%20abituati%20-%20nella%20migliore%20delle%20ipo" title="del.icio.us"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F22%2Factionscript-30-for-beginners-lesson-5%2F" title="Technorati"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F22%2Factionscript-30-for-beginners-lesson-5%2F&amp;t=Actionscript%203.0%20for%20beginners%3A%20lesson%20%235" title="Facebook"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F22%2Factionscript-30-for-beginners-lesson-5%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%235&amp;annotation=Chi%20ha%20iniziato%20a%20sviluppare%20codice%20con%20linguaggi%20di%20scripting%20come%20Javascript%20o%20lo%20stesso%20Actionscript%2C%20potrebbe%20non%20conoscere%20affatto%20il%20concetto%20di%20tipo%20dato.%20Con%20alcuni%20linguaggi%20ad%20alto%20livello%2C%20infatti%2C%20si%20%C3%A8%20abituati%20-%20nella%20migliore%20delle%20ipo" title="Google Bookmarks"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Actionscript%203.0%20for%20beginners%3A%20lesson%20%235%20-%20http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F22%2Factionscript-30-for-beginners-lesson-5%2F" title="Twitter"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://barrapunto.com/submit.pl?subj=Actionscript%203.0%20for%20beginners%3A%20lesson%20%235&amp;story=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F22%2Factionscript-30-for-beginners-lesson-5%2F" title="BarraPunto"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/barrapunto.png" title="BarraPunto" alt="BarraPunto" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://current.com/clipper.htm?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F22%2Factionscript-30-for-beginners-lesson-5%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%235" title="Current"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Actionscript%203.0%20for%20beginners%3A%20lesson%20%235&amp;body=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F22%2Factionscript-30-for-beginners-lesson-5%2F" title="email"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%235&amp;link=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F22%2Factionscript-30-for-beginners-lesson-5%2F" title="FriendFeed"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F22%2Factionscript-30-for-beginners-lesson-5%2F&amp;headline=Actionscript%203.0%20for%20beginners%3A%20lesson%20%235&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F22%2Factionscript-30-for-beginners-lesson-5%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%235&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Chi%20ha%20iniziato%20a%20sviluppare%20codice%20con%20linguaggi%20di%20scripting%20come%20Javascript%20o%20lo%20stesso%20Actionscript%2C%20potrebbe%20non%20conoscere%20affatto%20il%20concetto%20di%20tipo%20dato.%20Con%20alcuni%20linguaggi%20ad%20alto%20livello%2C%20infatti%2C%20si%20%C3%A8%20abituati%20-%20nella%20migliore%20delle%20ipo" title="LinkedIn"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F22%2Factionscript-30-for-beginners-lesson-5%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%235" title="Live"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F22%2Factionscript-30-for-beginners-lesson-5%2F&amp;t=Actionscript%203.0%20for%20beginners%3A%20lesson%20%235" title="MySpace"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%235&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F22%2Factionscript-30-for-beginners-lesson-5%2F" title="Netvibes"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F22%2Factionscript-30-for-beginners-lesson-5%2F&amp;partner=sociable" title="Print"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.undolog.com/feed/" title="RSS"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://segnalo.alice.it/post.html.php?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F22%2Factionscript-30-for-beginners-lesson-5%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%235" title="Segnalo"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/segnalo.png" title="Segnalo" alt="Segnalo" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F22%2Factionscript-30-for-beginners-lesson-5%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%235" title="StumbleUpon"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.it/vote?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F22%2Factionscript-30-for-beginners-lesson-5%2F" title="Wikio IT"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio IT" alt="Wikio IT" class="sociable-hovers" /></a>


<br/><br/>
	Tags: <a href="http://www.undolog.com/category/sviluppo/flash-cs3/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/class/" title="class" rel="tag">class</a>, <a href="http://www.undolog.com/tag/const/" title="Const" rel="tag">Const</a>, <a href="http://www.undolog.com/tag/corso/" title="Corso" rel="tag">Corso</a>, <a href="http://www.undolog.com/tag/costanti/" title="costanti" rel="tag">costanti</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/tag/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/category/sviluppo/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/lezione/" title="Lezione" rel="tag">Lezione</a>, <a href="http://www.undolog.com/tag/public/" title="public" rel="tag">public</a>, <a href="http://www.undolog.com/tag/static/" title="static" rel="tag">static</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/tag/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/category/tutorials/" title="Tutorials" rel="tag">Tutorials</a>, <a href="http://www.undolog.com/tag/tutorials/" title="Tutorials" rel="tag">Tutorials</a>, <a href="http://www.undolog.com/tag/variabili/" title="variabili" rel="tag">variabili</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2008/11/11/actionscript-30-for-beginners-lesson-4/" title="Actionscript 3.0 for beginners: lesson #4 (11 novembre, 2008)">Actionscript 3.0 for beginners: lesson #4</a> (3)</li>
	<li><a href="http://www.undolog.com/2008/09/28/actionscript-30-for-beginners-lesson-3/" title="Actionscript 3.0 for beginners: lesson #3 (28 settembre, 2008)">Actionscript 3.0 for beginners: lesson #3</a> (0)</li>
	<li><a href="http://www.undolog.com/2008/09/03/actionscript-30-for-beginners-lesson-2/" title="Actionscript 3.0 for beginners: lesson #2 (3 settembre, 2008)">Actionscript 3.0 for beginners: lesson #2</a> (4)</li>
	<li><a href="http://www.undolog.com/2008/08/08/actionscript-30-for-beginners-lesson-1/" title="Actionscript 3.0 for beginners: lesson #1 (8 agosto, 2008)">Actionscript 3.0 for beginners: lesson #1</a> (9)</li>
	<li><a href="http://www.undolog.com/2008/06/04/flash-cs3-creare-un-effetto-reflex-su-qualsiasi-movieclip/" title="Flash CS3: creare un effetto Reflex su qualsiasi MovieClip (4 giugno, 2008)">Flash CS3: creare un effetto Reflex su qualsiasi MovieClip</a> (12)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2009/01/22/actionscript-30-for-beginners-lesson-5/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Very short trick: ADDED_TO_STAGE</title>
		<link>http://www.undolog.com/2009/01/08/very-short-trick-added_to_stage/</link>
		<comments>http://www.undolog.com/2009/01/08/very-short-trick-added_to_stage/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 09:34:42 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[ADDED_TO_STAGE]]></category>
		<category><![CDATA[addEventListener]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[costruttore]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[MovieClip]]></category>
		<category><![CDATA[removeEventListener]]></category>
		<category><![CDATA[Stage]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=1137</guid>
		<description><![CDATA[Come abbiamo visto più volte, nel costruttore di una classe che estende un MovieClip può essere necessario aggiungere l'evento ADDED_TO_STAGE per capire quando il nostro MovieClip è disegnato effettivamente sulla stage:
PLAIN TEXT
Actionscript:




// costruttore


public function MyClass&#40;&#41;:void &#123;


&#160; &#160; addEventListener&#40; Event.ADDED_TO_STAGE, main &#41;;


&#125;






Sarebbe buona norma eliminare tale evento all'interno della funzione main():
PLAIN TEXT
Actionscript:




// costruttore


public function MyClass&#40;&#41;:void &#123;


&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Come abbiamo <a href="http://www.undolog.com/2007/12/19/flash-cs3-la-nuova-gestione-degli-eventi/">visto</a> più volte, nel costruttore di una classe che estende un <code>MovieClip</code> può essere necessario aggiungere l'evento <code>ADDED_TO_STAGE</code> per capire quando il nostro <code>MovieClip</code> è disegnato effettivamente sulla stage:</p>
<div class="igBar"><span id="lactionscript3-50"><a href="#" onclick="javascript:showCodeTxt('actionscript3-50'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-50">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">// costruttore</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> MyClass<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> <a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ADDED_TO_STAGE</span><span style="color: #000066; font-weight: bold;">,</span> main <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Sarebbe buona norma eliminare tale evento all'interno della funzione <code>main()</code>:</p>
<div class="igBar"><span id="lactionscript3-51"><a href="#" onclick="javascript:showCodeTxt('actionscript3-51'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-51">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">// costruttore</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> MyClass<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> <a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ADDED_TO_STAGE</span><span style="color: #000066; font-weight: bold;">,</span> main <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">//</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> main<span style="color: #000000;">&#40;</span> e<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a> = <span style="color: #0033ff; font-weight: bold;">null</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span> <a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ADDED_TO_STAGE</span><span style="color: #000066; font-weight: bold;">,</span> main <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// ...</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F08%2Fvery-short-trick-added_to_stage%2F&amp;title=Very%20short%20trick%3A%20ADDED_TO_STAGE%20&amp;bodytext=Come%20abbiamo%20visto%20pi%C3%B9%20volte%2C%20nel%20costruttore%20di%20una%20classe%20che%20estende%20un%20MovieClip%20pu%C3%B2%20essere%20necessario%20aggiungere%20l%27evento%20ADDED_TO_STAGE%20per%20capire%20quando%20il%20nostro%20MovieClip%20%C3%A8%20disegnato%20effettivamente%20sulla%20stage%3A%0D%0A%5Bas%5D%0D%0A%2F%2F%20costruttore%0D%0Apubl" title="Digg"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F08%2Fvery-short-trick-added_to_stage%2F&amp;title=Very%20short%20trick%3A%20ADDED_TO_STAGE%20&amp;notes=Come%20abbiamo%20visto%20pi%C3%B9%20volte%2C%20nel%20costruttore%20di%20una%20classe%20che%20estende%20un%20MovieClip%20pu%C3%B2%20essere%20necessario%20aggiungere%20l%27evento%20ADDED_TO_STAGE%20per%20capire%20quando%20il%20nostro%20MovieClip%20%C3%A8%20disegnato%20effettivamente%20sulla%20stage%3A%0D%0A%5Bas%5D%0D%0A%2F%2F%20costruttore%0D%0Apubl" title="del.icio.us"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F08%2Fvery-short-trick-added_to_stage%2F" title="Technorati"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F08%2Fvery-short-trick-added_to_stage%2F&amp;t=Very%20short%20trick%3A%20ADDED_TO_STAGE%20" title="Facebook"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F08%2Fvery-short-trick-added_to_stage%2F&amp;title=Very%20short%20trick%3A%20ADDED_TO_STAGE%20&amp;annotation=Come%20abbiamo%20visto%20pi%C3%B9%20volte%2C%20nel%20costruttore%20di%20una%20classe%20che%20estende%20un%20MovieClip%20pu%C3%B2%20essere%20necessario%20aggiungere%20l%27evento%20ADDED_TO_STAGE%20per%20capire%20quando%20il%20nostro%20MovieClip%20%C3%A8%20disegnato%20effettivamente%20sulla%20stage%3A%0D%0A%5Bas%5D%0D%0A%2F%2F%20costruttore%0D%0Apubl" title="Google Bookmarks"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Very%20short%20trick%3A%20ADDED_TO_STAGE%20%20-%20http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F08%2Fvery-short-trick-added_to_stage%2F" title="Twitter"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://barrapunto.com/submit.pl?subj=Very%20short%20trick%3A%20ADDED_TO_STAGE%20&amp;story=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F08%2Fvery-short-trick-added_to_stage%2F" title="BarraPunto"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/barrapunto.png" title="BarraPunto" alt="BarraPunto" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://current.com/clipper.htm?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F08%2Fvery-short-trick-added_to_stage%2F&amp;title=Very%20short%20trick%3A%20ADDED_TO_STAGE%20" title="Current"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Very%20short%20trick%3A%20ADDED_TO_STAGE%20&amp;body=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F08%2Fvery-short-trick-added_to_stage%2F" title="email"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Very%20short%20trick%3A%20ADDED_TO_STAGE%20&amp;link=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F08%2Fvery-short-trick-added_to_stage%2F" title="FriendFeed"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F08%2Fvery-short-trick-added_to_stage%2F&amp;headline=Very%20short%20trick%3A%20ADDED_TO_STAGE%20&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F08%2Fvery-short-trick-added_to_stage%2F&amp;title=Very%20short%20trick%3A%20ADDED_TO_STAGE%20&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Come%20abbiamo%20visto%20pi%C3%B9%20volte%2C%20nel%20costruttore%20di%20una%20classe%20che%20estende%20un%20MovieClip%20pu%C3%B2%20essere%20necessario%20aggiungere%20l%27evento%20ADDED_TO_STAGE%20per%20capire%20quando%20il%20nostro%20MovieClip%20%C3%A8%20disegnato%20effettivamente%20sulla%20stage%3A%0D%0A%5Bas%5D%0D%0A%2F%2F%20costruttore%0D%0Apubl" title="LinkedIn"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F08%2Fvery-short-trick-added_to_stage%2F&amp;title=Very%20short%20trick%3A%20ADDED_TO_STAGE%20" title="Live"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F08%2Fvery-short-trick-added_to_stage%2F&amp;t=Very%20short%20trick%3A%20ADDED_TO_STAGE%20" title="MySpace"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Very%20short%20trick%3A%20ADDED_TO_STAGE%20&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F08%2Fvery-short-trick-added_to_stage%2F" title="Netvibes"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F08%2Fvery-short-trick-added_to_stage%2F&amp;partner=sociable" title="Print"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.undolog.com/feed/" title="RSS"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://segnalo.alice.it/post.html.php?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F08%2Fvery-short-trick-added_to_stage%2F&amp;title=Very%20short%20trick%3A%20ADDED_TO_STAGE%20" title="Segnalo"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/segnalo.png" title="Segnalo" alt="Segnalo" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F08%2Fvery-short-trick-added_to_stage%2F&amp;title=Very%20short%20trick%3A%20ADDED_TO_STAGE%20" title="StumbleUpon"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.it/vote?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F08%2Fvery-short-trick-added_to_stage%2F" title="Wikio IT"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio IT" alt="Wikio IT" class="sociable-hovers" /></a>


<br/><br/>
	Tags: <a href="http://www.undolog.com/category/sviluppo/flash-cs3/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/added_to_stage/" title="ADDED_TO_STAGE" rel="tag">ADDED_TO_STAGE</a>, <a href="http://www.undolog.com/tag/addeventlistener/" title="addEventListener" rel="tag">addEventListener</a>, <a href="http://www.undolog.com/tag/class/" title="class" rel="tag">class</a>, <a href="http://www.undolog.com/tag/costruttore/" title="costruttore" rel="tag">costruttore</a>, <a href="http://www.undolog.com/tag/event/" title="Event" rel="tag">Event</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/category/sviluppo/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/movieclip/" title="MovieClip" rel="tag">MovieClip</a>, <a href="http://www.undolog.com/tag/removeeventlistener/" title="removeEventListener" rel="tag">removeEventListener</a>, <a href="http://www.undolog.com/tag/stage/" title="Stage" rel="tag">Stage</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/tag/trick/" title="trick" rel="tag">trick</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2008/11/10/very-short-trick-versatilita-delle-classi-css/" title="Very short trick: versatilità delle classi CSS (10 novembre, 2008)">Very short trick: versatilità delle classi CSS</a> (3)</li>
	<li><a href="http://www.undolog.com/2009/01/06/very-short-trick-addeventlistener-as3-un-handler-piu-eventi/" title="Very short trick: addEventListener() AS3, un handler più eventi (6 gennaio, 2009)">Very short trick: addEventListener() AS3, un handler più eventi</a> (9)</li>
	<li><a href="http://www.undolog.com/2007/10/19/scrivere-buon-codice-oo-in-adobe-flash/" title="Scrivere buon codice OO in Adobe Flash (19 ottobre, 2007)">Scrivere buon codice OO in Adobe Flash</a> (1)</li>
	<li><a href="http://www.undolog.com/2008/01/28/la-nuova-gestione-degli-eventi-di-flash-cs3/" title="La nuova gestione degli eventi di Flash CS3 (28 gennaio, 2008)">La nuova gestione degli eventi di Flash CS3</a> (1)</li>
	<li><a href="http://www.undolog.com/2007/11/06/flash-come-inizializzare-componenti-nel-costruttore-di-una-classe/" title="Flash: come inizializzare componenti nel costruttore di una classe (6 novembre, 2007)">Flash: come inizializzare componenti nel costruttore di una classe</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2009/01/08/very-short-trick-added_to_stage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Very short trick: addEventListener() AS3, un handler più eventi</title>
		<link>http://www.undolog.com/2009/01/06/very-short-trick-addeventlistener-as3-un-handler-piu-eventi/</link>
		<comments>http://www.undolog.com/2009/01/06/very-short-trick-addeventlistener-as3-un-handler-piu-eventi/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 23:32:22 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[addEventListener]]></category>
		<category><![CDATA[eventi]]></category>
		<category><![CDATA[MouseEvent]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=1118</guid>
		<description><![CDATA[In Actionscript 3.0 è necessario utilizzare addEventListener() per intercettare un qualsiasi evento:
PLAIN TEXT
Actionscript:




/**


&#160;* Dato un MovieClip mc, si impostano eventi e handler


&#160;*/


mc.addEventListener&#40; MouseEvent.CLICK, on_click &#41;;


mc.addEventListener&#40; MouseEvent.ROLL_OVER, on_roll_over &#41;;


mc.addEventListener&#40; MouseEvent.ROLL_OUT, on_roll_out &#41;;


/**


&#160;* Funzioni di hander per gli eventi sopra indicati


&#160;*/


function on_click&#40; e:MouseEvent &#41;:void &#123;


&#160; &#160; // click


&#125;


function on_roll_over&#40; e:MouseEvent &#41;:void &#123;


&#160; &#160; // roll over


&#125;


function on_roll_out&#40; [...]]]></description>
			<content:encoded><![CDATA[<p>In Actionscript 3.0 è necessario utilizzare <code>addEventListener()</code> per intercettare un qualsiasi evento:</p>
<div class="igBar"><span id="lactionscript3-54"><a href="#" onclick="javascript:showCodeTxt('actionscript3-54'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-54">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">/**</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Dato un MovieClip mc, si impostano eventi e handler</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*/</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">mc<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> <a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CLICK</span><span style="color: #000066; font-weight: bold;">,</span> on_click <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">mc<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> <a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ROLL_OVER</span><span style="color: #000066; font-weight: bold;">,</span> on_roll_over <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">mc<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> <a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ROLL_OUT</span><span style="color: #000066; font-weight: bold;">,</span> on_roll_out <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">/**</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Funzioni di hander per gli eventi sopra indicati</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*/</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339966; font-weight: bold;">function</span> on_click<span style="color: #000000;">&#40;</span> e<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// click</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339966; font-weight: bold;">function</span> on_roll_over<span style="color: #000000;">&#40;</span> e<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// roll over</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339966; font-weight: bold;">function</span> on_roll_out<span style="color: #000000;">&#40;</span> e<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// roll out</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>In alternativa è possibile usare la forma:</p>
<div class="igBar"><span id="lactionscript3-55"><a href="#" onclick="javascript:showCodeTxt('actionscript3-55'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-55">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">mc<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> <a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CLICK</span><span style="color: #000066; font-weight: bold;">,</span> on_handler <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">mc<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> <a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ROLL_OVER</span><span style="color: #000066; font-weight: bold;">,</span> on_handler <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">mc<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> <a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ROLL_OUT</span><span style="color: #000066; font-weight: bold;">,</span> on_handler <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">/**</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Creo un'unica funzione per gestire tutti gli eventi</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*/</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339966; font-weight: bold;">function</span> on_handler <span style="color: #000000;">&#40;</span> e<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">switch</span><span style="color: #000000;">&#40;</span> e<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">type</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> <a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CLICK</span><span style="color: #000066; font-weight: bold;">:</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900; font-style: italic;">// click</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> <a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ROLL_OVER</span><span style="color: #000066; font-weight: bold;">:</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900; font-style: italic;">// roll over</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> <a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ROLL_OUT</span><span style="color: #000066; font-weight: bold;">:</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900; font-style: italic;">// roll out</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F06%2Fvery-short-trick-addeventlistener-as3-un-handler-piu-eventi%2F&amp;title=Very%20short%20trick%3A%20addEventListener%28%29%20AS3%2C%20un%20handler%20pi%C3%B9%20eventi&amp;bodytext=In%20Actionscript%203.0%20%C3%A8%20necessario%20utilizzare%20addEventListener%28%29%20per%20intercettare%20un%20qualsiasi%20evento%3A%0D%0A%5Bas%5D%0D%0A%2F%2A%2A%0D%0A%20%2A%20Dato%20un%20MovieClip%20mc%2C%20si%20impostano%20eventi%20e%20handler%0D%0A%20%2A%2F%0D%0Amc.addEventListener%28%20MouseEvent.CLICK%2C%20on_click%20%29%3B%0D%0Amc.addEventListener%28%20Mo" title="Digg"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F06%2Fvery-short-trick-addeventlistener-as3-un-handler-piu-eventi%2F&amp;title=Very%20short%20trick%3A%20addEventListener%28%29%20AS3%2C%20un%20handler%20pi%C3%B9%20eventi&amp;notes=In%20Actionscript%203.0%20%C3%A8%20necessario%20utilizzare%20addEventListener%28%29%20per%20intercettare%20un%20qualsiasi%20evento%3A%0D%0A%5Bas%5D%0D%0A%2F%2A%2A%0D%0A%20%2A%20Dato%20un%20MovieClip%20mc%2C%20si%20impostano%20eventi%20e%20handler%0D%0A%20%2A%2F%0D%0Amc.addEventListener%28%20MouseEvent.CLICK%2C%20on_click%20%29%3B%0D%0Amc.addEventListener%28%20Mo" title="del.icio.us"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F06%2Fvery-short-trick-addeventlistener-as3-un-handler-piu-eventi%2F" title="Technorati"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F06%2Fvery-short-trick-addeventlistener-as3-un-handler-piu-eventi%2F&amp;t=Very%20short%20trick%3A%20addEventListener%28%29%20AS3%2C%20un%20handler%20pi%C3%B9%20eventi" title="Facebook"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F06%2Fvery-short-trick-addeventlistener-as3-un-handler-piu-eventi%2F&amp;title=Very%20short%20trick%3A%20addEventListener%28%29%20AS3%2C%20un%20handler%20pi%C3%B9%20eventi&amp;annotation=In%20Actionscript%203.0%20%C3%A8%20necessario%20utilizzare%20addEventListener%28%29%20per%20intercettare%20un%20qualsiasi%20evento%3A%0D%0A%5Bas%5D%0D%0A%2F%2A%2A%0D%0A%20%2A%20Dato%20un%20MovieClip%20mc%2C%20si%20impostano%20eventi%20e%20handler%0D%0A%20%2A%2F%0D%0Amc.addEventListener%28%20MouseEvent.CLICK%2C%20on_click%20%29%3B%0D%0Amc.addEventListener%28%20Mo" title="Google Bookmarks"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Very%20short%20trick%3A%20addEventListener%28%29%20AS3%2C%20un%20handler%20pi%C3%B9%20eventi%20-%20http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F06%2Fvery-short-trick-addeventlistener-as3-un-handler-piu-eventi%2F" title="Twitter"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://barrapunto.com/submit.pl?subj=Very%20short%20trick%3A%20addEventListener%28%29%20AS3%2C%20un%20handler%20pi%C3%B9%20eventi&amp;story=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F06%2Fvery-short-trick-addeventlistener-as3-un-handler-piu-eventi%2F" title="BarraPunto"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/barrapunto.png" title="BarraPunto" alt="BarraPunto" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://current.com/clipper.htm?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F06%2Fvery-short-trick-addeventlistener-as3-un-handler-piu-eventi%2F&amp;title=Very%20short%20trick%3A%20addEventListener%28%29%20AS3%2C%20un%20handler%20pi%C3%B9%20eventi" title="Current"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Very%20short%20trick%3A%20addEventListener%28%29%20AS3%2C%20un%20handler%20pi%C3%B9%20eventi&amp;body=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F06%2Fvery-short-trick-addeventlistener-as3-un-handler-piu-eventi%2F" title="email"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Very%20short%20trick%3A%20addEventListener%28%29%20AS3%2C%20un%20handler%20pi%C3%B9%20eventi&amp;link=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F06%2Fvery-short-trick-addeventlistener-as3-un-handler-piu-eventi%2F" title="FriendFeed"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F06%2Fvery-short-trick-addeventlistener-as3-un-handler-piu-eventi%2F&amp;headline=Very%20short%20trick%3A%20addEventListener%28%29%20AS3%2C%20un%20handler%20pi%C3%B9%20eventi&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F06%2Fvery-short-trick-addeventlistener-as3-un-handler-piu-eventi%2F&amp;title=Very%20short%20trick%3A%20addEventListener%28%29%20AS3%2C%20un%20handler%20pi%C3%B9%20eventi&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=In%20Actionscript%203.0%20%C3%A8%20necessario%20utilizzare%20addEventListener%28%29%20per%20intercettare%20un%20qualsiasi%20evento%3A%0D%0A%5Bas%5D%0D%0A%2F%2A%2A%0D%0A%20%2A%20Dato%20un%20MovieClip%20mc%2C%20si%20impostano%20eventi%20e%20handler%0D%0A%20%2A%2F%0D%0Amc.addEventListener%28%20MouseEvent.CLICK%2C%20on_click%20%29%3B%0D%0Amc.addEventListener%28%20Mo" title="LinkedIn"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F06%2Fvery-short-trick-addeventlistener-as3-un-handler-piu-eventi%2F&amp;title=Very%20short%20trick%3A%20addEventListener%28%29%20AS3%2C%20un%20handler%20pi%C3%B9%20eventi" title="Live"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F06%2Fvery-short-trick-addeventlistener-as3-un-handler-piu-eventi%2F&amp;t=Very%20short%20trick%3A%20addEventListener%28%29%20AS3%2C%20un%20handler%20pi%C3%B9%20eventi" title="MySpace"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Very%20short%20trick%3A%20addEventListener%28%29%20AS3%2C%20un%20handler%20pi%C3%B9%20eventi&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F06%2Fvery-short-trick-addeventlistener-as3-un-handler-piu-eventi%2F" title="Netvibes"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F06%2Fvery-short-trick-addeventlistener-as3-un-handler-piu-eventi%2F&amp;partner=sociable" title="Print"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.undolog.com/feed/" title="RSS"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://segnalo.alice.it/post.html.php?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F06%2Fvery-short-trick-addeventlistener-as3-un-handler-piu-eventi%2F&amp;title=Very%20short%20trick%3A%20addEventListener%28%29%20AS3%2C%20un%20handler%20pi%C3%B9%20eventi" title="Segnalo"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/segnalo.png" title="Segnalo" alt="Segnalo" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F06%2Fvery-short-trick-addeventlistener-as3-un-handler-piu-eventi%2F&amp;title=Very%20short%20trick%3A%20addEventListener%28%29%20AS3%2C%20un%20handler%20pi%C3%B9%20eventi" title="StumbleUpon"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.it/vote?url=http%3A%2F%2Fwww.undolog.com%2F2009%2F01%2F06%2Fvery-short-trick-addeventlistener-as3-un-handler-piu-eventi%2F" title="Wikio IT"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio IT" alt="Wikio IT" class="sociable-hovers" /></a>


<br/><br/>
	Tags: <a href="http://www.undolog.com/tag/actionscript/" title="ActionScript" rel="tag">ActionScript</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/addeventlistener/" title="addEventListener" rel="tag">addEventListener</a>, <a href="http://www.undolog.com/tag/eventi/" title="eventi" rel="tag">eventi</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/category/sviluppo/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/mouseevent/" title="MouseEvent" rel="tag">MouseEvent</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/tag/trick/" title="trick" rel="tag">trick</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2008/10/15/very-short-trick-cicli-for-piu-rapidi-in-actionscript/" title="Very short trick: cicli for più rapidi in Actionscript (15 ottobre, 2008)">Very short trick: cicli for più rapidi in Actionscript</a> (0)</li>
	<li><a href="http://www.undolog.com/2007/07/25/gestione-degli-eventi-similitudini-tra-flash-e-javascript/" title="Gestione degli eventi: similitudini tra Flash e Javascript (25 luglio, 2007)">Gestione degli eventi: similitudini tra Flash e Javascript</a> (3)</li>
	<li><a href="http://www.undolog.com/2009/01/08/very-short-trick-added_to_stage/" title="Very short trick: ADDED_TO_STAGE (8 gennaio, 2009)">Very short trick: ADDED_TO_STAGE</a> (0)</li>
	<li><a href="http://www.undolog.com/2009/02/16/very-short-snippet-shuffle-in-javascript-e-actionscript/" title="Very short snippet: shuffle() in Javascript e Actionscript (16 febbraio, 2009)">Very short snippet: shuffle() in Javascript e Actionscript</a> (3)</li>
	<li><a href="http://www.undolog.com/2009/04/02/very-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle/" title="Very short snippet: estendere un array Actionscript con il metodo shuffle() (2 aprile, 2009)">Very short snippet: estendere un array Actionscript con il metodo shuffle()</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2009/01/06/very-short-trick-addeventlistener-as3-un-handler-piu-eventi/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Wordpress Plugin: Flash Feed Scroll Reader</title>
		<link>http://www.undolog.com/2008/12/22/wordpress-plugin-flash-feed-scroll-reader/</link>
		<comments>http://www.undolog.com/2008/12/22/wordpress-plugin-flash-feed-scroll-reader/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 21:03:38 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[librerie]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[SimplePie]]></category>
		<category><![CDATA[undolog]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=1090</guid>
		<description><![CDATA[Aggrega e scrolla i feed che vuoi sul tuo blog]]></description>
			<content:encoded><![CDATA[<p>Prendendo spunto dal post <em><a href="http://www.undolog.com/2008/12/15/creare-un-semplice-feed-reader-con-simplepie-e-jquery/">Creare un semplice Feed Reader con SimplePie e jQuery</a></em> ho creato il primo Plugin Wordpress targato <a target="_blank" href="http://www.saidmade.com">Saidmade</a>. <a target="_blank" href="http://labs.saidmade.com/wordpress/wordpress-plugin-flash-feed-scroll-reader/">Flash Feed Scroll Reader</a> utilizza <a target="_blank" href="http://simplepie.org/downloads/">SimplePie</a> per creare un <a href="http://www.undolog.com/2008/12/22/very-short-trick-proxy-rss-con-simplepie/">proxy PHP</a> per accedere ai diversi indirizzi feed. Per l'effetto di scroll ho scelto Flash per una questione di performance! Nonostante sia possibile generare lo stesso effetto anche con librerie Javascript come <a target="_blank"  href="http://jquery.com">jQuery</a>, la fluidità offerta da Flash è sicuramente superiore, consentendo di non rallentare eccessivamente il sistema. Inoltre il Plugin sfrutta la libreiria <a href="http://www.undolog.com/2008/11/14/swfobject-su-google-ajax-libraries-api/">SWFObject</a> per inserire il filmato Flash nel blog. In questa release è possibile impostare il comportamento dello scroller direttamente dal pannello di controllo. Nelle prossime versioni sarà possibile passare ulteriori parametri alla funzione PHP in modo da aggiungere più scroller sulla stessa pagina.</p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F22%2Fwordpress-plugin-flash-feed-scroll-reader%2F&amp;title=Wordpress%20Plugin%3A%20Flash%20Feed%20Scroll%20Reader&amp;bodytext=Aggrega%20e%20scrolla%20i%20feed%20che%20vuoi%20sul%20tuo%20blog" title="Digg"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F22%2Fwordpress-plugin-flash-feed-scroll-reader%2F&amp;title=Wordpress%20Plugin%3A%20Flash%20Feed%20Scroll%20Reader&amp;notes=Aggrega%20e%20scrolla%20i%20feed%20che%20vuoi%20sul%20tuo%20blog" title="del.icio.us"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F22%2Fwordpress-plugin-flash-feed-scroll-reader%2F" title="Technorati"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F22%2Fwordpress-plugin-flash-feed-scroll-reader%2F&amp;t=Wordpress%20Plugin%3A%20Flash%20Feed%20Scroll%20Reader" title="Facebook"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F22%2Fwordpress-plugin-flash-feed-scroll-reader%2F&amp;title=Wordpress%20Plugin%3A%20Flash%20Feed%20Scroll%20Reader&amp;annotation=Aggrega%20e%20scrolla%20i%20feed%20che%20vuoi%20sul%20tuo%20blog" title="Google Bookmarks"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Wordpress%20Plugin%3A%20Flash%20Feed%20Scroll%20Reader%20-%20http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F22%2Fwordpress-plugin-flash-feed-scroll-reader%2F" title="Twitter"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://barrapunto.com/submit.pl?subj=Wordpress%20Plugin%3A%20Flash%20Feed%20Scroll%20Reader&amp;story=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F22%2Fwordpress-plugin-flash-feed-scroll-reader%2F" title="BarraPunto"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/barrapunto.png" title="BarraPunto" alt="BarraPunto" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://current.com/clipper.htm?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F22%2Fwordpress-plugin-flash-feed-scroll-reader%2F&amp;title=Wordpress%20Plugin%3A%20Flash%20Feed%20Scroll%20Reader" title="Current"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Wordpress%20Plugin%3A%20Flash%20Feed%20Scroll%20Reader&amp;body=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F22%2Fwordpress-plugin-flash-feed-scroll-reader%2F" title="email"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Wordpress%20Plugin%3A%20Flash%20Feed%20Scroll%20Reader&amp;link=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F22%2Fwordpress-plugin-flash-feed-scroll-reader%2F" title="FriendFeed"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F22%2Fwordpress-plugin-flash-feed-scroll-reader%2F&amp;headline=Wordpress%20Plugin%3A%20Flash%20Feed%20Scroll%20Reader&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F22%2Fwordpress-plugin-flash-feed-scroll-reader%2F&amp;title=Wordpress%20Plugin%3A%20Flash%20Feed%20Scroll%20Reader&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Aggrega%20e%20scrolla%20i%20feed%20che%20vuoi%20sul%20tuo%20blog" title="LinkedIn"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F22%2Fwordpress-plugin-flash-feed-scroll-reader%2F&amp;title=Wordpress%20Plugin%3A%20Flash%20Feed%20Scroll%20Reader" title="Live"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F22%2Fwordpress-plugin-flash-feed-scroll-reader%2F&amp;t=Wordpress%20Plugin%3A%20Flash%20Feed%20Scroll%20Reader" title="MySpace"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Wordpress%20Plugin%3A%20Flash%20Feed%20Scroll%20Reader&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F22%2Fwordpress-plugin-flash-feed-scroll-reader%2F" title="Netvibes"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F22%2Fwordpress-plugin-flash-feed-scroll-reader%2F&amp;partner=sociable" title="Print"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.undolog.com/feed/" title="RSS"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://segnalo.alice.it/post.html.php?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F22%2Fwordpress-plugin-flash-feed-scroll-reader%2F&amp;title=Wordpress%20Plugin%3A%20Flash%20Feed%20Scroll%20Reader" title="Segnalo"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/segnalo.png" title="Segnalo" alt="Segnalo" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F22%2Fwordpress-plugin-flash-feed-scroll-reader%2F&amp;title=Wordpress%20Plugin%3A%20Flash%20Feed%20Scroll%20Reader" title="StumbleUpon"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.it/vote?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F22%2Fwordpress-plugin-flash-feed-scroll-reader%2F" title="Wikio IT"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio IT" alt="Wikio IT" class="sociable-hovers" /></a>


<br/><br/>
	Tags: <a href="http://www.undolog.com/category/sviluppo/flash-cs3/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/download/" title="Download" rel="tag">Download</a>, <a href="http://www.undolog.com/category/featured/" title="Featured" rel="tag">Featured</a>, <a href="http://www.undolog.com/tag/feed/" title="feed" rel="tag">feed</a>, <a href="http://www.undolog.com/tag/flash/" title="Flash" rel="tag">Flash</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/category/sviluppo/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/jquery/" title="jQuery" rel="tag">jQuery</a>, <a href="http://www.undolog.com/tag/librerie/" title="librerie" rel="tag">librerie</a>, <a href="http://www.undolog.com/tag/performance/" title="Performance" rel="tag">Performance</a>, <a href="http://www.undolog.com/category/sviluppo/internet/php/" title="PHP" rel="tag">PHP</a>, <a href="http://www.undolog.com/tag/php/" title="PHP" rel="tag">PHP</a>, <a href="http://www.undolog.com/tag/plugin/" title="Plugin" rel="tag">Plugin</a>, <a href="http://www.undolog.com/tag/proxy/" title="proxy" rel="tag">proxy</a>, <a href="http://www.undolog.com/tag/rss/" title="rss" rel="tag">rss</a>, <a href="http://www.undolog.com/tag/simplepie/" title="SimplePie" rel="tag">SimplePie</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/tag/undolog/" title="undolog" rel="tag">undolog</a>, <a href="http://www.undolog.com/category/sviluppo/internet/wordpress/" title="WordPress" rel="tag">WordPress</a>, <a href="http://www.undolog.com/tag/wordpress/" title="WordPress" rel="tag">WordPress</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2008/12/22/very-short-trick-proxy-rss-con-simplepie/" title="Very short trick: proxy RSS con SimplePie (22 dicembre, 2008)">Very short trick: proxy RSS con SimplePie</a> (1)</li>
	<li><a href="http://www.undolog.com/2008/10/03/wordpress-come-scrivere-un-reply-to-comment-usando-jquery/" title="Wordpress: come scrivere un reply to comment usando jQuery (3 ottobre, 2008)">Wordpress: come scrivere un reply to comment usando jQuery</a> (18)</li>
	<li><a href="http://www.undolog.com/2007/09/17/nasce-n3tv-nettv-20/" title="Nasce N3TV: NetTV 2.0 (17 settembre, 2007)">Nasce N3TV: NetTV 2.0</a> (4)</li>
	<li><a href="http://www.undolog.com/2008/12/15/creare-un-semplice-feed-reader-con-simplepie-e-jquery/" title="Creare un semplice Feed Reader con SimplePie e jQuery (15 dicembre, 2008)">Creare un semplice Feed Reader con SimplePie e jQuery</a> (6)</li>
	<li><a href="http://www.undolog.com/2010/03/03/wp-bannerize-2-4-1/" title="WP Bannerize 2.4.1 (3 marzo, 2010)">WP Bannerize 2.4.1</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2008/12/22/wordpress-plugin-flash-feed-scroll-reader/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Adobe AIR e le API di Feedburner: reloaded</title>
		<link>http://www.undolog.com/2008/11/18/adobe-air-e-le-api-di-feedburner-reloaded/</link>
		<comments>http://www.undolog.com/2008/11/18/adobe-air-e-le-api-di-feedburner-reloaded/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 13:47:26 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ADDED_TO_STAGE]]></category>
		<category><![CDATA[addEventListener]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Adobe-AIR]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[catch]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Google Code]]></category>
		<category><![CDATA[MouseEvent]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[Tecnologia]]></category>
		<category><![CDATA[try]]></category>
		<category><![CDATA[URLLoader]]></category>
		<category><![CDATA[URLRequest]]></category>
		<category><![CDATA[URLVariables]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=968</guid>
		<description><![CDATA[Prendo spunto dall'ottimo tutorial di Napolux, Flex 3, Adobe AIR e le API di Feedburner, che mostra come scrivere una semplice applicazione (o widget) Adobe AIR usando Flex 3, per mostrare come realizzare la stessa identica cosa usando Adobe Flash CS3. Se lo desiderate, inoltre, potete sfruttare l'estensione per la creazione di applicazioni Adobe AIR. [...]]]></description>
			<content:encoded><![CDATA[<p>Prendo spunto dall'ottimo tutorial di <a href="http://www.napolux.com">Napolux</a>, <em><a href="http://www.napolux.com/2008/flex-3-adobe-air-feedburner.html">Flex 3, Adobe AIR e le API di Feedburner</a></em>, che mostra come scrivere una semplice applicazione (o widget) Adobe AIR usando Flex 3, per mostrare come realizzare la stessa identica cosa usando Adobe Flash CS3. Se lo desiderate, inoltre, potete sfruttare l'estensione per la creazione di applicazioni Adobe AIR. Non è infatti necessario, ai fini di questo tutorial, compilare l'applicazione come eseguibile AIR; potete usare il codice proposto come semplice filmato Flash da "apporre" alle vostre pagine Web.</p>
<h4>Flash vs Flex</h4>
<p>Nonostante apprezzi Adobe AIR come tecnologia e come è stato implementato nelle piattaforme HTML (Dreamweaver), Flash e Flex, non sono "ancora" del tutto ben disposto verso Flex! Non voglio certo mettere a confronto Flash con Flex, nonostante hanno molti punti in comune ma anche molte differenze. Tuttavia non ho assolutamente apprezzato la politica Adobe rispetto a questo <em>spinoff</em> a volte privo di senso. Avrei preferito, invece, la costituzione di un unico ambiente (Flax) di sviluppo e non questa "inutile" separazione. Inoltre, da buon programmatore, gli ambienti troppo "visuali" non mi piacciono granchè e Flex sembra proprio destinato a diventare pericolosamente simile a Visual Basic, che tra l'altro conosco molto bene e su cui ho lavorato per molti anni. Insomma, Flex sinceramente non l'ho capito e non ho capito cosa vuole fare Adobe con questo <em>branch</em>. Se Flex è indicato come l'ambiente ideale per scrivere RIA qual'è il destino di Flash? Tutte le features di Flex, effettivamente non disponibili "direttamente" in Flash, potrebbero - volendo - essere inserite senza costringere ad acquistare licenze multiple per sviluppare - alla fine - la stessa identica cosa.</p>
<p><span id="more-968"></span></p>
<h4>Differenze tra Flash e Flex</h4>
<p>La prima cosa che noterete nella versione Flash è la presenza di un po' più codice. Infatti Flex risolve alcune procedure sfruttando direttamente i "suoi" file MXML. A ben guardare, comunque, non c'è tanto più codice di quello che si potrebbe pensare. La procedura più corposa, che in Flex è "oscurata", è la connessione via REST alle API di Feedburner. Uno dei vantaggi nell'uso di un codice scritto in Flash è che lo stesso può funzionare immediatamente sia come applicativo AIR che come filmato Flash su una qualsiasi pagina Web! Sempre se non abbiamo utilizzato funzionalità specifiche di un amiente desktop. Inoltre, ed ecco un altro motivo per cui Flex non mi convince affatto, l'applicazione Adobe AIR creata con Flash risulta 5 volte inferiore a quella proposta da Napolux e compilata con Flex builder:</p>
<ul>
<li><a href="http://undolibrary.googlecode.com/svn/trunk/air/FeedBurner/FeedBurner.air">Feedburner.air</a> (Flash) 59,1 KB (60.576 byte)</li>
<li><a href="http://www.napolux.com/wp-content/uploads/2008/11/feedburner.air">Feedburner.air</a> (Flex) 316 KB (323.584 byte)</li>
</ul>
<blockquote><p><strong>Nota</strong>: ad onor del vero questo è imputabile a tutta una serie di componenti (come l'<code>mx.controls.Alert</code> ) che vengono inclusi in Flex e non nella mia versione Flash; in Actionscript 3.0, infatti, tutta una serie di funzionalità è stata eliminata: tutti i "pachetti" <code>mx</code> presenti in Actionscript 2.0 e migrati ora sotto Flex! Comunque mi riservo quanto prima di effettuare maggiori test al riguardo.</p>
</blockquote>
<h4>Il codice</h4>
<p>Deciso o meno di compilare il nostro filmato come applicazione Adobe AIR (cosa che potete fare in qualsiasi momento successivo), ecco la classe documento <a target="_blank" href="http://code.google.com/p/undolibrary/source/browse/trunk/air/FeedBurner/FeedBurner.as">Feedburner.as</a>: (<a target="_blank" href="http://code.google.com/p/undolibrary/source/browse/trunk/air/FeedBurner">tutti i codici sono disponibili su Google Code</a>)</p>
<div class="igBar"><span id="lactionscript3-57"><a href="#" onclick="javascript:showCodeTxt('actionscript3-57'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-57">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #3f5fbf;">/**</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp; &nbsp; &nbsp;* Class Document for FeedBurner Adobe AIR version</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp; &nbsp; &nbsp;* Original idea by Napolux.com (http://www.napolux.com/2008/flex-3-adobe-air-feedburner.html)</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp; &nbsp; &nbsp;*</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp; &nbsp; &nbsp;* @author &nbsp; &nbsp; &nbsp; &nbsp;Giovambattista Fazioli</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp; &nbsp; &nbsp;* @email &nbsp; &nbsp; &nbsp; &nbsp; g.fazioli@undolog.com</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp; &nbsp; &nbsp;* @web &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://www.undolog.com</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp; &nbsp; &nbsp;*</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp; &nbsp; &nbsp;* CHANGE LOG</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp; &nbsp; &nbsp;*</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp; &nbsp; &nbsp;* ver 0.8</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp; &nbsp; &nbsp;* &nbsp; &nbsp;- First Adobe AIR release</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp; &nbsp; &nbsp;*</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp; &nbsp; &nbsp;*/</span> &nbsp; &nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.*;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.*;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.*;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=urlloader%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlloader.html"><span style="color: #004993;">URLLoader</span></a><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=urlrequestmethod%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlrequestmethod.html"><span style="color: #004993;">URLRequestMethod</span></a><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=urlloaderdataformat%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlloaderdataformat.html"><span style="color: #004993;">URLLoaderDataFormat</span></a><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=urlrequest%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlrequest.html"><span style="color: #004993;">URLRequest</span></a><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=urlvariables%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlvariables.html"><span style="color: #004993;">URLVariables</span></a><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> FeedBurner <span style="color: #0033ff; font-weight: bold;">extends</span> <a href="http://www.google.com/search?q=movieclip%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:movieclip.html"><span style="color: #004993;">MovieClip</span></a> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> const FEEDBURNER_API &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> &nbsp; &nbsp; &nbsp; &nbsp;= <span style="color: #990000;">'http://api.feedburner.com/awareness/1.0/GetFeedData'</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> FeedBurner<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;construtor::FeedBurner&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> <a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ADDED_TO_STAGE</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">init</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span> e<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a> = <span style="color: #0033ff; font-weight: bold;">null</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result_txt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #990000;">''</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; feed_url<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> &nbsp; &nbsp; = <span style="color: #990000;">'http://www.undolog.com/feed'</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; check_btn<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> <a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CLICK</span><span style="color: #000066; font-weight: bold;">,</span> checkFeedBurnerReaders <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> checkFeedBurnerReaders<span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a> = <span style="color: #0033ff; font-weight: bold;">null</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span> <span style="color: #990000;">&quot;FeedBurner::checkFeedBurnerReaders()&quot;</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">loader</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=urlloader%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlloader.html"><span style="color: #004993;">URLLoader</span></a> &nbsp; &nbsp; &nbsp;= <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=urlloader%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlloader.html"><span style="color: #004993;">URLLoader</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> urlreq &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=urlrequest%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlrequest.html"><span style="color: #004993;">URLRequest</span></a> &nbsp; &nbsp; = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=urlrequest%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlrequest.html"><span style="color: #004993;">URLRequest</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> param &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=urlvariables%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlvariables.html"><span style="color: #004993;">URLVariables</span></a> &nbsp; = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=urlvariables%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlvariables.html"><span style="color: #004993;">URLVariables</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; param<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">uri</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = feed_url<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; urlreq<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">url</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= FEEDBURNER_API<span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; urlreq<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">method</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <a href="http://www.google.com/search?q=urlrequestmethod%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlrequestmethod.html"><span style="color: #004993;">URLRequestMethod</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">GET</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; urlreq<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">data</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = param<span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// &nbsp; &nbsp;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">loader</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">dataFormat</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <a href="http://www.google.com/search?q=urlloaderdataformat%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlloaderdataformat.html"><span style="color: #004993;">URLLoaderDataFormat</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TEXT</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">loader</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">COMPLETE</span><span style="color: #000066; font-weight: bold;">,</span> completeHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">try</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">loader</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">load</span><span style="color: #000000;">&#40;</span>urlreq<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">catch</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">error</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=error%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:error.html"><span style="color: #004993;">Error</span></a><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Errore nel caricamento dell' URL&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339966; font-weight: bold;">function</span> completeHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//&lt;rsp stat=&quot;ok&quot;&gt;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// &nbsp;&lt;feed id=&quot;651641&quot; uri=&quot;undolog&quot;&gt;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// &nbsp; &nbsp;&lt;entry date=&quot;2008-11-17&quot; circulation=&quot;389&quot; hits=&quot;1348&quot; downloads=&quot;0&quot; reach=&quot;43&quot;/&gt;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// &nbsp;&lt;/feed&gt;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//&lt;/rsp&gt;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> x_xml &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=xml%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:xml.html"><span style="color: #004993;">XML</span></a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <a href="http://www.google.com/search?q=xml%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:xml.html"><span style="color: #004993;">XML</span></a><span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">target</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">data</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> x_xml<span style="color: #000066; font-weight: bold;">.</span>@stat == <span style="color: #990000;">'ok'</span> <span style="color: #000000;">&#41;</span> result_txt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = x_xml<span style="color: #000066; font-weight: bold;">.</span>feed<span style="color: #000066; font-weight: bold;">.</span>entry<span style="color: #000066; font-weight: bold;">.</span>@circulation<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">toString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">else</span> result_txt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #990000;">'0'</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>La parte di interfaccia è disponibile su <a href="http://undolibrary.googlecode.com/svn/trunk/air/FeedBurner/FeedBurner.fla">Feedburner.fla</a>.</p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F18%2Fadobe-air-e-le-api-di-feedburner-reloaded%2F&amp;title=Adobe%20AIR%20e%20le%20API%20di%20Feedburner%3A%20reloaded&amp;bodytext=Prendo%20spunto%20dall%27ottimo%20tutorial%20di%20Napolux%2C%20Flex%203%2C%20Adobe%20AIR%20e%20le%20API%20di%20Feedburner%2C%20che%20mostra%20come%20scrivere%20una%20semplice%20applicazione%20%28o%20widget%29%20Adobe%20AIR%20usando%20Flex%203%2C%20per%20mostrare%20come%20realizzare%20la%20stessa%20identica%20cosa%20usando%20Adobe%20Flash%20CS" title="Digg"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F18%2Fadobe-air-e-le-api-di-feedburner-reloaded%2F&amp;title=Adobe%20AIR%20e%20le%20API%20di%20Feedburner%3A%20reloaded&amp;notes=Prendo%20spunto%20dall%27ottimo%20tutorial%20di%20Napolux%2C%20Flex%203%2C%20Adobe%20AIR%20e%20le%20API%20di%20Feedburner%2C%20che%20mostra%20come%20scrivere%20una%20semplice%20applicazione%20%28o%20widget%29%20Adobe%20AIR%20usando%20Flex%203%2C%20per%20mostrare%20come%20realizzare%20la%20stessa%20identica%20cosa%20usando%20Adobe%20Flash%20CS" title="del.icio.us"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F18%2Fadobe-air-e-le-api-di-feedburner-reloaded%2F" title="Technorati"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F18%2Fadobe-air-e-le-api-di-feedburner-reloaded%2F&amp;t=Adobe%20AIR%20e%20le%20API%20di%20Feedburner%3A%20reloaded" title="Facebook"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F18%2Fadobe-air-e-le-api-di-feedburner-reloaded%2F&amp;title=Adobe%20AIR%20e%20le%20API%20di%20Feedburner%3A%20reloaded&amp;annotation=Prendo%20spunto%20dall%27ottimo%20tutorial%20di%20Napolux%2C%20Flex%203%2C%20Adobe%20AIR%20e%20le%20API%20di%20Feedburner%2C%20che%20mostra%20come%20scrivere%20una%20semplice%20applicazione%20%28o%20widget%29%20Adobe%20AIR%20usando%20Flex%203%2C%20per%20mostrare%20come%20realizzare%20la%20stessa%20identica%20cosa%20usando%20Adobe%20Flash%20CS" title="Google Bookmarks"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Adobe%20AIR%20e%20le%20API%20di%20Feedburner%3A%20reloaded%20-%20http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F18%2Fadobe-air-e-le-api-di-feedburner-reloaded%2F" title="Twitter"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://barrapunto.com/submit.pl?subj=Adobe%20AIR%20e%20le%20API%20di%20Feedburner%3A%20reloaded&amp;story=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F18%2Fadobe-air-e-le-api-di-feedburner-reloaded%2F" title="BarraPunto"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/barrapunto.png" title="BarraPunto" alt="BarraPunto" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://current.com/clipper.htm?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F18%2Fadobe-air-e-le-api-di-feedburner-reloaded%2F&amp;title=Adobe%20AIR%20e%20le%20API%20di%20Feedburner%3A%20reloaded" title="Current"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Adobe%20AIR%20e%20le%20API%20di%20Feedburner%3A%20reloaded&amp;body=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F18%2Fadobe-air-e-le-api-di-feedburner-reloaded%2F" title="email"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Adobe%20AIR%20e%20le%20API%20di%20Feedburner%3A%20reloaded&amp;link=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F18%2Fadobe-air-e-le-api-di-feedburner-reloaded%2F" title="FriendFeed"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F18%2Fadobe-air-e-le-api-di-feedburner-reloaded%2F&amp;headline=Adobe%20AIR%20e%20le%20API%20di%20Feedburner%3A%20reloaded&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F18%2Fadobe-air-e-le-api-di-feedburner-reloaded%2F&amp;title=Adobe%20AIR%20e%20le%20API%20di%20Feedburner%3A%20reloaded&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Prendo%20spunto%20dall%27ottimo%20tutorial%20di%20Napolux%2C%20Flex%203%2C%20Adobe%20AIR%20e%20le%20API%20di%20Feedburner%2C%20che%20mostra%20come%20scrivere%20una%20semplice%20applicazione%20%28o%20widget%29%20Adobe%20AIR%20usando%20Flex%203%2C%20per%20mostrare%20come%20realizzare%20la%20stessa%20identica%20cosa%20usando%20Adobe%20Flash%20CS" title="LinkedIn"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F18%2Fadobe-air-e-le-api-di-feedburner-reloaded%2F&amp;title=Adobe%20AIR%20e%20le%20API%20di%20Feedburner%3A%20reloaded" title="Live"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F18%2Fadobe-air-e-le-api-di-feedburner-reloaded%2F&amp;t=Adobe%20AIR%20e%20le%20API%20di%20Feedburner%3A%20reloaded" title="MySpace"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Adobe%20AIR%20e%20le%20API%20di%20Feedburner%3A%20reloaded&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F18%2Fadobe-air-e-le-api-di-feedburner-reloaded%2F" title="Netvibes"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F18%2Fadobe-air-e-le-api-di-feedburner-reloaded%2F&amp;partner=sociable" title="Print"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.undolog.com/feed/" title="RSS"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://segnalo.alice.it/post.html.php?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F18%2Fadobe-air-e-le-api-di-feedburner-reloaded%2F&amp;title=Adobe%20AIR%20e%20le%20API%20di%20Feedburner%3A%20reloaded" title="Segnalo"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/segnalo.png" title="Segnalo" alt="Segnalo" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F18%2Fadobe-air-e-le-api-di-feedburner-reloaded%2F&amp;title=Adobe%20AIR%20e%20le%20API%20di%20Feedburner%3A%20reloaded" title="StumbleUpon"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.it/vote?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F18%2Fadobe-air-e-le-api-di-feedburner-reloaded%2F" title="Wikio IT"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio IT" alt="Wikio IT" class="sociable-hovers" /></a>


<br/><br/>
	Tags: <a href="http://www.undolog.com/category/sviluppo/flash-cs3/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/added_to_stage/" title="ADDED_TO_STAGE" rel="tag">ADDED_TO_STAGE</a>, <a href="http://www.undolog.com/tag/addeventlistener/" title="addEventListener" rel="tag">addEventListener</a>, <a href="http://www.undolog.com/tag/adobe/" title="Adobe" rel="tag">Adobe</a>, <a href="http://www.undolog.com/tag/adobe-air/" title="Adobe-AIR" rel="tag">Adobe-AIR</a>, <a href="http://www.undolog.com/category/sviluppo/air/" title="AIR" rel="tag">AIR</a>, <a href="http://www.undolog.com/tag/air/" title="AIR" rel="tag">AIR</a>, <a href="http://www.undolog.com/tag/api/" title="api" rel="tag">api</a>, <a href="http://www.undolog.com/tag/catch/" title="catch" rel="tag">catch</a>, <a href="http://www.undolog.com/tag/feed/" title="feed" rel="tag">feed</a>, <a href="http://www.undolog.com/tag/flash/" title="Flash" rel="tag">Flash</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/tag/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/tag/flex/" title="Flex" rel="tag">Flex</a>, <a href="http://www.undolog.com/tag/google/" title="google" rel="tag">google</a>, <a href="http://www.undolog.com/tag/google-code/" title="Google Code" rel="tag">Google Code</a>, <a href="http://www.undolog.com/category/sviluppo/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/mouseevent/" title="MouseEvent" rel="tag">MouseEvent</a>, <a href="http://www.undolog.com/tag/package/" title="package" rel="tag">package</a>, <a href="http://www.undolog.com/tag/rest/" title="REST" rel="tag">REST</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/tag/tecnologia/" title="Tecnologia" rel="tag">Tecnologia</a>, <a href="http://www.undolog.com/tag/try/" title="try" rel="tag">try</a>, <a href="http://www.undolog.com/category/tutorials/" title="Tutorials" rel="tag">Tutorials</a>, <a href="http://www.undolog.com/tag/tutorials/" title="Tutorials" rel="tag">Tutorials</a>, <a href="http://www.undolog.com/tag/urlloader/" title="URLLoader" rel="tag">URLLoader</a>, <a href="http://www.undolog.com/tag/urlrequest/" title="URLRequest" rel="tag">URLRequest</a>, <a href="http://www.undolog.com/tag/urlvariables/" title="URLVariables" rel="tag">URLVariables</a>, <a href="http://www.undolog.com/tag/xml/" title="xml" rel="tag">xml</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2007/12/14/flash-cs3-comunicazione-con-un-web-server/" title="Flash CS3: comunicazione con un Web Server (14 dicembre, 2007)">Flash CS3: comunicazione con un Web Server</a> (0)</li>
	<li><a href="http://www.undolog.com/2008/02/29/umap-flash-component-beta-v06/" title="UMap Flash Component (Beta v0.6) (29 febbraio, 2008)">UMap Flash Component (Beta v0.6)</a> (0)</li>
	<li><a href="http://www.undolog.com/2008/01/25/google-maps-component-per-flash/" title="Google Maps component per Flash (25 gennaio, 2008)">Google Maps component per Flash</a> (5)</li>
	<li><a href="http://www.undolog.com/2008/02/25/adobe-air-10-adobe-flex-30-e-il-nuovo-adobe-open-source/" title="Adobe AIR 1.0, Adobe Flex 3.0 e il nuovo Adobe Open Source (25 febbraio, 2008)">Adobe AIR 1.0, Adobe Flex 3.0 e il nuovo Adobe Open Source</a> (0)</li>
	<li><a href="http://www.undolog.com/2007/11/26/10-motivi-per-passare-ad-adobe-flash-cs3/" title="10 motivi per passare ad Adobe Flash CS3 (26 novembre, 2007)">10 motivi per passare ad Adobe Flash CS3</a> (3)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2008/11/18/adobe-air-e-le-api-di-feedburner-reloaded/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Actionscript 3.0 for beginners: lesson #4</title>
		<link>http://www.undolog.com/2008/11/11/actionscript-30-for-beginners-lesson-4/</link>
		<comments>http://www.undolog.com/2008/11/11/actionscript-30-for-beginners-lesson-4/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 05:00:41 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[Const]]></category>
		<category><![CDATA[Corso]]></category>
		<category><![CDATA[costanti]]></category>
		<category><![CDATA[Lezione]]></category>
		<category><![CDATA[public]]></category>
		<category><![CDATA[static]]></category>
		<category><![CDATA[variabili]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=915</guid>
		<description><![CDATA[Riprendiamo il nostro codice di esempio del TicTacToe (che trovate per intero su Google Code) e iniziamo ad analizzarlo in dettaglio.
Importare le definizioni
Con Actionscript 3.0 è stato fatto un grande lavoro di pulizia e sistemazione nell'alberatura delle classi (contenute nei pacchetti, package) utilizzate durante lo sviluppo. In altri linguaggi di programmazione, come il C ad [...]]]></description>
			<content:encoded><![CDATA[<p>Riprendiamo il nostro codice di esempio del <a href="http://www.undolog.com/2008/09/03/actionscript-30-for-beginners-lesson-2/">TicTacToe</a> (che trovate per intero su <a target="_blank" href="http://code.google.com/p/undolibrary/source/browse/trunk/as3/tictactoe/">Google Code</a>) e iniziamo ad analizzarlo in dettaglio.</p>
<h4>Importare le definizioni</h4>
<p>Con Actionscript 3.0 è stato fatto un grande lavoro di pulizia e sistemazione nell'alberatura delle classi (contenute nei pacchetti, <code>package</code>) utilizzate durante lo sviluppo. In altri linguaggi di programmazione, come il C ad esempio, quando si desidera utilizzare una funzionalità bisogna esplicitamente "importarla" nel codice. Questa operazione di "importazione" è necessaria per permettere al compilatore di avere tutti i codici e le definizioni legate alla funzionalità che vogliamo usare. In Actionscript 3.0, tuttavia, l'istruzione <code>import</code> non va confusa con l'equivalente C/C++ <code>#include</code>; Actionscript 3.0 mette a disposizione l'istruzione <code>include</code> che è identica all'<code>#include</code> del C/C++. Quest'ultima, infatti, "include" effettivamente del codice che, se usato o meno, viene compilato nell'eseguibile finale. L'istruzione <code>import</code> è di più alto livello e risulta più "intelligente" in fase di compilazione. Essa serve principalemente per accedere alle classi senza doverne specificare il nome completo. In alre parole invece di usare forme del tipo:</p>
<div class="igBar"><span id="lactionscript3-67"><a href="#" onclick="javascript:showCodeTxt('actionscript3-67'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-67">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> myMC<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=movieclip%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:movieclip.html"><span style="color: #004993;">MovieClip</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=movieclip%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:movieclip.html"><span style="color: #004993;">MovieClip</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
<span id="more-915"></span></p>
<p>Importando la definizione dallo specifico pacchetto (o libreria se preferite), si ottiene il più semplice e leggibile:</p>
<div class="igBar"><span id="lactionscript3-68"><a href="#" onclick="javascript:showCodeTxt('actionscript3-68'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-68">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=movieclip%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:movieclip.html"><span style="color: #004993;">MovieClip</span></a><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">//</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> myMC<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=movieclip%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:movieclip.html"><span style="color: #004993;">MovieClip</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=movieclip%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:movieclip.html"><span style="color: #004993;">MovieClip</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Nel nostro esempio, all'interno della dichiarazione del package della classe, troviamo subito tre <code>import</code>:</p>
<div class="igBar"><span id="lactionscript3-69"><a href="#" onclick="javascript:showCodeTxt('actionscript3-69'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-69">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.*;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.*;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.*;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Il primo <code>import</code> rende disponibili tutte le classi e le definizioni all'interno del package <code>flash.display</code>. In alternativa avremmo potuto sostituire l'intero pacchetto con l'importazione (mirata) delle singole classi e definzioni che usiamo, ovvero:</p>
<div class="igBar"><span id="lactionscript3-70"><a href="#" onclick="javascript:showCodeTxt('actionscript3-70'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-70">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=displayobject%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:displayobject.html"><span style="color: #004993;">DisplayObject</span></a><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=movieclip%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:movieclip.html"><span style="color: #004993;">MovieClip</span></a><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=stage%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:stage.html"><span style="color: #004993;">Stage</span></a><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=stagealign%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:stagealign.html"><span style="color: #004993;">StageAlign</span></a><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=stagescalemode%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:stagescalemode.html"><span style="color: #004993;">StageScaleMode</span></a><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Questa operazione di "dettaglio" non è comunque necessaria ai fini del risultato finale. Se una classe importata  non viene utilizza nello script, non viene - intelligentemente - esportata nel file SWF.</p>
<blockquote><p><em>Questo significa che è possibile importare pacchetti di grandi dimensioni senza doversi preoccupare delle dimensioni del file SWF; il codice byte associato a una classe viene incluso in un file SWF solo se tale classe viene effettivamente utilizzata.</em></p>
</blockquote>
<p>Al massimo, se esageriamo con gli "asterischi", cioè con sintassi come <code>flash.*</code>, possiamo avere un "leggero" rallentamento durante la fase di compilazione! Nella "vita di tutti i giorni", dunque, è possibile utilizzare in tutta tranquillità la sintassi usata nel nostro esempio.</p>
<h4>Costanti statiche</h4>
<p>Ecco un'altra caratteristica interessante di Actionscript 3.0: le costanti statiche. Nell'esempio ne ho introdotte alcune a titolo di esempio:</p>
<div class="igBar"><span id="lactionscript3-71"><a href="#" onclick="javascript:showCodeTxt('actionscript3-71'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-71">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">static <span style="color: #0033ff; font-weight: bold;">public</span> const NAME &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> = <span style="color: #990000;">&quot;TicTacToe&quot;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">static <span style="color: #0033ff; font-weight: bold;">public</span> const VERSION <span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> = <span style="color: #990000;">&quot;1.0&quot;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">static <span style="color: #0033ff; font-weight: bold;">public</span> const AUTHOR &nbsp;<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> = <span style="color: #990000;">&quot;Giovambattista Fazioli &lt;g.fazioli@undolog.com&gt;&quot;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>È curioso notare che la stessa sequenza può essere scritta come:</p>
<div class="igBar"><span id="lactionscript3-72"><a href="#" onclick="javascript:showCodeTxt('actionscript3-72'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-72">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">public</span> static const NAME &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> = <span style="color: #990000;">&quot;TicTacToe&quot;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">public</span> static const VERSION <span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> = <span style="color: #990000;">&quot;1.0&quot;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">public</span> static const AUTHOR &nbsp;<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> = <span style="color: #990000;">&quot;Giovambattista Fazioli &lt;g.fazioli@undolog.com&gt;&quot;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Lasciando da parte queste "curiosità" dell'ambiente Flash CS3, diciamo che le variabili o costanti statiche sono associate alla classe e non all'istanza della classe! Vedi <em><a href="http://www.undolog.com/2008/01/29/classi-oggetti-e-istanze/">Classi, Oggetti e Istanze</a></em>. Questa è una differenza importantissima, infatti nel nostro caso se scriviamo - a titolo di esempio:</p>
<div class="igBar"><span id="lactionscript3-73"><a href="#" onclick="javascript:showCodeTxt('actionscript3-73'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-73">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> ttt<span style="color: #000066; font-weight: bold;">:</span>TicTacToe = <span style="color: #0033ff; font-weight: bold;">new</span> TicTacToe<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span> ttt<span style="color: #000066; font-weight: bold;">.</span>AUTHOR <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> &nbsp;<span style="color: #009900; font-style: italic;">// errore</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Verrà generato un errore. Questo perchè le costanti o variabili statiche vengono associate direttamente alla definizione della classe stessa e non ad una sua istanza. Il modo corretto è:</p>
<div class="igBar"><span id="lactionscript3-74"><a href="#" onclick="javascript:showCodeTxt('actionscript3-74'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-74">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span> TicTacToe<span style="color: #000066; font-weight: bold;">.</span>AUTHOR <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> &nbsp;<span style="color: #009900; font-style: italic;">// Giovambattista Fazioli &lt;g.fazioli@undolog.com&gt;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Le costanti o variabili statiche hanno la caratteristche di non essere "istanziate" più volte. Vengono usate in tutte quelle situazioni dove il valore memorizzato (sia sotto forma di variabile che sotto forma di costante) rimane valido per tutte le istanze di quella classe e quindi può essere condiviso con tutti i "figli".</p>
<h4>Variabili e Costanti</h4>
<p>È facile intuire la sostanziale differenza tra variabile e costante, essendo il nome stesso auto esplicativo. È bene tuttavia spiegarlo visto che ne abbiamo appena parlato. Una variabile è uno spazio riservato ad un dato (numerico, stringa, booleano, etc...) che può (o deve) mutare il suo valore durante l'esecuzione di un codice. Al contrario le costanti sono spazi riservati a dati che non mutano mai il loro valore durante l'esecuzione di un codice: rimangono costanti! Si veda al riguardo <em><a href="http://www.undolog.com/2007/12/02/costanti-e-variabili-qual-la-vera-differenza/">Costanti e variabili: qual’è la vera differenza?</a></em>.</p>
<p>In Actionscript 3.0, come in altri linguaggi, le costanti possono essere impostate solo una volta: direttamente durante la definizione o successivamente nel codice:</p>
<div class="igBar"><span id="lactionscript3-75"><a href="#" onclick="javascript:showCodeTxt('actionscript3-75'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-75">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #9900cc; font-weight: bold;">class</span> Esempio <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> const COSTANTE_A<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=int%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:int.html"><span style="color: #004993;">int</span></a> = <span style="color: #000000; font-weight:bold;color:#800000;">0</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> const COSTANTE_B<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=int%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:int.html"><span style="color: #004993;">int</span></a><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// costruttore</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Esempio<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; COSTANTE_B = <span style="color: #000000; font-weight:bold;color:#800000;">10</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> sample<span style="color: #000066; font-weight: bold;">:</span>Esempio &nbsp;= <span style="color: #0033ff; font-weight: bold;">new</span> Esempio <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span> sample<span style="color: #000066; font-weight: bold;">.</span>COSTANTE_A <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// 0</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span> sample<span style="color: #000066; font-weight: bold;">.</span>COSTANTE_B <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// 10</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>La prossima volta proseguiremo l'analisi del codice e daremo un'occhiata ai "tipi" dato, argomento interessante ed importante con la release 3.0 di Actionscript.</p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F11%2Factionscript-30-for-beginners-lesson-4%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%234&amp;bodytext=Riprendiamo%20il%20nostro%20codice%20di%20esempio%20del%20TicTacToe%20%28che%20trovate%20per%20intero%20su%20Google%20Code%29%20e%20iniziamo%20ad%20analizzarlo%20in%20dettaglio.%0D%0AImportare%20le%20definizioni%0D%0ACon%20Actionscript%203.0%20%C3%A8%20stato%20fatto%20un%20grande%20lavoro%20di%20pulizia%20e%20sistemazione%20nell%27alber" title="Digg"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F11%2Factionscript-30-for-beginners-lesson-4%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%234&amp;notes=Riprendiamo%20il%20nostro%20codice%20di%20esempio%20del%20TicTacToe%20%28che%20trovate%20per%20intero%20su%20Google%20Code%29%20e%20iniziamo%20ad%20analizzarlo%20in%20dettaglio.%0D%0AImportare%20le%20definizioni%0D%0ACon%20Actionscript%203.0%20%C3%A8%20stato%20fatto%20un%20grande%20lavoro%20di%20pulizia%20e%20sistemazione%20nell%27alber" title="del.icio.us"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F11%2Factionscript-30-for-beginners-lesson-4%2F" title="Technorati"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F11%2Factionscript-30-for-beginners-lesson-4%2F&amp;t=Actionscript%203.0%20for%20beginners%3A%20lesson%20%234" title="Facebook"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F11%2Factionscript-30-for-beginners-lesson-4%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%234&amp;annotation=Riprendiamo%20il%20nostro%20codice%20di%20esempio%20del%20TicTacToe%20%28che%20trovate%20per%20intero%20su%20Google%20Code%29%20e%20iniziamo%20ad%20analizzarlo%20in%20dettaglio.%0D%0AImportare%20le%20definizioni%0D%0ACon%20Actionscript%203.0%20%C3%A8%20stato%20fatto%20un%20grande%20lavoro%20di%20pulizia%20e%20sistemazione%20nell%27alber" title="Google Bookmarks"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Actionscript%203.0%20for%20beginners%3A%20lesson%20%234%20-%20http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F11%2Factionscript-30-for-beginners-lesson-4%2F" title="Twitter"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://barrapunto.com/submit.pl?subj=Actionscript%203.0%20for%20beginners%3A%20lesson%20%234&amp;story=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F11%2Factionscript-30-for-beginners-lesson-4%2F" title="BarraPunto"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/barrapunto.png" title="BarraPunto" alt="BarraPunto" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://current.com/clipper.htm?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F11%2Factionscript-30-for-beginners-lesson-4%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%234" title="Current"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Actionscript%203.0%20for%20beginners%3A%20lesson%20%234&amp;body=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F11%2Factionscript-30-for-beginners-lesson-4%2F" title="email"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%234&amp;link=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F11%2Factionscript-30-for-beginners-lesson-4%2F" title="FriendFeed"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F11%2Factionscript-30-for-beginners-lesson-4%2F&amp;headline=Actionscript%203.0%20for%20beginners%3A%20lesson%20%234&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F11%2Factionscript-30-for-beginners-lesson-4%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%234&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Riprendiamo%20il%20nostro%20codice%20di%20esempio%20del%20TicTacToe%20%28che%20trovate%20per%20intero%20su%20Google%20Code%29%20e%20iniziamo%20ad%20analizzarlo%20in%20dettaglio.%0D%0AImportare%20le%20definizioni%0D%0ACon%20Actionscript%203.0%20%C3%A8%20stato%20fatto%20un%20grande%20lavoro%20di%20pulizia%20e%20sistemazione%20nell%27alber" title="LinkedIn"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F11%2Factionscript-30-for-beginners-lesson-4%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%234" title="Live"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F11%2Factionscript-30-for-beginners-lesson-4%2F&amp;t=Actionscript%203.0%20for%20beginners%3A%20lesson%20%234" title="MySpace"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%234&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F11%2Factionscript-30-for-beginners-lesson-4%2F" title="Netvibes"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F11%2Factionscript-30-for-beginners-lesson-4%2F&amp;partner=sociable" title="Print"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.undolog.com/feed/" title="RSS"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://segnalo.alice.it/post.html.php?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F11%2Factionscript-30-for-beginners-lesson-4%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%234" title="Segnalo"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/segnalo.png" title="Segnalo" alt="Segnalo" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F11%2Factionscript-30-for-beginners-lesson-4%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%234" title="StumbleUpon"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.it/vote?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F11%2Factionscript-30-for-beginners-lesson-4%2F" title="Wikio IT"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio IT" alt="Wikio IT" class="sociable-hovers" /></a>


<br/><br/>
	Tags: <a href="http://www.undolog.com/category/sviluppo/flash-cs3/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/class/" title="class" rel="tag">class</a>, <a href="http://www.undolog.com/tag/const/" title="Const" rel="tag">Const</a>, <a href="http://www.undolog.com/tag/corso/" title="Corso" rel="tag">Corso</a>, <a href="http://www.undolog.com/tag/costanti/" title="costanti" rel="tag">costanti</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/tag/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/category/sviluppo/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/lezione/" title="Lezione" rel="tag">Lezione</a>, <a href="http://www.undolog.com/tag/public/" title="public" rel="tag">public</a>, <a href="http://www.undolog.com/tag/static/" title="static" rel="tag">static</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/tag/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/category/tutorials/" title="Tutorials" rel="tag">Tutorials</a>, <a href="http://www.undolog.com/tag/tutorials/" title="Tutorials" rel="tag">Tutorials</a>, <a href="http://www.undolog.com/tag/variabili/" title="variabili" rel="tag">variabili</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2009/01/22/actionscript-30-for-beginners-lesson-5/" title="Actionscript 3.0 for beginners: lesson #5 (22 gennaio, 2009)">Actionscript 3.0 for beginners: lesson #5</a> (4)</li>
	<li><a href="http://www.undolog.com/2008/09/28/actionscript-30-for-beginners-lesson-3/" title="Actionscript 3.0 for beginners: lesson #3 (28 settembre, 2008)">Actionscript 3.0 for beginners: lesson #3</a> (0)</li>
	<li><a href="http://www.undolog.com/2008/09/03/actionscript-30-for-beginners-lesson-2/" title="Actionscript 3.0 for beginners: lesson #2 (3 settembre, 2008)">Actionscript 3.0 for beginners: lesson #2</a> (4)</li>
	<li><a href="http://www.undolog.com/2008/08/08/actionscript-30-for-beginners-lesson-1/" title="Actionscript 3.0 for beginners: lesson #1 (8 agosto, 2008)">Actionscript 3.0 for beginners: lesson #1</a> (9)</li>
	<li><a href="http://www.undolog.com/2008/06/04/flash-cs3-creare-un-effetto-reflex-su-qualsiasi-movieclip/" title="Flash CS3: creare un effetto Reflex su qualsiasi MovieClip (4 giugno, 2008)">Flash CS3: creare un effetto Reflex su qualsiasi MovieClip</a> (12)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2008/11/11/actionscript-30-for-beginners-lesson-4/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Very short trick: cicli for più rapidi in Actionscript</title>
		<link>http://www.undolog.com/2008/10/15/very-short-trick-cicli-for-piu-rapidi-in-actionscript/</link>
		<comments>http://www.undolog.com/2008/10/15/very-short-trick-cicli-for-piu-rapidi-in-actionscript/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 14:00:51 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe-Flash-CS3]]></category>
		<category><![CDATA[tips-&-tricks]]></category>
		<category><![CDATA[trick]]></category>
		<category><![CDATA[uint]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=733</guid>
		<description><![CDATA[In Actionscript i cicli for è bene utilizzarli sempre con cura. Ad esempio è bene usare variabili uint quando è possibile:
PLAIN TEXT
Actionscript:




for&#40; var i:uint = 0; i++; i &#60;100&#41; &#123;


// ...


&#125;






È anche possibile usare la - non sempre conosciuta - forma:
PLAIN TEXT
Actionscript:




var i:uint = 0;


// ...


for&#40;; &#160;i++; i &#60;100&#41; &#123;


// ...


&#125;










	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	



	Tags: ActionScript, Actionscript 3.0, Actionscript [...]]]></description>
			<content:encoded><![CDATA[<p>In Actionscript i cicli <code>for</code> è bene utilizzarli sempre con cura. Ad esempio è bene usare variabili <code>uint</code> quando è possibile:</p>
<div class="igBar"><span id="lactionscript3-78"><a href="#" onclick="javascript:showCodeTxt('actionscript3-78'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-78">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span> <span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=uint%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:uint.html"><span style="color: #004993;">uint</span></a> = <span style="color: #000000; font-weight:bold;color:#800000;">0</span><span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">++;</span> i <span style="color: #000066; font-weight: bold;">&lt;</span><span style="color: #000000; font-weight:bold;color:#800000;">100</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">// ...</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>È anche possibile usare la - non sempre conosciuta - forma:</p>
<div class="igBar"><span id="lactionscript3-79"><a href="#" onclick="javascript:showCodeTxt('actionscript3-79'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-79">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=uint%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:uint.html"><span style="color: #004993;">uint</span></a> = <span style="color: #000000; font-weight:bold;color:#800000;">0</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">// ...</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;">;</span> &nbsp;i<span style="color: #000066; font-weight: bold;">++;</span> i <span style="color: #000066; font-weight: bold;">&lt;</span><span style="color: #000000; font-weight:bold;color:#800000;">100</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">// ...</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F15%2Fvery-short-trick-cicli-for-piu-rapidi-in-actionscript%2F&amp;title=Very%20short%20trick%3A%20cicli%20for%20pi%C3%B9%20rapidi%20in%20Actionscript&amp;bodytext=In%20Actionscript%20i%20cicli%20for%20%C3%A8%20bene%20utilizzarli%20sempre%20con%20cura.%20Ad%20esempio%20%C3%A8%20bene%20usare%20variabili%20uint%20quando%20%C3%A8%20possibile%3A%0D%0A%5Bas%5D%0D%0Afor%28%20var%20i%3Auint%20%3D%200%3B%20i%2B%2B%3B%20i%20%3C%20100%29%20%7B%0D%0A%2F%2F%20...%0D%0A%7D%0D%0A%5B%2Fas%5D%0D%0A%C3%88%20anche%20possibile%20usare%20la%20-%20non%20sempre%20conosciuta%20-%20forma%3A%0D" title="Digg"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F15%2Fvery-short-trick-cicli-for-piu-rapidi-in-actionscript%2F&amp;title=Very%20short%20trick%3A%20cicli%20for%20pi%C3%B9%20rapidi%20in%20Actionscript&amp;notes=In%20Actionscript%20i%20cicli%20for%20%C3%A8%20bene%20utilizzarli%20sempre%20con%20cura.%20Ad%20esempio%20%C3%A8%20bene%20usare%20variabili%20uint%20quando%20%C3%A8%20possibile%3A%0D%0A%5Bas%5D%0D%0Afor%28%20var%20i%3Auint%20%3D%200%3B%20i%2B%2B%3B%20i%20%3C%20100%29%20%7B%0D%0A%2F%2F%20...%0D%0A%7D%0D%0A%5B%2Fas%5D%0D%0A%C3%88%20anche%20possibile%20usare%20la%20-%20non%20sempre%20conosciuta%20-%20forma%3A%0D" title="del.icio.us"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F15%2Fvery-short-trick-cicli-for-piu-rapidi-in-actionscript%2F" title="Technorati"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F15%2Fvery-short-trick-cicli-for-piu-rapidi-in-actionscript%2F&amp;t=Very%20short%20trick%3A%20cicli%20for%20pi%C3%B9%20rapidi%20in%20Actionscript" title="Facebook"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F15%2Fvery-short-trick-cicli-for-piu-rapidi-in-actionscript%2F&amp;title=Very%20short%20trick%3A%20cicli%20for%20pi%C3%B9%20rapidi%20in%20Actionscript&amp;annotation=In%20Actionscript%20i%20cicli%20for%20%C3%A8%20bene%20utilizzarli%20sempre%20con%20cura.%20Ad%20esempio%20%C3%A8%20bene%20usare%20variabili%20uint%20quando%20%C3%A8%20possibile%3A%0D%0A%5Bas%5D%0D%0Afor%28%20var%20i%3Auint%20%3D%200%3B%20i%2B%2B%3B%20i%20%3C%20100%29%20%7B%0D%0A%2F%2F%20...%0D%0A%7D%0D%0A%5B%2Fas%5D%0D%0A%C3%88%20anche%20possibile%20usare%20la%20-%20non%20sempre%20conosciuta%20-%20forma%3A%0D" title="Google Bookmarks"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Very%20short%20trick%3A%20cicli%20for%20pi%C3%B9%20rapidi%20in%20Actionscript%20-%20http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F15%2Fvery-short-trick-cicli-for-piu-rapidi-in-actionscript%2F" title="Twitter"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://barrapunto.com/submit.pl?subj=Very%20short%20trick%3A%20cicli%20for%20pi%C3%B9%20rapidi%20in%20Actionscript&amp;story=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F15%2Fvery-short-trick-cicli-for-piu-rapidi-in-actionscript%2F" title="BarraPunto"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/barrapunto.png" title="BarraPunto" alt="BarraPunto" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://current.com/clipper.htm?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F15%2Fvery-short-trick-cicli-for-piu-rapidi-in-actionscript%2F&amp;title=Very%20short%20trick%3A%20cicli%20for%20pi%C3%B9%20rapidi%20in%20Actionscript" title="Current"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Very%20short%20trick%3A%20cicli%20for%20pi%C3%B9%20rapidi%20in%20Actionscript&amp;body=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F15%2Fvery-short-trick-cicli-for-piu-rapidi-in-actionscript%2F" title="email"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Very%20short%20trick%3A%20cicli%20for%20pi%C3%B9%20rapidi%20in%20Actionscript&amp;link=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F15%2Fvery-short-trick-cicli-for-piu-rapidi-in-actionscript%2F" title="FriendFeed"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F15%2Fvery-short-trick-cicli-for-piu-rapidi-in-actionscript%2F&amp;headline=Very%20short%20trick%3A%20cicli%20for%20pi%C3%B9%20rapidi%20in%20Actionscript&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F15%2Fvery-short-trick-cicli-for-piu-rapidi-in-actionscript%2F&amp;title=Very%20short%20trick%3A%20cicli%20for%20pi%C3%B9%20rapidi%20in%20Actionscript&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=In%20Actionscript%20i%20cicli%20for%20%C3%A8%20bene%20utilizzarli%20sempre%20con%20cura.%20Ad%20esempio%20%C3%A8%20bene%20usare%20variabili%20uint%20quando%20%C3%A8%20possibile%3A%0D%0A%5Bas%5D%0D%0Afor%28%20var%20i%3Auint%20%3D%200%3B%20i%2B%2B%3B%20i%20%3C%20100%29%20%7B%0D%0A%2F%2F%20...%0D%0A%7D%0D%0A%5B%2Fas%5D%0D%0A%C3%88%20anche%20possibile%20usare%20la%20-%20non%20sempre%20conosciuta%20-%20forma%3A%0D" title="LinkedIn"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F15%2Fvery-short-trick-cicli-for-piu-rapidi-in-actionscript%2F&amp;title=Very%20short%20trick%3A%20cicli%20for%20pi%C3%B9%20rapidi%20in%20Actionscript" title="Live"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F15%2Fvery-short-trick-cicli-for-piu-rapidi-in-actionscript%2F&amp;t=Very%20short%20trick%3A%20cicli%20for%20pi%C3%B9%20rapidi%20in%20Actionscript" title="MySpace"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Very%20short%20trick%3A%20cicli%20for%20pi%C3%B9%20rapidi%20in%20Actionscript&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F15%2Fvery-short-trick-cicli-for-piu-rapidi-in-actionscript%2F" title="Netvibes"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F15%2Fvery-short-trick-cicli-for-piu-rapidi-in-actionscript%2F&amp;partner=sociable" title="Print"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.undolog.com/feed/" title="RSS"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://segnalo.alice.it/post.html.php?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F15%2Fvery-short-trick-cicli-for-piu-rapidi-in-actionscript%2F&amp;title=Very%20short%20trick%3A%20cicli%20for%20pi%C3%B9%20rapidi%20in%20Actionscript" title="Segnalo"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/segnalo.png" title="Segnalo" alt="Segnalo" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F15%2Fvery-short-trick-cicli-for-piu-rapidi-in-actionscript%2F&amp;title=Very%20short%20trick%3A%20cicli%20for%20pi%C3%B9%20rapidi%20in%20Actionscript" title="StumbleUpon"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.it/vote?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F15%2Fvery-short-trick-cicli-for-piu-rapidi-in-actionscript%2F" title="Wikio IT"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio IT" alt="Wikio IT" class="sociable-hovers" /></a>


<br/><br/>
	Tags: <a href="http://www.undolog.com/tag/actionscript/" title="ActionScript" rel="tag">ActionScript</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/adobe-flash-cs3/" title="Adobe-Flash-CS3" rel="tag">Adobe-Flash-CS3</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/category/sviluppo/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/tag/tips-tricks/" title="tips-&amp;-tricks" rel="tag">tips-&amp;-tricks</a>, <a href="http://www.undolog.com/tag/trick/" title="trick" rel="tag">trick</a>, <a href="http://www.undolog.com/category/tutorials/" title="Tutorials" rel="tag">Tutorials</a>, <a href="http://www.undolog.com/tag/uint/" title="uint" rel="tag">uint</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2009/01/06/very-short-trick-addeventlistener-as3-un-handler-piu-eventi/" title="Very short trick: addEventListener() AS3, un handler più eventi (6 gennaio, 2009)">Very short trick: addEventListener() AS3, un handler più eventi</a> (9)</li>
	<li><a href="http://www.undolog.com/2009/09/09/very-short-trick-wordpress-resettare-una-query/" title="Very short trick: Wordpress, resettare una query (9 settembre, 2009)">Very short trick: Wordpress, resettare una query</a> (1)</li>
	<li><a href="http://www.undolog.com/2008/10/22/very-short-trick-valori-undefined-in-javascript/" title="Very short trick: valori undefined in Javascript (22 ottobre, 2008)">Very short trick: valori undefined in Javascript</a> (0)</li>
	<li><a href="http://www.undolog.com/2008/10/02/very-short-trick-php-auto-echo/" title="Very short trick: PHP auto echo (2 ottobre, 2008)">Very short trick: PHP auto echo</a> (0)</li>
	<li><a href="http://www.undolog.com/2009/10/28/very-short-trick-3-trick-per-gli-sviluppatori-apple-iphone/" title="Very short trick: 3 trick per gli sviluppatori Apple iPhone (28 ottobre, 2009)">Very short trick: 3 trick per gli sviluppatori Apple iPhone</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2008/10/15/very-short-trick-cicli-for-piu-rapidi-in-actionscript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Actionscript 3.0: MovieClip over MovieClip</title>
		<link>http://www.undolog.com/2008/10/14/actionscript-30-movieclip-over-movieclip/</link>
		<comments>http://www.undolog.com/2008/10/14/actionscript-30-movieclip-over-movieclip/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 10:36:27 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[eventi]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[MovieClip]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=807</guid>
		<description><![CDATA[Appena uno sviluppatore Flash/Actionscript si appresta a scrivere una funzione simile ad un tooltip, si scontra immediatamente con il problema della propagazione degli eventi tra MovieClip sovrapposti. Infatti se un MovieClip (B) si sovrappone ad un MovieClip (A) che risponde, ad esempio, ad un evento MouseEvent.Mouse_OVER, passando con il mouse sul MovieClip (B) più alto [...]]]></description>
			<content:encoded><![CDATA[<p>Appena uno sviluppatore Flash/Actionscript si appresta a scrivere una funzione simile ad un tooltip, si scontra immediatamente con il problema della propagazione degli eventi tra MovieClip sovrapposti. Infatti se un MovieClip (B) si sovrappone ad un MovieClip (A) che risponde, ad esempio, ad un evento <code>MouseEvent.Mouse_OVER</code>, passando con il mouse sul MovieClip (B) più alto nessun evento verrà più intercettato dal MovieClip (A):</p>
<p class="center"><img border="0" height="194" alt="MovieClip over MovieClip" src="http://www.undolog.com/wp-content/uploads/2008/10/image1.png" width="228" border="0"> </p>
<p>In questo scenario si presenta la necessità di inibire l'intercettazione degli eventi da parte del MovieClip (B). Questo è possibile impostando a <code>false</code> la property <code>mouseEnabled</code>:</p>
<div class="igBar"><span id="lactionscript3-81"><a href="#" onclick="javascript:showCodeTxt('actionscript3-81'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-81">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">mcb<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">mouseEnabled</span> = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F14%2Factionscript-30-movieclip-over-movieclip%2F&amp;title=Actionscript%203.0%3A%20MovieClip%20over%20MovieClip&amp;bodytext=Appena%20uno%20sviluppatore%20Flash%2FActionscript%20si%20appresta%20a%20scrivere%20una%20funzione%20simile%20ad%20un%20tooltip%2C%20si%20scontra%20immediatamente%20con%20il%20problema%20della%20propagazione%20degli%20eventi%20tra%20MovieClip%20sovrapposti.%20Infatti%20se%20un%20MovieClip%20%28B%29%20si%20sovrappone%20ad%20un%20" title="Digg"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F14%2Factionscript-30-movieclip-over-movieclip%2F&amp;title=Actionscript%203.0%3A%20MovieClip%20over%20MovieClip&amp;notes=Appena%20uno%20sviluppatore%20Flash%2FActionscript%20si%20appresta%20a%20scrivere%20una%20funzione%20simile%20ad%20un%20tooltip%2C%20si%20scontra%20immediatamente%20con%20il%20problema%20della%20propagazione%20degli%20eventi%20tra%20MovieClip%20sovrapposti.%20Infatti%20se%20un%20MovieClip%20%28B%29%20si%20sovrappone%20ad%20un%20" title="del.icio.us"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F14%2Factionscript-30-movieclip-over-movieclip%2F" title="Technorati"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F14%2Factionscript-30-movieclip-over-movieclip%2F&amp;t=Actionscript%203.0%3A%20MovieClip%20over%20MovieClip" title="Facebook"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F14%2Factionscript-30-movieclip-over-movieclip%2F&amp;title=Actionscript%203.0%3A%20MovieClip%20over%20MovieClip&amp;annotation=Appena%20uno%20sviluppatore%20Flash%2FActionscript%20si%20appresta%20a%20scrivere%20una%20funzione%20simile%20ad%20un%20tooltip%2C%20si%20scontra%20immediatamente%20con%20il%20problema%20della%20propagazione%20degli%20eventi%20tra%20MovieClip%20sovrapposti.%20Infatti%20se%20un%20MovieClip%20%28B%29%20si%20sovrappone%20ad%20un%20" title="Google Bookmarks"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Actionscript%203.0%3A%20MovieClip%20over%20MovieClip%20-%20http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F14%2Factionscript-30-movieclip-over-movieclip%2F" title="Twitter"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://barrapunto.com/submit.pl?subj=Actionscript%203.0%3A%20MovieClip%20over%20MovieClip&amp;story=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F14%2Factionscript-30-movieclip-over-movieclip%2F" title="BarraPunto"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/barrapunto.png" title="BarraPunto" alt="BarraPunto" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://current.com/clipper.htm?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F14%2Factionscript-30-movieclip-over-movieclip%2F&amp;title=Actionscript%203.0%3A%20MovieClip%20over%20MovieClip" title="Current"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Actionscript%203.0%3A%20MovieClip%20over%20MovieClip&amp;body=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F14%2Factionscript-30-movieclip-over-movieclip%2F" title="email"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Actionscript%203.0%3A%20MovieClip%20over%20MovieClip&amp;link=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F14%2Factionscript-30-movieclip-over-movieclip%2F" title="FriendFeed"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F14%2Factionscript-30-movieclip-over-movieclip%2F&amp;headline=Actionscript%203.0%3A%20MovieClip%20over%20MovieClip&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F14%2Factionscript-30-movieclip-over-movieclip%2F&amp;title=Actionscript%203.0%3A%20MovieClip%20over%20MovieClip&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Appena%20uno%20sviluppatore%20Flash%2FActionscript%20si%20appresta%20a%20scrivere%20una%20funzione%20simile%20ad%20un%20tooltip%2C%20si%20scontra%20immediatamente%20con%20il%20problema%20della%20propagazione%20degli%20eventi%20tra%20MovieClip%20sovrapposti.%20Infatti%20se%20un%20MovieClip%20%28B%29%20si%20sovrappone%20ad%20un%20" title="LinkedIn"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F14%2Factionscript-30-movieclip-over-movieclip%2F&amp;title=Actionscript%203.0%3A%20MovieClip%20over%20MovieClip" title="Live"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F14%2Factionscript-30-movieclip-over-movieclip%2F&amp;t=Actionscript%203.0%3A%20MovieClip%20over%20MovieClip" title="MySpace"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Actionscript%203.0%3A%20MovieClip%20over%20MovieClip&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F14%2Factionscript-30-movieclip-over-movieclip%2F" title="Netvibes"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F14%2Factionscript-30-movieclip-over-movieclip%2F&amp;partner=sociable" title="Print"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.undolog.com/feed/" title="RSS"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://segnalo.alice.it/post.html.php?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F14%2Factionscript-30-movieclip-over-movieclip%2F&amp;title=Actionscript%203.0%3A%20MovieClip%20over%20MovieClip" title="Segnalo"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/segnalo.png" title="Segnalo" alt="Segnalo" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F14%2Factionscript-30-movieclip-over-movieclip%2F&amp;title=Actionscript%203.0%3A%20MovieClip%20over%20MovieClip" title="StumbleUpon"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.it/vote?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F10%2F14%2Factionscript-30-movieclip-over-movieclip%2F" title="Wikio IT"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio IT" alt="Wikio IT" class="sociable-hovers" /></a>


<br/><br/>
	Tags: <a href="http://www.undolog.com/tag/actionscript/" title="ActionScript" rel="tag">ActionScript</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/event/" title="Event" rel="tag">Event</a>, <a href="http://www.undolog.com/tag/eventi/" title="eventi" rel="tag">eventi</a>, <a href="http://www.undolog.com/tag/flash/" title="Flash" rel="tag">Flash</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/category/sviluppo/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/movieclip/" title="MovieClip" rel="tag">MovieClip</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/category/tutorials/" title="Tutorials" rel="tag">Tutorials</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2007/10/19/scrivere-buon-codice-oo-in-adobe-flash/" title="Scrivere buon codice OO in Adobe Flash (19 ottobre, 2007)">Scrivere buon codice OO in Adobe Flash</a> (1)</li>
	<li><a href="http://www.undolog.com/2007/07/25/gestione-degli-eventi-similitudini-tra-flash-e-javascript/" title="Gestione degli eventi: similitudini tra Flash e Javascript (25 luglio, 2007)">Gestione degli eventi: similitudini tra Flash e Javascript</a> (3)</li>
	<li><a href="http://www.undolog.com/2007/11/06/flash-come-inizializzare-componenti-nel-costruttore-di-una-classe/" title="Flash: come inizializzare componenti nel costruttore di una classe (6 novembre, 2007)">Flash: come inizializzare componenti nel costruttore di una classe</a> (2)</li>
	<li><a href="http://www.undolog.com/2007/10/31/flash-e-il-riutilizzo-del-codice-componenti-e-librerie-condivise/" title="Flash e il riutilizzo del codice: componenti e librerie condivise (31 ottobre, 2007)">Flash e il riutilizzo del codice: componenti e librerie condivise</a> (1)</li>
	<li><a href="http://www.undolog.com/2007/11/12/creare-movieclip-modali-in-topmost/" title="Creare MovieClip modali in TopMost (12 novembre, 2007)">Creare MovieClip modali in TopMost</a> (1)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2008/10/14/actionscript-30-movieclip-over-movieclip/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Skypemote versione Adobe AIR</title>
		<link>http://www.undolog.com/2008/09/30/skypemote-versione-adobe-air/</link>
		<comments>http://www.undolog.com/2008/09/30/skypemote-versione-adobe-air/#comments</comments>
		<pubDate>Tue, 30 Sep 2008 08:59:28 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Grafica & Design]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tecnologia]]></category>
		<category><![CDATA[Adobe-AIR]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Emotions Icons]]></category>
		<category><![CDATA[Google Code]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac OS]]></category>
		<category><![CDATA[Skype]]></category>
		<category><![CDATA[Skype Editor]]></category>
		<category><![CDATA[Skypemote]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=713</guid>
		<description><![CDATA[
Questa è la prima release, la 0.8 (allineata con la versione online), di Skype Emotions Editor - Skypemote - in versione Adobe AIR. Per adesso le funzionalità sono le medisime della versione online, con il vantaggio di essere un'applicazione desktop, installabile quindi su Windows, Mac e Linux.Prima dell'installazione ricordatevi di aggiornare e/o installare per la [...]]]></description>
			<content:encoded><![CDATA[<p class="center"><a href="http://undolibrary.googlecode.com/files/airskypemote.air"><img border="0" height="330" alt="Download Install Skypemote Adobe AIR Version" src="http://www.undolog.com/wp-content/uploads/2008/09/image3.png" width="362" border="0"></a></p>
<p>Questa è la prima release, la 0.8 (allineata con la versione <a href="http://www.skypemote.com" target="_blank">online</a>), di Skype Emotions Editor - <a href="http://www.skypemote.com" target="_blank">Skypemote</a> - in versione <a title="Adobe AIR" href="http://adobe.com/go/air" target="_blank">Adobe AIR</a>. Per adesso le funzionalità sono le medisime della versione <a href="http://www.skypemote.com" target="_blank">online</a>, con il vantaggio di essere un'applicazione desktop, installabile quindi su Windows, Mac e Linux.<br />Prima dell'installazione ricordatevi di aggiornare e/o installare per la prima volta le <em>runtime</em> di <a title="Adobe AIR" href="http://adobe.com/go/air" target="_blank">Adobe AIR</a>, se non l'avete già fatto in precedenza.</p>
<h4>Download</h4>
<p><a href="http://undolibrary.googlecode.com/files/airskypemote.air">Potete scaricare Air Skypemote da Google Code</a>.</p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F30%2Fskypemote-versione-adobe-air%2F&amp;title=Skypemote%20versione%20Adobe%20AIR&amp;bodytext=%20Questa%20%C3%A8%20la%20prima%20release%2C%20la%200.8%20%28allineata%20con%20la%20versione%20online%29%2C%20di%20Skype%20Emotions%20Editor%20-%20Skypemote%20-%20in%20versione%20Adobe%20AIR.%20Per%20adesso%20le%20funzionalit%C3%A0%20sono%20le%20medisime%20della%20versione%20online%2C%20con%20il%20vantaggio%20di%20essere%20un%27applicazione%20deskt" title="Digg"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F30%2Fskypemote-versione-adobe-air%2F&amp;title=Skypemote%20versione%20Adobe%20AIR&amp;notes=%20Questa%20%C3%A8%20la%20prima%20release%2C%20la%200.8%20%28allineata%20con%20la%20versione%20online%29%2C%20di%20Skype%20Emotions%20Editor%20-%20Skypemote%20-%20in%20versione%20Adobe%20AIR.%20Per%20adesso%20le%20funzionalit%C3%A0%20sono%20le%20medisime%20della%20versione%20online%2C%20con%20il%20vantaggio%20di%20essere%20un%27applicazione%20deskt" title="del.icio.us"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F30%2Fskypemote-versione-adobe-air%2F" title="Technorati"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F30%2Fskypemote-versione-adobe-air%2F&amp;t=Skypemote%20versione%20Adobe%20AIR" title="Facebook"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F30%2Fskypemote-versione-adobe-air%2F&amp;title=Skypemote%20versione%20Adobe%20AIR&amp;annotation=%20Questa%20%C3%A8%20la%20prima%20release%2C%20la%200.8%20%28allineata%20con%20la%20versione%20online%29%2C%20di%20Skype%20Emotions%20Editor%20-%20Skypemote%20-%20in%20versione%20Adobe%20AIR.%20Per%20adesso%20le%20funzionalit%C3%A0%20sono%20le%20medisime%20della%20versione%20online%2C%20con%20il%20vantaggio%20di%20essere%20un%27applicazione%20deskt" title="Google Bookmarks"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Skypemote%20versione%20Adobe%20AIR%20-%20http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F30%2Fskypemote-versione-adobe-air%2F" title="Twitter"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://barrapunto.com/submit.pl?subj=Skypemote%20versione%20Adobe%20AIR&amp;story=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F30%2Fskypemote-versione-adobe-air%2F" title="BarraPunto"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/barrapunto.png" title="BarraPunto" alt="BarraPunto" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://current.com/clipper.htm?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F30%2Fskypemote-versione-adobe-air%2F&amp;title=Skypemote%20versione%20Adobe%20AIR" title="Current"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Skypemote%20versione%20Adobe%20AIR&amp;body=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F30%2Fskypemote-versione-adobe-air%2F" title="email"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Skypemote%20versione%20Adobe%20AIR&amp;link=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F30%2Fskypemote-versione-adobe-air%2F" title="FriendFeed"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F30%2Fskypemote-versione-adobe-air%2F&amp;headline=Skypemote%20versione%20Adobe%20AIR&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F30%2Fskypemote-versione-adobe-air%2F&amp;title=Skypemote%20versione%20Adobe%20AIR&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=%20Questa%20%C3%A8%20la%20prima%20release%2C%20la%200.8%20%28allineata%20con%20la%20versione%20online%29%2C%20di%20Skype%20Emotions%20Editor%20-%20Skypemote%20-%20in%20versione%20Adobe%20AIR.%20Per%20adesso%20le%20funzionalit%C3%A0%20sono%20le%20medisime%20della%20versione%20online%2C%20con%20il%20vantaggio%20di%20essere%20un%27applicazione%20deskt" title="LinkedIn"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F30%2Fskypemote-versione-adobe-air%2F&amp;title=Skypemote%20versione%20Adobe%20AIR" title="Live"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F30%2Fskypemote-versione-adobe-air%2F&amp;t=Skypemote%20versione%20Adobe%20AIR" title="MySpace"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Skypemote%20versione%20Adobe%20AIR&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F30%2Fskypemote-versione-adobe-air%2F" title="Netvibes"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F30%2Fskypemote-versione-adobe-air%2F&amp;partner=sociable" title="Print"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.undolog.com/feed/" title="RSS"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://segnalo.alice.it/post.html.php?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F30%2Fskypemote-versione-adobe-air%2F&amp;title=Skypemote%20versione%20Adobe%20AIR" title="Segnalo"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/segnalo.png" title="Segnalo" alt="Segnalo" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F30%2Fskypemote-versione-adobe-air%2F&amp;title=Skypemote%20versione%20Adobe%20AIR" title="StumbleUpon"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.it/vote?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F30%2Fskypemote-versione-adobe-air%2F" title="Wikio IT"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio IT" alt="Wikio IT" class="sociable-hovers" /></a>


<br/><br/>
	Tags: <a href="http://www.undolog.com/tag/adobe-air/" title="Adobe-AIR" rel="tag">Adobe-AIR</a>, <a href="http://www.undolog.com/category/sviluppo/air/" title="AIR" rel="tag">AIR</a>, <a href="http://www.undolog.com/tag/download/" title="Download" rel="tag">Download</a>, <a href="http://www.undolog.com/tag/emotions-icons/" title="Emotions Icons" rel="tag">Emotions Icons</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/tag/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/tag/google-code/" title="Google Code" rel="tag">Google Code</a>, <a href="http://www.undolog.com/category/grafica-design/" title="Grafica &amp; Design" rel="tag">Grafica &amp; Design</a>, <a href="http://www.undolog.com/category/sviluppo/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/linux/" title="Linux" rel="tag">Linux</a>, <a href="http://www.undolog.com/tag/mac-os/" title="Mac OS" rel="tag">Mac OS</a>, <a href="http://www.undolog.com/tag/skype/" title="Skype" rel="tag">Skype</a>, <a href="http://www.undolog.com/tag/skype-editor/" title="Skype Editor" rel="tag">Skype Editor</a>, <a href="http://www.undolog.com/tag/skypemote/" title="Skypemote" rel="tag">Skypemote</a>, <a href="http://www.undolog.com/category/software/" title="Software" rel="tag">Software</a>, <a href="http://www.undolog.com/tag/software/" title="Software" rel="tag">Software</a>, <a href="http://www.undolog.com/tag/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/category/tecnologia/" title="Tecnologia" rel="tag">Tecnologia</a>, <a href="http://www.undolog.com/tag/windows/" title="Windows" rel="tag">Windows</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2008/11/24/skypemote-versione-adobe-air-1000-download/" title="Skypemote versione Adobe AIR: 1000 download (24 novembre, 2008)">Skypemote versione Adobe AIR: 1000 download</a> (1)</li>
	<li><a href="http://www.undolog.com/2008/08/26/skypemotecom-dillo-con-le-emotions/" title="Skypemote.com: dillo con le emotions (26 agosto, 2008)">Skypemote.com: dillo con le emotions</a> (4)</li>
	<li><a href="http://www.undolog.com/2008/04/02/distribuire-applicazioni-adobe-air-da-air-badge-a-shu-player/" title="Distribuire applicazioni Adobe AIR: da AIR Badge a SHU Player (2 aprile, 2008)">Distribuire applicazioni Adobe AIR: da AIR Badge a SHU Player</a> (4)</li>
	<li><a href="http://www.undolog.com/2008/02/25/adobe-air-10-adobe-flex-30-e-il-nuovo-adobe-open-source/" title="Adobe AIR 1.0, Adobe Flex 3.0 e il nuovo Adobe Open Source (25 febbraio, 2008)">Adobe AIR 1.0, Adobe Flex 3.0 e il nuovo Adobe Open Source</a> (0)</li>
	<li><a href="http://www.undolog.com/2008/09/15/undolibrary-matrixarray-unestensione-della-classe-array/" title="Undolibrary MatrixArray: un&#8217;estensione della classe Array (15 settembre, 2008)">Undolibrary MatrixArray: un&#8217;estensione della classe Array</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2008/09/30/skypemote-versione-adobe-air/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Actionscript 3.0 for beginners: lesson #3</title>
		<link>http://www.undolog.com/2008/09/28/actionscript-30-for-beginners-lesson-3/</link>
		<comments>http://www.undolog.com/2008/09/28/actionscript-30-for-beginners-lesson-3/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 12:52:14 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Corso]]></category>
		<category><![CDATA[Lezione]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=698</guid>
		<description><![CDATA[Continuiamo l'analisi dell'esempio del gioco Tic Tac Toe, presentato in Actionscript 3.0 for beginners: lesson #2. Eravamo arrivati alla funzione che crea la griglia di gioco:
PLAIN TEXT
Actionscript:




/**


&#160;* Disegno graficamente la griglia (3x3) a video


&#160;*


&#160;* @param &#160; &#160; &#160; &#160;void


&#160;* @return &#160; &#160; &#160; void


&#160;* @private


&#160;*/


private function createGrid&#40;&#41;:void &#123;


&#160; &#160; // puntatore temporaneo ad uno oggetto [...]]]></description>
			<content:encoded><![CDATA[<p>Continuiamo l'analisi dell'esempio del gioco Tic Tac Toe, presentato in <em><a href="http://www.undolog.com/2008/09/03/actionscript-30-for-beginners-lesson-2/">Actionscript 3.0 for beginners: lesson #2</a></em>. Eravamo arrivati alla funzione che crea la griglia di gioco:</p>
<div class="igBar"><span id="lactionscript3-88"><a href="#" onclick="javascript:showCodeTxt('actionscript3-88'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-88">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">/**</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Disegno graficamente la griglia (3x3) a video</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* @param &nbsp; &nbsp; &nbsp; &nbsp;void</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* @return &nbsp; &nbsp; &nbsp; void</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* @private</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*/</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> createGrid<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// puntatore temporaneo ad uno oggetto MovieClip</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// nota: qui si sarebbe potuto usare anche un oggetto Sprite</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// ma in questo caso mi serve di poter estendere l'oggetto</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// aggiungendo alcune proproetà personali. L'oggetto Sprite</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// è una classe chiusa e quindi non estendibile runtime, mentre</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// la classe MovieClip è una classe dinamica e quindi rende</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// possibile l'aggiunta di proprietà runtime</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> tm<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=movieclip%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:movieclip.html"><span style="color: #004993;">MovieClip</span></a><span style="color: #000066; font-weight: bold;">,</span> i<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=uint%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:uint.html"><span style="color: #004993;">uint</span></a> = <span style="color: #000000; font-weight:bold;color:#800000;">0</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// aggiungo in uno schema 3x3 i MovieClip</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;">;</span> i <span style="color: #000066; font-weight: bold;">&lt;</span><span style="color: #000000; font-weight:bold;color:#800000;">9</span><span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; tm &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=movieclip%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:movieclip.html"><span style="color: #004993;">MovieClip</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span> tm <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; tm<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= OFFSETX<span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>i<span style="color: #000066; font-weight: bold;">%</span>3<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #000000;">&#40;</span>PLAYER_WIDTH<span style="color: #000066; font-weight: bold;">+</span>PLAYER_OFFSET<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; tm<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= OFFSETY<span style="color: #000066; font-weight: bold;">+</span><a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">floor</span><span style="color: #000000;">&#40;</span>i<span style="color: #000066; font-weight: bold;">/</span>3<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #000000;">&#40;</span>PLAYER_HEIGHT<span style="color: #000066; font-weight: bold;">+</span>PLAYER_OFFSET<span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; tm<span style="color: #000066; font-weight: bold;">.</span>_index &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = i<span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; drawPlayer<span style="color: #000000;">&#40;</span> tm<span style="color: #000066; font-weight: bold;">,</span> 0 <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// disegno le 2 linee veriticali e le 2 orizzontali</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">with</span><span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">lineStyle</span><span style="color: #000000;">&#40;</span>6<span style="color: #000066; font-weight: bold;">,</span>0x666666<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">moveTo</span><span style="color: #000000;">&#40;</span>OFFSETX<span style="color: #000066; font-weight: bold;">,</span>OFFSETY<span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span>PLAYER_HEIGHT<span style="color: #000066; font-weight: bold;">+</span>15<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">lineTo</span><span style="color: #000000;">&#40;</span>OFFSETX<span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>PLAYER_WIDTH<span style="color: #000066; font-weight: bold;">+</span>20<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span>3 <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span>OFFSETY<span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span>PLAYER_HEIGHT<span style="color: #000066; font-weight: bold;">+</span>15<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">moveTo</span><span style="color: #000000;">&#40;</span>OFFSETX<span style="color: #000066; font-weight: bold;">,</span>OFFSETY<span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span>PLAYER_HEIGHT<span style="color: #000066; font-weight: bold;">+</span>20<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span>2<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">lineTo</span><span style="color: #000000;">&#40;</span>OFFSETX<span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>PLAYER_WIDTH<span style="color: #000066; font-weight: bold;">+</span>20<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span>3 <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span>OFFSETY<span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span>PLAYER_HEIGHT<span style="color: #000066; font-weight: bold;">+</span>20<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span>2<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">moveTo</span><span style="color: #000000;">&#40;</span>OFFSETX<span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span>PLAYER_WIDTH<span style="color: #000066; font-weight: bold;">+</span>15<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span>OFFSETY<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">lineTo</span><span style="color: #000000;">&#40;</span>OFFSETX<span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span>PLAYER_WIDTH<span style="color: #000066; font-weight: bold;">+</span>15<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span>OFFSETY<span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>PLAYER_HEIGHT<span style="color: #000066; font-weight: bold;">+</span>20<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span>3 <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">moveTo</span><span style="color: #000000;">&#40;</span>OFFSETX<span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span>PLAYER_WIDTH<span style="color: #000066; font-weight: bold;">+</span>20<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span>2<span style="color: #000066; font-weight: bold;">,</span>OFFSETY<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">lineTo</span><span style="color: #000000;">&#40;</span>OFFSETX<span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span>PLAYER_WIDTH<span style="color: #000066; font-weight: bold;">+</span>20<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span>2<span style="color: #000066; font-weight: bold;">,</span>OFFSETY<span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>PLAYER_HEIGHT<span style="color: #000066; font-weight: bold;">+</span>20<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span>3 <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
<span id="more-698"></span></p>
<p>Questo meotdo svolge due compiti: aggiunge un <code>MovieClip</code> usato per intercettare il click del mouse (la casella "cerchio" o "croce") e disegna le due righe verticali e le due orizzontali rappresentati della graglia (se classiche stanghezza che si fanno con la matita). Come indicato nel commento del metodo, è stato scelto l'oggetto <code>MovieClip</code>, invece del più semplice <code>Sprite</code>, perchè quest'ultimo non permette l'aggiunta di proprietà o metodi in fase di runtime.<br />
Dopo la creazione del <code>MovieClip</code> viene chiamata una speciale funzione <code>drawPlayer()</code> che ha il compito di disegnare sul <code>MovieClip</code> vuoto appena creato uno dei giocatori (la casella "cerchio" o "croce"), in base al secondo parametro passato nel <em>Inputs</em>.</p>
<div class="igBar"><span id="lactionscript3-89"><a href="#" onclick="javascript:showCodeTxt('actionscript3-89'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-89">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">/**</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Disegna un cerchio o una croce in base al giocatore</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* @param &nbsp; &nbsp;(movieclip) &nbsp; &nbsp; &nbsp; &nbsp;p=MovieClip dove disegnare</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* @param &nbsp; &nbsp;(uint) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pl=numero del giocatore: 1 o 2 - se 0 disegna un rettangolo per intercettare l'evento click</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*/</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> drawPlayer<span style="color: #000000;">&#40;</span>p<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=movieclip%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:movieclip.html"><span style="color: #004993;">MovieClip</span></a><span style="color: #000066; font-weight: bold;">,</span> pl<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=uint%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:uint.html"><span style="color: #004993;">uint</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">switch</span><span style="color: #000000;">&#40;</span>pl<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// questo è un caso particolare: viene disegnato un rettangolo</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// usato per rilevare il click del mouse</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> 0<span style="color: #000066; font-weight: bold;">:</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">with</span><span style="color: #000000;">&#40;</span>p<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">clear</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span>CELL_EVENT_COLOR<span style="color: #000066; font-weight: bold;">,</span> CELL_EVENT_ALPHA<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span>0<span style="color: #000066; font-weight: bold;">,</span>0<span style="color: #000066; font-weight: bold;">,</span>60<span style="color: #000066; font-weight: bold;">,</span>60<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; p<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">useHandCursor</span> = p<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">buttonMode</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// aggiungo l'evento click da questa casella</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; p<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> <a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CLICK</span><span style="color: #000066; font-weight: bold;">,</span> onCellClick <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// player 1 (o)</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> 1<span style="color: #000066; font-weight: bold;">:</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">with</span><span style="color: #000000;">&#40;</span>p<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">clear</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">lineStyle</span><span style="color: #000000;">&#40;</span>PLAYER_LINE_WIDTH<span style="color: #000066; font-weight: bold;">,</span> PLAYER_1_COLOR<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">drawCircle</span><span style="color: #000000;">&#40;</span>30<span style="color: #000066; font-weight: bold;">,</span>30<span style="color: #000066; font-weight: bold;">,</span>30<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; p<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">useHandCursor</span> = p<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">buttonMode</span> = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// rimuovo l'evento click da questa casella</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; p<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CLICK</span><span style="color: #000066; font-weight: bold;">,</span> onCellClick<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// player 2 (x) &nbsp; &nbsp;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">case</span> 2<span style="color: #000066; font-weight: bold;">:</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">with</span><span style="color: #000000;">&#40;</span>p<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">clear</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">lineStyle</span><span style="color: #000000;">&#40;</span>PLAYER_LINE_WIDTH<span style="color: #000066; font-weight: bold;">,</span> PLAYER_2_COLOR<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">moveTo</span><span style="color: #000000;">&#40;</span>0<span style="color: #000066; font-weight: bold;">,</span>0<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">lineTo</span><span style="color: #000000;">&#40;</span>60<span style="color: #000066; font-weight: bold;">,</span>60<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">moveTo</span><span style="color: #000000;">&#40;</span>60<span style="color: #000066; font-weight: bold;">,</span>0<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">lineTo</span><span style="color: #000000;">&#40;</span>0<span style="color: #000066; font-weight: bold;">,</span>60<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; p<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">useHandCursor</span> = p<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">buttonMode</span> = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// rimuovo l'evento click da questa casella</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; p<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CLICK</span><span style="color: #000066; font-weight: bold;">,</span> onCellClick<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Il <code>case 0</code> corrisponde alla casella vuota. Questa circostanza si verifica all'inizializzazione del gioco: si veda infatti la chiamata a <code>drawPlayer()</code> nel metodo <code>createGrid()</code>:</p>
<div class="igBar"><span id="lactionscript3-90"><a href="#" onclick="javascript:showCodeTxt('actionscript3-90'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-90">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">drawPlayer<span style="color: #000000;">&#40;</span> tm<span style="color: #000066; font-weight: bold;">,</span> 0 <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>In questa circostanza la casella è pronta a rispondere agli input utente. Viene infatti aggiunto un listener per intercettare l'evento click del mouse. Notare che quando viene disegnato uno dei due giocatori (caso 1 e 2, giocatore "cerchio" e "croce"), il listener viene semplicemente rimosso, così da evitare una "doppia giocata"!</p>
<h4>Eventi</h4>
<p>Come abbiamo visto sopra, la casella "vuota" risponde all'evento click del mouse:</p>
<div class="igBar"><span id="lactionscript3-91"><a href="#" onclick="javascript:showCodeTxt('actionscript3-91'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-91">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">/**</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Questo evento viene rilasciato quando si fa click su una cella di gioco</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*/</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onCellClick<span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a> = <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// controllo che il gioco non sia in pausa o bloccato</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> <span style="color: #000066; font-weight: bold;">!</span>__stop <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// incremento il contatore dei click</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; __clickNumber<span style="color: #000066; font-weight: bold;">++;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// prelevo il puntatore al player &quot;cliccato&quot;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> p<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=movieclip%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:movieclip.html"><span style="color: #004993;">MovieClip</span></a> = e<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">currentTarget</span> <span style="color: #0033ff; font-weight: bold;">as</span> <a href="http://www.google.com/search?q=movieclip%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:movieclip.html"><span style="color: #004993;">MovieClip</span></a><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// disegno (o) o (x)</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; drawPlayer<span style="color: #000000;">&#40;</span> p<span style="color: #000066; font-weight: bold;">,</span> __player <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// riflette la giocata nell'array lineare</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; __cell<span style="color: #000000;">&#91;</span>p<span style="color: #000066; font-weight: bold;">.</span>_index<span style="color: #000000;">&#93;</span> = <span style="color: #000000;">&#40;</span>__player==1<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">?</span>PLAYER_1_WIN<span style="color: #000066; font-weight: bold;">:</span>PLAYER_2_WIN<span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// controllo se qualcuno ha vinto</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; checkCell<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// cambio turno: se ha giocato il player 1 imposto il player 2 e viceversa</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; __player = <span style="color: #000000;">&#40;</span>__player==1<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">?</span>2<span style="color: #000066; font-weight: bold;">:</span><span style="color: #000000; font-weight:bold;color:#800000;">1</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// segnalo a video il nuovo turno del giocatore</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; turno_txt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;PLAYER &quot;</span><span style="color: #000066; font-weight: bold;">+</span>__player<span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Il flag <code>__stop</code>, che corrisponde ad una variabile globale all'interno della nostra classe, è una tecnica standard che consente di controllare lo stato del gioco. Nel nostro caso l'ho usata per distinguere la modalità "gioco" <code>__stop = false</code>, e la modalità "in pausa" <code>__stop = true</code>. Quando scatta l'evento <code>onCellClick()</code>, al click del mouse sulla casella, controllo appunto che il gioco non sia "in pausa". Se stiamo giocando incremento la variabile <code>__clickNumber</code> che tiene conto del numero di click (o di giocate) effettuate. Questo "contatore" ci tornerà utile più avanti per capire se tutte le caselle sono state selezionate.<br />
Tramite la proprietà <code>e.currentTarget</code> recupero il puntatore alla casella su cui si è effettuato il click e su questa disegno uno dei due possibili segni ("cerchio" o "croce") in base al giocatore attivo indicato in <code>__player</code>; utilizzando sempre il meotdo <code>drawPlayer()</code>. La riga:</p>
<div class="igBar"><span id="lactionscript3-92"><a href="#" onclick="javascript:showCodeTxt('actionscript3-92'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-92">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">__cell<span style="color: #000000;">&#91;</span>p<span style="color: #000066; font-weight: bold;">.</span>_index<span style="color: #000000;">&#93;</span> = <span style="color: #000000;">&#40;</span>__player==1<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">?</span>PLAYER_1_WIN<span style="color: #000066; font-weight: bold;">:</span>PLAYER_2_WIN<span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>è importante in quanto riflette la giocata nell'array logico lineare usato - come vedremo più avanti - per determinare la vincita di uno dei due giocatori. Le costanti <code>PLAYER_1_WIN</code> (valore 1) e <code>PLAYER_2_WIN</code> (valore 10) indicano nell'array lineare chi ha effettuato la giocata.</p>
<blockquote><p>Vedi per ulteriori informazioni: <em><a href="http://www.undolog.com/2008/09/15/undolibrary-matrixarray-unestensione-della-classe-array/">Undolibrary MatrixArray: un’estensione della classe Array</a></em></p>
</blockquote>
<h4>checkCell(): the core</h4>
<p>Deichiamo un paragrafo a questo metodo essendo, nel contesto di questo esempio, il vero cuore del gioco. Il metodo <code>checkCell()</code>, infatti, controlla se c'è stata una vincita da parte di uno dei due giocatori:</p>
<div class="igBar"><span id="lactionscript3-93"><a href="#" onclick="javascript:showCodeTxt('actionscript3-93'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-93">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">/**</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Questa funzione controlla l'array per verificare se qualche</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* giocatore ha vinto. Viene chiamata ogni volta che un giocatore</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* segna una casella con una (x) o un (o).</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Inoltre se la variabile __clickNumber è uguale a 9, significa</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* che tutte le caselle sono stati riempite e, non essendoci nessun</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* vincitore, nessuno ha vinto!</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* @private</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*/</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> checkCell<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// in base al valore di __player viene impostato il</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// valore di controllo per verificare una vincita</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> winValue<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=uint%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:uint.html"><span style="color: #004993;">uint</span></a> &nbsp; &nbsp; = <span style="color: #000000;">&#40;</span>__player==1<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">?</span>3<span style="color: #000066; font-weight: bold;">*</span>PLAYER_1_WIN<span style="color: #000066; font-weight: bold;">:</span>3<span style="color: #000066; font-weight: bold;">*</span>PLAYER_2_WIN<span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// controlla tutte le righe, colonne e le due diagonali</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">c</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=array%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:array.html"><span style="color: #004993;">Array</span></a> = __cell<span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// controllo le prime 3 righe</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>0<span style="color: #000000;">&#93;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>1<span style="color: #000000;">&#93;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>2<span style="color: #000000;">&#93;</span> == winValue <span style="color: #000066; font-weight: bold;">||</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>3<span style="color: #000000;">&#93;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>4<span style="color: #000000;">&#93;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>5<span style="color: #000000;">&#93;</span> == winValue <span style="color: #000066; font-weight: bold;">||</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>6<span style="color: #000000;">&#93;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>7<span style="color: #000000;">&#93;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>8<span style="color: #000000;">&#93;</span> == winValue <span style="color: #000066; font-weight: bold;">||</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// le 3 colonne</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>0<span style="color: #000000;">&#93;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>3<span style="color: #000000;">&#93;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>6<span style="color: #000000;">&#93;</span> == winValue <span style="color: #000066; font-weight: bold;">||</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>1<span style="color: #000000;">&#93;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>4<span style="color: #000000;">&#93;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>7<span style="color: #000000;">&#93;</span> == winValue <span style="color: #000066; font-weight: bold;">||</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>2<span style="color: #000000;">&#93;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>5<span style="color: #000000;">&#93;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>8<span style="color: #000000;">&#93;</span> == winValue <span style="color: #000066; font-weight: bold;">||</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// le 2 diagonali</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>0<span style="color: #000000;">&#93;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>4<span style="color: #000000;">&#93;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>8<span style="color: #000000;">&#93;</span> == winValue <span style="color: #000066; font-weight: bold;">||</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>2<span style="color: #000000;">&#93;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span>4<span style="color: #000000;">&#93;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #004993;">c</span><span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;color:#800000;">6</span><span style="color: #000000;">&#93;</span> == winValue <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// se una di queste condizioni è verificata</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// qualcuno ha vinto e mostro quindi il pannello</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// di &quot;vittoria&quot; (1)</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; showPanel<span style="color: #000000;">&#40;</span>1<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// se nessuno ha vinto, controllo se tutte le caselle</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// sono piene. In caso affermativo mostro il pannello</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// di fine partita e &quot;nessun vincitore&quot; (0)</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> __clickNumber == 9 <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; showPanel<span style="color: #000000;">&#40;</span>0<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Il metodo, nella sua semplicità, si commenta da solo. Esso viene richiamato ad ogni click sulla scacchiera decidendo le sorti del gioco! L'array logico viene utilizzato per "sommare" righe, colonne e diagonali alla ricerca di un possibile "tris" da parte del giocatore attuale, indicato dalla variabile <code>__player</code>. Inoltre, come può accadere, <code>__clickNumber</code> tiene conto dei click effettuati. Questa variabile non dovrebbe mai raggiungere il valore 9, a meno che nessuno dei due giocatori ha vinto.</p>
<p>La prossima volta esamineremo alcune caratteristiche specifiche del linguaggio Actionscript 3.0 usate in questa demo.</p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F28%2Factionscript-30-for-beginners-lesson-3%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%233&amp;bodytext=Continuiamo%20l%27analisi%20dell%27esempio%20del%20gioco%20Tic%20Tac%20Toe%2C%20presentato%20in%20Actionscript%203.0%20for%20beginners%3A%20lesson%20%232.%20Eravamo%20arrivati%20alla%20funzione%20che%20crea%20la%20griglia%20di%20gioco%3A%0D%0A%5Bas%5D%0D%0A%2F%2A%2A%0D%0A%20%2A%20Disegno%20graficamente%20la%20griglia%20%283x3%29%20a%20video%0D%0A%20%2A%0D%0A%20%2A%20%40para" title="Digg"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F28%2Factionscript-30-for-beginners-lesson-3%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%233&amp;notes=Continuiamo%20l%27analisi%20dell%27esempio%20del%20gioco%20Tic%20Tac%20Toe%2C%20presentato%20in%20Actionscript%203.0%20for%20beginners%3A%20lesson%20%232.%20Eravamo%20arrivati%20alla%20funzione%20che%20crea%20la%20griglia%20di%20gioco%3A%0D%0A%5Bas%5D%0D%0A%2F%2A%2A%0D%0A%20%2A%20Disegno%20graficamente%20la%20griglia%20%283x3%29%20a%20video%0D%0A%20%2A%0D%0A%20%2A%20%40para" title="del.icio.us"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F28%2Factionscript-30-for-beginners-lesson-3%2F" title="Technorati"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F28%2Factionscript-30-for-beginners-lesson-3%2F&amp;t=Actionscript%203.0%20for%20beginners%3A%20lesson%20%233" title="Facebook"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F28%2Factionscript-30-for-beginners-lesson-3%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%233&amp;annotation=Continuiamo%20l%27analisi%20dell%27esempio%20del%20gioco%20Tic%20Tac%20Toe%2C%20presentato%20in%20Actionscript%203.0%20for%20beginners%3A%20lesson%20%232.%20Eravamo%20arrivati%20alla%20funzione%20che%20crea%20la%20griglia%20di%20gioco%3A%0D%0A%5Bas%5D%0D%0A%2F%2A%2A%0D%0A%20%2A%20Disegno%20graficamente%20la%20griglia%20%283x3%29%20a%20video%0D%0A%20%2A%0D%0A%20%2A%20%40para" title="Google Bookmarks"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Actionscript%203.0%20for%20beginners%3A%20lesson%20%233%20-%20http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F28%2Factionscript-30-for-beginners-lesson-3%2F" title="Twitter"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://barrapunto.com/submit.pl?subj=Actionscript%203.0%20for%20beginners%3A%20lesson%20%233&amp;story=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F28%2Factionscript-30-for-beginners-lesson-3%2F" title="BarraPunto"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/barrapunto.png" title="BarraPunto" alt="BarraPunto" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://current.com/clipper.htm?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F28%2Factionscript-30-for-beginners-lesson-3%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%233" title="Current"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Actionscript%203.0%20for%20beginners%3A%20lesson%20%233&amp;body=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F28%2Factionscript-30-for-beginners-lesson-3%2F" title="email"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%233&amp;link=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F28%2Factionscript-30-for-beginners-lesson-3%2F" title="FriendFeed"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F28%2Factionscript-30-for-beginners-lesson-3%2F&amp;headline=Actionscript%203.0%20for%20beginners%3A%20lesson%20%233&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F28%2Factionscript-30-for-beginners-lesson-3%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%233&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Continuiamo%20l%27analisi%20dell%27esempio%20del%20gioco%20Tic%20Tac%20Toe%2C%20presentato%20in%20Actionscript%203.0%20for%20beginners%3A%20lesson%20%232.%20Eravamo%20arrivati%20alla%20funzione%20che%20crea%20la%20griglia%20di%20gioco%3A%0D%0A%5Bas%5D%0D%0A%2F%2A%2A%0D%0A%20%2A%20Disegno%20graficamente%20la%20griglia%20%283x3%29%20a%20video%0D%0A%20%2A%0D%0A%20%2A%20%40para" title="LinkedIn"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F28%2Factionscript-30-for-beginners-lesson-3%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%233" title="Live"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F28%2Factionscript-30-for-beginners-lesson-3%2F&amp;t=Actionscript%203.0%20for%20beginners%3A%20lesson%20%233" title="MySpace"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%233&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F28%2Factionscript-30-for-beginners-lesson-3%2F" title="Netvibes"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F28%2Factionscript-30-for-beginners-lesson-3%2F&amp;partner=sociable" title="Print"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.undolog.com/feed/" title="RSS"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://segnalo.alice.it/post.html.php?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F28%2Factionscript-30-for-beginners-lesson-3%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%233" title="Segnalo"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/segnalo.png" title="Segnalo" alt="Segnalo" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F28%2Factionscript-30-for-beginners-lesson-3%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%233" title="StumbleUpon"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.it/vote?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F28%2Factionscript-30-for-beginners-lesson-3%2F" title="Wikio IT"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio IT" alt="Wikio IT" class="sociable-hovers" /></a>


<br/><br/>
	Tags: <a href="http://www.undolog.com/category/sviluppo/flash-cs3/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/corso/" title="Corso" rel="tag">Corso</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/tag/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/category/sviluppo/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/lezione/" title="Lezione" rel="tag">Lezione</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/tag/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/category/tutorials/" title="Tutorials" rel="tag">Tutorials</a>, <a href="http://www.undolog.com/tag/tutorials/" title="Tutorials" rel="tag">Tutorials</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2009/01/22/actionscript-30-for-beginners-lesson-5/" title="Actionscript 3.0 for beginners: lesson #5 (22 gennaio, 2009)">Actionscript 3.0 for beginners: lesson #5</a> (4)</li>
	<li><a href="http://www.undolog.com/2008/11/11/actionscript-30-for-beginners-lesson-4/" title="Actionscript 3.0 for beginners: lesson #4 (11 novembre, 2008)">Actionscript 3.0 for beginners: lesson #4</a> (3)</li>
	<li><a href="http://www.undolog.com/2008/09/03/actionscript-30-for-beginners-lesson-2/" title="Actionscript 3.0 for beginners: lesson #2 (3 settembre, 2008)">Actionscript 3.0 for beginners: lesson #2</a> (4)</li>
	<li><a href="http://www.undolog.com/2008/08/08/actionscript-30-for-beginners-lesson-1/" title="Actionscript 3.0 for beginners: lesson #1 (8 agosto, 2008)">Actionscript 3.0 for beginners: lesson #1</a> (9)</li>
	<li><a href="http://www.undolog.com/2008/06/04/flash-cs3-creare-un-effetto-reflex-su-qualsiasi-movieclip/" title="Flash CS3: creare un effetto Reflex su qualsiasi MovieClip (4 giugno, 2008)">Flash CS3: creare un effetto Reflex su qualsiasi MovieClip</a> (12)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2008/09/28/actionscript-30-for-beginners-lesson-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Undolibrary MatrixArray: un&#8217;estensione della classe Array</title>
		<link>http://www.undolog.com/2008/09/15/undolibrary-matrixarray-unestensione-della-classe-array/</link>
		<comments>http://www.undolog.com/2008/09/15/undolibrary-matrixarray-unestensione-della-classe-array/#comments</comments>
		<pubDate>Mon, 15 Sep 2008 13:35:34 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tecnologia]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[Google Code]]></category>
		<category><![CDATA[Matrici]]></category>
		<category><![CDATA[Matrix]]></category>
		<category><![CDATA[MatrixArray]]></category>
		<category><![CDATA[Undolibrary]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=658</guid>
		<description><![CDATA[MatrixArray è un'estensione della classe Array di Actionscript 3.0, con lo scopo di semplificare la manipolazione di Array lineari usati come matrice n x m. Questa classe fa parte della libreria Undolibrary (nel package undolibrary.utils.MatrixArray) che potete scaricaricare liberamente da Google code tramite un qualsiasi client SVN (Subversion) all'indirizzo:
svn checkout http://undolibrary.googlecode.com/svn/trunk/
In alternativa potete scaricare il [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://code.google.com/p/undolibrary/source/browse/trunk/as3/undolibrary/utils/MatrixArray.as"><code>MatrixArray</code></a> è un'estensione della classe <code>Array</code> di Actionscript 3.0, con lo scopo di semplificare la manipolazione di <code>Array</code> lineari usati come matrice <em>n</em> x <em>m</em>. Questa classe fa parte della libreria <a href="http://code.google.com/p/undolibrary/" target="_blank">Undolibrary</a> (nel package <code>undolibrary.utils.MatrixArray</code>) che potete scaricaricare liberamente da Google code tramite un qualsiasi client SVN (Subversion) all'indirizzo:<br />
<code>svn checkout http://undolibrary.googlecode.com/svn/trunk/</code><br />
In alternativa potete scaricare il solo file <a href="http://undolibrary.googlecode.com/svn/trunk/as3/undolibrary/utils/MatrixArray.as" target="_blank">MatrixArray.as</a>. Un'esempio dell'uso di matrici lineari è stato dato in <a href="http://www.undolog.com/2008/09/03/actionscript-30-for-beginners-lesson-2/"><em>Actionscript 3.0 for beginners: lesson #2</em></a> dove abbiamo visto un suo semplice uso nella realizzazione del classico game Tic Tac Toe. Una matrice di questo tipo è paragonabile ad un'area rettangolare (<code>w</code>x<code>h</code>), proprio come una scacchiera. Con questa classe è possibile trattare una matrice di questo tipo proprio come un reticolo con delle sue coordinate <em>x</em> ed <em>y</em>. La <a target="_blank" href="http://code.google.com/p/undolibrary/source/browse/trunk/as3/undolibrary/utils/MatrixArray.as"><code>MatrixArray</code></a> l'ho usata, ad esempio, nello sviluppo di tutta la logica dell'editor di Emotions Icons per Skype: <a href="http://www.skypemote.com" target="_blank">Skypemote</a>.</p>
<p><span id="more-658"></span></p>
<h4>Metodi</h4>
<p>La classe <a target="_blank" href="http://code.google.com/p/undolibrary/source/browse/trunk/as3/undolibrary/utils/MatrixArray.as"><code>MatrixArray</code></a> estende quindi la normale classe <code>Array</code> aggiungendo una serie di utili metodi per gestire e manipolare matrici <em>n</em> x <em>m</em>. Per creare una matrice <em>n</em> x <em>m</em> è sufficente usare:</p>
<div class="igBar"><span id="lactionscript3-103"><a href="#" onclick="javascript:showCodeTxt('actionscript3-103'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-103">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">// importanzione della classe - se avete scaricato l'intera libreria Undolibrary</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">// in alternativa potete scaricare solo il file MatrixArray.as e usarlo da solo</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">import</span> undolibrary<span style="color: #000066; font-weight: bold;">.</span>utils<span style="color: #000066; font-weight: bold;">.</span>MatrixArray<span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">//</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> ma<span style="color: #000066; font-weight: bold;">:</span>MatrixArray = <span style="color: #0033ff; font-weight: bold;">new</span> MatrixArray<span style="color: #000000;">&#40;</span>10<span style="color: #000066; font-weight: bold;">,</span> 10<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Creata la matrice 10x10, come nel precedente esempio, possiamo manipolarla con utili metodi che rendono il nostro lavoro estremamente più rapido e semplice. In effetti la matrice 10x10 non è altro che un semplice Array lineare di 100 elementi!</p>
<h4>clip()</h4>
<div class="igBar"><span id="lactionscript3-104"><a href="#" onclick="javascript:showCodeTxt('actionscript3-104'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-104">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">/**</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Restitusice un porzione rettangolare della matrice nella forma MatrixArray</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* @param &nbsp; &nbsp;(uint) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sx Coordina x del taglio</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* @param &nbsp; &nbsp;(uint) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sy Coordina y del taglio</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* @param &nbsp; &nbsp;(uint) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cw Dimensione orizzontale del taglio</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* @param &nbsp; &nbsp;(uint) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ch Dimensione verticale del taglio</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* @result &nbsp; &nbsp;(MatrixArray) &nbsp; &nbsp;Una nuova matrice cw x ch</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*/</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">clip<span style="color: #000000;">&#40;</span>sx<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=uint%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:uint.html"><span style="color: #004993;">uint</span></a><span style="color: #000066; font-weight: bold;">,</span> sy<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=uint%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:uint.html"><span style="color: #004993;">uint</span></a><span style="color: #000066; font-weight: bold;">,</span> cw<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=uint%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:uint.html"><span style="color: #004993;">uint</span></a><span style="color: #000066; font-weight: bold;">,</span> ch<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=uint%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:uint.html"><span style="color: #004993;">uint</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span>MatrixArray</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">// esempio</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">// crea una nuova MatrixArray dalle coordinate 2,2 e larga e alta 5</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> nma<span style="color: #000066; font-weight: bold;">:</span>MatrixArray = ma<span style="color: #000066; font-weight: bold;">.</span>clip<span style="color: #000000;">&#40;</span>2<span style="color: #000066; font-weight: bold;">,</span> 2<span style="color: #000066; font-weight: bold;">,</span> 5<span style="color: #000066; font-weight: bold;">,</span> 5<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h4>fill()</h4>
<div class="igBar"><span id="lactionscript3-105"><a href="#" onclick="javascript:showCodeTxt('actionscript3-105'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-105">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">/**</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Riempie la matrice con un determinato valore</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* @param &nbsp; &nbsp;(any) &nbsp; &nbsp;Valore da inserire nella matrice</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*/</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">fill<span style="color: #000000;">&#40;</span>v<span style="color: #000066; font-weight: bold;">:*</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h4>paintChar()</h4>
<div class="igBar"><span id="lactionscript3-106"><a href="#" onclick="javascript:showCodeTxt('actionscript3-106'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-106">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">/** </span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Riempie la matrice con un (solo) carattere prelevato da una stringa</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* di lunghezza pari alle dimensioni della matrice stessa</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* @param &nbsp; &nbsp;(string) &nbsp; &nbsp;v Stringa con la serie di caratteri da mappare</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* @result &nbsp; &nbsp;(boolean) &nbsp; &nbsp;true ok, false errore: stringa di lunghezza errata</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*/</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">paintChar<span style="color: #000000;">&#40;</span>v<span style="color: #000066; font-weight: bold;">:</span>string<span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">// esempio</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> ma<span style="color: #000066; font-weight: bold;">:</span>MatrixArray = <span style="color: #0033ff; font-weight: bold;">new</span> MatrixArray<span style="color: #000000;">&#40;</span>10<span style="color: #000066; font-weight: bold;">,</span>5<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">ma<span style="color: #000066; font-weight: bold;">.</span>paintChar<span style="color: #000000;">&#40;</span> </div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #990000;">'**********'</span><span style="color: #000066; font-weight: bold;">+</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #990000;">'**##**##**'</span><span style="color: #000066; font-weight: bold;">+</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #990000;">'**********'</span><span style="color: #000066; font-weight: bold;">+</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #990000;">'**#####**'</span><span style="color: #000066; font-weight: bold;">+</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #990000;">'**********'</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h4>flipH(), flipV()</h4>
<div class="igBar"><span id="lactionscript3-107"><a href="#" onclick="javascript:showCodeTxt('actionscript3-107'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-107">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">/**</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Esegue un'operazione di riflessione orizziontale(flipH) o </span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* vertical (flipV) direttamente sulla matrice</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*/</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">flipH<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">flipV<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h4>move()</h4>
<div class="igBar"><span id="lactionscript3-108"><a href="#" onclick="javascript:showCodeTxt('actionscript3-108'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-108">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">/**</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Sposta il contenuto della matrice (eseguendo uno shift) nelle quattro</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* direzione di un offeset prestabilito</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*/</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">move<span style="color: #000000;">&#40;</span>ox<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=int%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:int.html"><span style="color: #004993;">int</span></a><span style="color: #000066; font-weight: bold;">,</span> oy<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=int%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:int.html"><span style="color: #004993;">int</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">//</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> ma<span style="color: #000066; font-weight: bold;">:</span>MatrixArray = <span style="color: #0033ff; font-weight: bold;">new</span> MatrixArray<span style="color: #000000;">&#40;</span>10<span style="color: #000066; font-weight: bold;">,</span>5<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">ma<span style="color: #000066; font-weight: bold;">.</span>paintChar<span style="color: #000000;">&#40;</span> </div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #990000;">'**********'</span><span style="color: #000066; font-weight: bold;">+</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #990000;">'**##**##**'</span><span style="color: #000066; font-weight: bold;">+</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #990000;">'**********'</span><span style="color: #000066; font-weight: bold;">+</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #990000;">'**#####**'</span><span style="color: #000066; font-weight: bold;">+</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #990000;">'**********'</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">ma<span style="color: #000066; font-weight: bold;">.</span>move<span style="color: #000000;">&#40;</span>2<span style="color: #000066; font-weight: bold;">,</span>4<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900; font-style: italic;">// output</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000066; font-weight: bold;">****</span>##<span style="color: #000066; font-weight: bold;">**</span>##</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000066; font-weight: bold;">**********</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000066; font-weight: bold;">****</span>#####</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000066; font-weight: bold;">**********</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000066; font-weight: bold;">**********</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h4>peek()</h4>
<div class="igBar"><span id="lactionscript3-109"><a href="#" onclick="javascript:showCodeTxt('actionscript3-109'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-109">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">/**</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Restituisce il contenuto della matrice alle coordinate x, y</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*/</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">peek<span style="color: #000000;">&#40;</span><span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=uint%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:uint.html"><span style="color: #004993;">uint</span></a><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=uint%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:uint.html"><span style="color: #004993;">uint</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:*</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h4>poke()</h4>
<div class="igBar"><span id="lactionscript3-110"><a href="#" onclick="javascript:showCodeTxt('actionscript3-110'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-110">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">/**</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Imposta il contenuto della matrice alle coordinate x, y</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*/</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">poke<span style="color: #000000;">&#40;</span><span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=uint%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:uint.html"><span style="color: #004993;">uint</span></a><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=uint%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:uint.html"><span style="color: #004993;">uint</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h4>getString()</h4>
<div class="igBar"><span id="lactionscript3-111"><a href="#" onclick="javascript:showCodeTxt('actionscript3-111'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-111">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">/**</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Usato spesso per il debug restituisce la matrice nxm come stringa</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*/</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">getString<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F15%2Fundolibrary-matrixarray-unestensione-della-classe-array%2F&amp;title=Undolibrary%20MatrixArray%3A%20un%27estensione%20della%20classe%20Array&amp;bodytext=MatrixArray%20%C3%A8%20un%27estensione%20della%20classe%20Array%20di%20Actionscript%203.0%2C%20con%20lo%20scopo%20di%20semplificare%20la%20manipolazione%20di%20Array%20lineari%20usati%20come%20matrice%20n%20x%20m.%20Questa%20classe%20fa%20parte%20della%20libreria%20Undolibrary%20%28nel%20package%20undolibrary.utils.MatrixArray" title="Digg"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F15%2Fundolibrary-matrixarray-unestensione-della-classe-array%2F&amp;title=Undolibrary%20MatrixArray%3A%20un%27estensione%20della%20classe%20Array&amp;notes=MatrixArray%20%C3%A8%20un%27estensione%20della%20classe%20Array%20di%20Actionscript%203.0%2C%20con%20lo%20scopo%20di%20semplificare%20la%20manipolazione%20di%20Array%20lineari%20usati%20come%20matrice%20n%20x%20m.%20Questa%20classe%20fa%20parte%20della%20libreria%20Undolibrary%20%28nel%20package%20undolibrary.utils.MatrixArray" title="del.icio.us"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F15%2Fundolibrary-matrixarray-unestensione-della-classe-array%2F" title="Technorati"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F15%2Fundolibrary-matrixarray-unestensione-della-classe-array%2F&amp;t=Undolibrary%20MatrixArray%3A%20un%27estensione%20della%20classe%20Array" title="Facebook"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F15%2Fundolibrary-matrixarray-unestensione-della-classe-array%2F&amp;title=Undolibrary%20MatrixArray%3A%20un%27estensione%20della%20classe%20Array&amp;annotation=MatrixArray%20%C3%A8%20un%27estensione%20della%20classe%20Array%20di%20Actionscript%203.0%2C%20con%20lo%20scopo%20di%20semplificare%20la%20manipolazione%20di%20Array%20lineari%20usati%20come%20matrice%20n%20x%20m.%20Questa%20classe%20fa%20parte%20della%20libreria%20Undolibrary%20%28nel%20package%20undolibrary.utils.MatrixArray" title="Google Bookmarks"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Undolibrary%20MatrixArray%3A%20un%27estensione%20della%20classe%20Array%20-%20http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F15%2Fundolibrary-matrixarray-unestensione-della-classe-array%2F" title="Twitter"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://barrapunto.com/submit.pl?subj=Undolibrary%20MatrixArray%3A%20un%27estensione%20della%20classe%20Array&amp;story=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F15%2Fundolibrary-matrixarray-unestensione-della-classe-array%2F" title="BarraPunto"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/barrapunto.png" title="BarraPunto" alt="BarraPunto" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://current.com/clipper.htm?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F15%2Fundolibrary-matrixarray-unestensione-della-classe-array%2F&amp;title=Undolibrary%20MatrixArray%3A%20un%27estensione%20della%20classe%20Array" title="Current"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Undolibrary%20MatrixArray%3A%20un%27estensione%20della%20classe%20Array&amp;body=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F15%2Fundolibrary-matrixarray-unestensione-della-classe-array%2F" title="email"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Undolibrary%20MatrixArray%3A%20un%27estensione%20della%20classe%20Array&amp;link=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F15%2Fundolibrary-matrixarray-unestensione-della-classe-array%2F" title="FriendFeed"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F15%2Fundolibrary-matrixarray-unestensione-della-classe-array%2F&amp;headline=Undolibrary%20MatrixArray%3A%20un%27estensione%20della%20classe%20Array&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F15%2Fundolibrary-matrixarray-unestensione-della-classe-array%2F&amp;title=Undolibrary%20MatrixArray%3A%20un%27estensione%20della%20classe%20Array&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=MatrixArray%20%C3%A8%20un%27estensione%20della%20classe%20Array%20di%20Actionscript%203.0%2C%20con%20lo%20scopo%20di%20semplificare%20la%20manipolazione%20di%20Array%20lineari%20usati%20come%20matrice%20n%20x%20m.%20Questa%20classe%20fa%20parte%20della%20libreria%20Undolibrary%20%28nel%20package%20undolibrary.utils.MatrixArray" title="LinkedIn"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F15%2Fundolibrary-matrixarray-unestensione-della-classe-array%2F&amp;title=Undolibrary%20MatrixArray%3A%20un%27estensione%20della%20classe%20Array" title="Live"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F15%2Fundolibrary-matrixarray-unestensione-della-classe-array%2F&amp;t=Undolibrary%20MatrixArray%3A%20un%27estensione%20della%20classe%20Array" title="MySpace"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Undolibrary%20MatrixArray%3A%20un%27estensione%20della%20classe%20Array&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F15%2Fundolibrary-matrixarray-unestensione-della-classe-array%2F" title="Netvibes"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F15%2Fundolibrary-matrixarray-unestensione-della-classe-array%2F&amp;partner=sociable" title="Print"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.undolog.com/feed/" title="RSS"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://segnalo.alice.it/post.html.php?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F15%2Fundolibrary-matrixarray-unestensione-della-classe-array%2F&amp;title=Undolibrary%20MatrixArray%3A%20un%27estensione%20della%20classe%20Array" title="Segnalo"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/segnalo.png" title="Segnalo" alt="Segnalo" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F15%2Fundolibrary-matrixarray-unestensione-della-classe-array%2F&amp;title=Undolibrary%20MatrixArray%3A%20un%27estensione%20della%20classe%20Array" title="StumbleUpon"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.it/vote?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F15%2Fundolibrary-matrixarray-unestensione-della-classe-array%2F" title="Wikio IT"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio IT" alt="Wikio IT" class="sociable-hovers" /></a>


<br/><br/>
	Tags: <a href="http://www.undolog.com/category/sviluppo/flash-cs3/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/array/" title="Array" rel="tag">Array</a>, <a href="http://www.undolog.com/category/sviluppo/flash/" title="Flash" rel="tag">Flash</a>, <a href="http://www.undolog.com/tag/flash/" title="Flash" rel="tag">Flash</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/tag/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/tag/google-code/" title="Google Code" rel="tag">Google Code</a>, <a href="http://www.undolog.com/category/sviluppo/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/matrici/" title="Matrici" rel="tag">Matrici</a>, <a href="http://www.undolog.com/tag/matrix/" title="Matrix" rel="tag">Matrix</a>, <a href="http://www.undolog.com/tag/matrixarray/" title="MatrixArray" rel="tag">MatrixArray</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/tag/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/category/tecnologia/" title="Tecnologia" rel="tag">Tecnologia</a>, <a href="http://www.undolog.com/tag/undolibrary/" title="Undolibrary" rel="tag">Undolibrary</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2008/06/04/flash-cs3-creare-un-effetto-reflex-su-qualsiasi-movieclip/" title="Flash CS3: creare un effetto Reflex su qualsiasi MovieClip (4 giugno, 2008)">Flash CS3: creare un effetto Reflex su qualsiasi MovieClip</a> (12)</li>
	<li><a href="http://www.undolog.com/2009/02/16/very-short-snippet-shuffle-in-javascript-e-actionscript/" title="Very short snippet: shuffle() in Javascript e Actionscript (16 febbraio, 2009)">Very short snippet: shuffle() in Javascript e Actionscript</a> (3)</li>
	<li><a href="http://www.undolog.com/2008/02/01/yahoo-astra-suite-di-componenti-per-flash-e-flex/" title="Yahoo! ASTRA: suite di componenti per Flash e Flex (1 febbraio, 2008)">Yahoo! ASTRA: suite di componenti per Flash e Flex</a> (0)</li>
	<li><a href="http://www.undolog.com/2009/04/02/very-short-snippet-estendere-un-array-actionscript-con-il-metodo-shuffle/" title="Very short snippet: estendere un array Actionscript con il metodo shuffle() (2 aprile, 2009)">Very short snippet: estendere un array Actionscript con il metodo shuffle()</a> (2)</li>
	<li><a href="http://www.undolog.com/2008/05/28/undolibrary-libreria-actionscript-30-su-google-code/" title="undolibrary: libreria Actionscript 3.0 su Google Code (28 maggio, 2008)">undolibrary: libreria Actionscript 3.0 su Google Code</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2008/09/15/undolibrary-matrixarray-unestensione-della-classe-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActionScript 3.0: lo sapevate che&#8230;</title>
		<link>http://www.undolog.com/2008/09/10/actionscript-30-lo-sapevate-che/</link>
		<comments>http://www.undolog.com/2008/09/10/actionscript-30-lo-sapevate-che/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 21:52:41 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Sviluppo]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=642</guid>
		<description><![CDATA[Alcune curiosità su Actionscript 3.0 non sempre note...
trace()
L'istruzione trace(), usata per il debug, ora supporta più parametri:
PLAIN TEXT
Actionscript:




trace&#40; a, b, c &#41;;






eval()
L'istruzione eval() è stata eliminata in Actionscript 3.0. Tuttavia visto che è possibile accedere a proprietà e metodi di un oggetto anche con la sintassi usata per accedere agli elementi di un array, si [...]]]></description>
			<content:encoded><![CDATA[<p>Alcune curiosità su Actionscript 3.0 non sempre note...</p>
<h4>trace()</h4>
<p>L'istruzione <code>trace()</code>, usata per il debug, ora supporta più parametri:</p>
<div class="igBar"><span id="lactionscript3-115"><a href="#" onclick="javascript:showCodeTxt('actionscript3-115'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-115">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span> a<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">b</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">c</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h4>eval()</h4>
<p>L'istruzione <code>eval()</code> è stata eliminata in Actionscript 3.0. Tuttavia visto che è possibile accedere a proprietà e metodi di un oggetto anche con la sintassi usata per accedere agli elementi di un array, si può in alcune circostanze "simulare" - in qualche modo - l'istruzione <code>eval()</code>:</p>
<div class="igBar"><span id="lactionscript3-116"><a href="#" onclick="javascript:showCodeTxt('actionscript3-116'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-116">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #6699cc; font-weight: bold;">var</span> coo<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> = <span style="color: #000000;">&#40;</span>muoviX<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">?</span><span style="color: #990000;">'x'</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #990000;">'y'</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">myMovieClip<span style="color: #000000;">&#91;</span>coo<span style="color: #000000;">&#93;</span> = <span style="color: #000000; font-weight:bold;color:#800000;">20</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h4>super()</h4>
<p>La chiamata alla superclasse, tramite <code>super()</code>, non è più vincolata alla prima istruzione nel costruttore di una sottoclasse. Ora si può chiamare <code>super()</code> in qualsiasi punto del costruttore:</p>
<div class="igBar"><span id="lactionscript3-117"><a href="#" onclick="javascript:showCodeTxt('actionscript3-117'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-117">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> MiaClasse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp;initOne<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp;<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp;initTwo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F10%2Factionscript-30-lo-sapevate-che%2F&amp;title=ActionScript%203.0%3A%20lo%20sapevate%20che...&amp;bodytext=Alcune%20curiosit%C3%A0%20su%20Actionscript%203.0%20non%20sempre%20note...%0D%0Atrace%28%29%0D%0AL%27istruzione%20trace%28%29%2C%20usata%20per%20il%20debug%2C%20ora%20supporta%20pi%C3%B9%20parametri%3A%0D%0A%5Bas%5D%0D%0Atrace%28%20a%2C%20b%2C%20c%20%29%3B%0D%0A%5B%2Fas%5D%0D%0Aeval%28%29%0D%0AL%27istruzione%20eval%28%29%20%C3%A8%20stata%20eliminata%20in%20Actionscript%203.0.%20Tuttavia%20vi" title="Digg"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F10%2Factionscript-30-lo-sapevate-che%2F&amp;title=ActionScript%203.0%3A%20lo%20sapevate%20che...&amp;notes=Alcune%20curiosit%C3%A0%20su%20Actionscript%203.0%20non%20sempre%20note...%0D%0Atrace%28%29%0D%0AL%27istruzione%20trace%28%29%2C%20usata%20per%20il%20debug%2C%20ora%20supporta%20pi%C3%B9%20parametri%3A%0D%0A%5Bas%5D%0D%0Atrace%28%20a%2C%20b%2C%20c%20%29%3B%0D%0A%5B%2Fas%5D%0D%0Aeval%28%29%0D%0AL%27istruzione%20eval%28%29%20%C3%A8%20stata%20eliminata%20in%20Actionscript%203.0.%20Tuttavia%20vi" title="del.icio.us"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F10%2Factionscript-30-lo-sapevate-che%2F" title="Technorati"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F10%2Factionscript-30-lo-sapevate-che%2F&amp;t=ActionScript%203.0%3A%20lo%20sapevate%20che..." title="Facebook"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F10%2Factionscript-30-lo-sapevate-che%2F&amp;title=ActionScript%203.0%3A%20lo%20sapevate%20che...&amp;annotation=Alcune%20curiosit%C3%A0%20su%20Actionscript%203.0%20non%20sempre%20note...%0D%0Atrace%28%29%0D%0AL%27istruzione%20trace%28%29%2C%20usata%20per%20il%20debug%2C%20ora%20supporta%20pi%C3%B9%20parametri%3A%0D%0A%5Bas%5D%0D%0Atrace%28%20a%2C%20b%2C%20c%20%29%3B%0D%0A%5B%2Fas%5D%0D%0Aeval%28%29%0D%0AL%27istruzione%20eval%28%29%20%C3%A8%20stata%20eliminata%20in%20Actionscript%203.0.%20Tuttavia%20vi" title="Google Bookmarks"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=ActionScript%203.0%3A%20lo%20sapevate%20che...%20-%20http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F10%2Factionscript-30-lo-sapevate-che%2F" title="Twitter"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://barrapunto.com/submit.pl?subj=ActionScript%203.0%3A%20lo%20sapevate%20che...&amp;story=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F10%2Factionscript-30-lo-sapevate-che%2F" title="BarraPunto"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/barrapunto.png" title="BarraPunto" alt="BarraPunto" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://current.com/clipper.htm?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F10%2Factionscript-30-lo-sapevate-che%2F&amp;title=ActionScript%203.0%3A%20lo%20sapevate%20che..." title="Current"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=ActionScript%203.0%3A%20lo%20sapevate%20che...&amp;body=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F10%2Factionscript-30-lo-sapevate-che%2F" title="email"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=ActionScript%203.0%3A%20lo%20sapevate%20che...&amp;link=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F10%2Factionscript-30-lo-sapevate-che%2F" title="FriendFeed"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F10%2Factionscript-30-lo-sapevate-che%2F&amp;headline=ActionScript%203.0%3A%20lo%20sapevate%20che...&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F10%2Factionscript-30-lo-sapevate-che%2F&amp;title=ActionScript%203.0%3A%20lo%20sapevate%20che...&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Alcune%20curiosit%C3%A0%20su%20Actionscript%203.0%20non%20sempre%20note...%0D%0Atrace%28%29%0D%0AL%27istruzione%20trace%28%29%2C%20usata%20per%20il%20debug%2C%20ora%20supporta%20pi%C3%B9%20parametri%3A%0D%0A%5Bas%5D%0D%0Atrace%28%20a%2C%20b%2C%20c%20%29%3B%0D%0A%5B%2Fas%5D%0D%0Aeval%28%29%0D%0AL%27istruzione%20eval%28%29%20%C3%A8%20stata%20eliminata%20in%20Actionscript%203.0.%20Tuttavia%20vi" title="LinkedIn"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F10%2Factionscript-30-lo-sapevate-che%2F&amp;title=ActionScript%203.0%3A%20lo%20sapevate%20che..." title="Live"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F10%2Factionscript-30-lo-sapevate-che%2F&amp;t=ActionScript%203.0%3A%20lo%20sapevate%20che..." title="MySpace"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=ActionScript%203.0%3A%20lo%20sapevate%20che...&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F10%2Factionscript-30-lo-sapevate-che%2F" title="Netvibes"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F10%2Factionscript-30-lo-sapevate-che%2F&amp;partner=sociable" title="Print"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.undolog.com/feed/" title="RSS"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://segnalo.alice.it/post.html.php?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F10%2Factionscript-30-lo-sapevate-che%2F&amp;title=ActionScript%203.0%3A%20lo%20sapevate%20che..." title="Segnalo"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/segnalo.png" title="Segnalo" alt="Segnalo" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F10%2Factionscript-30-lo-sapevate-che%2F&amp;title=ActionScript%203.0%3A%20lo%20sapevate%20che..." title="StumbleUpon"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.it/vote?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F10%2Factionscript-30-lo-sapevate-che%2F" title="Wikio IT"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio IT" alt="Wikio IT" class="sociable-hovers" /></a>


<br/><br/>
	Tags: <a href="http://www.undolog.com/category/sviluppo/flash-cs3/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/tag/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/tag/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2008/09/15/undolibrary-matrixarray-unestensione-della-classe-array/" title="Undolibrary MatrixArray: un&#8217;estensione della classe Array (15 settembre, 2008)">Undolibrary MatrixArray: un&#8217;estensione della classe Array</a> (0)</li>
	<li><a href="http://www.undolog.com/2008/08/18/simple-flash-project-generator-05-una-air-application-per-flash/" title="Simple Flash Project Generator 0.5: una AIR application per Flash (18 agosto, 2008)">Simple Flash Project Generator 0.5: una AIR application per Flash</a> (0)</li>
	<li><a href="http://www.undolog.com/2008/05/30/papervision3d-basicview/" title="Papervision3D: BasicView (30 maggio, 2008)">Papervision3D: BasicView</a> (0)</li>
	<li><a href="http://www.undolog.com/2008/06/04/flash-cs3-creare-un-effetto-reflex-su-qualsiasi-movieclip/" title="Flash CS3: creare un effetto Reflex su qualsiasi MovieClip (4 giugno, 2008)">Flash CS3: creare un effetto Reflex su qualsiasi MovieClip</a> (12)</li>
	<li><a href="http://www.undolog.com/2008/04/19/actionscript-30-simulare-levento-onreleaseoutside/" title="Actionscript 3.0: simulare l&#8217;evento onReleaseOutside (19 aprile, 2008)">Actionscript 3.0: simulare l&#8217;evento onReleaseOutside</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2008/09/10/actionscript-30-lo-sapevate-che/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Actionscript 3.0 for beginners: lesson #2</title>
		<link>http://www.undolog.com/2008/09/03/actionscript-30-for-beginners-lesson-2/</link>
		<comments>http://www.undolog.com/2008/09/03/actionscript-30-for-beginners-lesson-2/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 14:55:53 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flash CS3]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ADDED_TO_STAGE]]></category>
		<category><![CDATA[Corso]]></category>
		<category><![CDATA[Lezione]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=502</guid>
		<description><![CDATA[Come promesso ecco la seconda lezione su ActionScript 3.0! Oggi inizieremo l'analisi di un semplice progetto che riproduce il giochino del Tris o Tic Tac Toe. Ho cercato di inserire in questo esempio alcune caratteristiche particolari di ActionScript 3.0, cercando di dare spazio alla comprensione e non allo stile. Ne segue che se avessi dovuto [...]]]></description>
			<content:encoded><![CDATA[<p>Come promesso ecco la seconda lezione su ActionScript 3.0! Oggi inizieremo l'analisi di un semplice progetto che riproduce il giochino del <strong>Tris o Tic Tac Toe</strong>. Ho cercato di inserire in questo esempio alcune caratteristiche particolari di ActionScript 3.0, cercando di dare spazio alla comprensione e non allo stile. Ne segue che se avessi dovuto scrivere il "gioco" davvero, probabilmente l'avrei strutturato in modo assai diverso, ma in questo caso ho cercato di mediare tra una classica programmazione compatta ed ermetica con una maggiormente comprensibile per i neofiti. Ho realizzato un'unica classe documento, procedura non necessaria ma utile per rimanere in linea con la <a href="http://www.undolog.com/2008/08/08/actionscript-30-for-beginners-lesson-1/trackback/">precedente lezione</a>.</p>
<h4>Tic Tac Toe</h4>
<p class="center">
<div style="width:480px;margin:0 auto;border:2px solid #666">
<object width="480" height="480">
<param name="movie" value="http://undolibrary.googlecode.com/svn/trunk/as3/tictactoe/tictactoe.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#000000"></param>
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" width="480" height="480" src="http://undolibrary.googlecode.com/svn/trunk/as3/tictactoe/tictactoe.swf" quality="high" bgcolor="#000000" wmode="window" menu="false" allowFullScreen="true" ></embed>
</object>
</div>
</p>
<p><span id="more-502"></span></p>
<h4>I sorgenti</h4>
<p>Oltre al file ActionScript (.as) della classe documento, che inizieremo ad analizzare in dettaglio qui, il progetto è corredato con un classico filmato Flash (.fla) che fornisce l'interfaccia di gioco. Tutti i file necessari per <strong>seguire il commento al codice</strong> sono <a href="http://undolibrary.googlecode.com/svn/trunk/as3/tictactoe/tictactoe.zip">disponibili qui</a>.</p>
<h4>Schema del gioco</h4>
<p>In questa versione del gioco non ho inserito il <em>computer</em> come avversario, attività che potete svolgere voi lettori se ne avete voglia. Il gioco, quindi, alterna due giocatori, esattamente come se stessimo giocando su una lavagna o su un foglio di carta. Lo schema logico che seguiremo è il seguente:</p>
<p class="center"><img border="0" src="/wp-content/uploads/2008/09/tictactoe.png" alt="Schema Tic Tac Toe" /></p>
<h4>Visione globale</h4>
<p>Prima di iniziare l'analisi vera e propria del codice è bene visualizzare lo schema di una classe generica, composta dal <code>package</code>, <code>class</code> e il suo interno:</p>
<p class="center"><img border="0" src="/wp-content/uploads/2008/09/tictactoeclass.png" alt="Schema Tic Tac Toe" /></p>
<h4>Costruttore Classe Documento</h4>
<p>Come abbiamo anticipato la <a href="http://www.undolog.com/2008/08/08/actionscript-30-for-beginners-lesson-1/trackback/">scorsa volta</a>, quando leghiamo ad un documento Flash - un filmato - una classe documento, essendo quest'ultima un vero e proprio oggetto da istanziare, il sistema avvierà il costruttore.</p>
<div class="igBar"><span id="lactionscript3-122"><a href="#" onclick="javascript:showCodeTxt('actionscript3-122'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-122">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">/**</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Costruttore della classe</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*/</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> TicTacToe <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// imposta stage scale mode e stage align</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">scaleMode</span> &nbsp; &nbsp;= <a href="http://www.google.com/search?q=stagescalemode%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:stagescalemode.html"><span style="color: #004993;">StageScaleMode</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">NO_SCALE</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">align</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= <a href="http://www.google.com/search?q=stagealign%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:stagealign.html"><span style="color: #004993;">StageAlign</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TOP_LEFT</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ADDED_TO_STAGE</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Il costruttore nel nostro caso imposta l'oggetto <code>stage</code>, che rappresenta il contenitore all'interno di un browser e aggiunge la chiamata alla funzione/metodo <code>init()</code> quando la nostra classe documento è aggiunta allo <code>stage</code>, cioè quando sarà visualizzata! Questa è una procedura standard che adotto spesso. In alcuni casi è del tutto inutile, tuttavia se si fa uso di componenti, cioè quegli oggetti visuali presenti nell'interfaccia di Flash (come TextArea, TreeView, etc...), questi non saranno disponibili (come puntatori) fino a quando l'evento <code>ADDED_TO_STAGE</code> non è stato rilasciato! Così, per mettersi al sicuro, è buona norma seguire sempre questa via, in previsione di eventuali nuove release.</p>
<p>Per chi è proprio all'asciutto di programmazione ad oggetti, consiglio quantomeno la lettura di <em><a href="http://www.undolog.com/2008/01/29/classi-oggetti-e-istanze/trackback/">Classi, Oggetti e Istanze</a></em>!</p>
<p>La funzione, o metodo, <code>init()</code> è stata definita privata (vedi <i><a href="http://www.undolog.com/2008/06/05/actionscript-30-public-protected-private-e-internal/trackback/">Actionscript 3.0: public, protected, private e internal</a></i> ) tramite la <em>keyword</em> <code>private</code>:</p>
<div class="igBar"><span id="lactionscript3-123"><a href="#" onclick="javascript:showCodeTxt('actionscript3-123'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-123">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">/**</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Metodo invocato appena il MovieClip è aggiunto allo stage</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* @param &nbsp; &nbsp; &nbsp; &nbsp;{event} &nbsp; &nbsp; &nbsp; &nbsp;e=passato da addEventListener(). Può essere null</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* @return &nbsp; &nbsp; &nbsp; &nbsp; void</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* @private</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*/</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a> = <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; initCell<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Per ora, come si vede, questa funzione non fa altro che chiamarne un'altra, <code>initCell()</code>. Spesso nel metodo <code>init()</code> vengono inserite tutte le funzioni di inizializzazione, evitando di inserire direttamente il codice aperto. Questo può ritornare utile in caso serva re-inizializzare qualche parametro. Essendo questo un esempio di un gioco relativamente semplice, può risultare strano avere questo doppio salto quasi inutile, tuttavia in altri casi il  metodo <code>init()</code> può risultare molto più ampio, chiamando una serie di <em>init functions</em> tipo:</p>
<div class="igBar"><span id="lactionscript3-124"><a href="#" onclick="javascript:showCodeTxt('actionscript3-124'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-124">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a> = <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; initBackground<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; initIntro<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; initPlayers<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; initScore<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; initEnemy<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; initSound<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #004993;">start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Il metodo <code>init()</code> viene invocato (cioè chiamato) quando il sistema rilascia l'evento <code>ADDED_TO_STAGE</code>. Proprio per questo motivo è stato inserito il parametro <code>e:Event</code>.</p>
<blockquote><p><strong>Tricks note</strong>: può capitare spesso di avere metodi (come <code>init()</code>) che vengono richiamati sia da eventi, sia all'interno del codice. È proprio per questo motivo che il parametro di questo metodo è stato impostato a <code>e:Event = null</code>. In questo modo, infatti, se dovesse mai servire, possiamo richiamare <code>init()</code> senza passare nessun parametro, in quanto non siamo un evento e quindi non potremmo passare il parametro <code>e:Event</code> (a meno di "simularlo" con un notevole spreco di energie). Per dettagli sulla gestione dei parametri in Actionscript 3.0 si veda anche: <i><a href="http://www.undolog.com/2008/05/07/argomenti-variabili-e-di-default-in-javascript-actionscript-e-php/trackback/">Argomenti variabili e di default in Javascript, Actionscript e PHP</a></i> e <i><a href="http://www.undolog.com/2008/06/11/argomenti-variabili-in-actionscript-30/trackback/">Argomenti variabili in Actionscript 3.0</a></i>,</p>
</blockquote>
<h4>Inizializzazione del gioco</h4>
<div class="igBar"><span id="lactionscript3-125"><a href="#" onclick="javascript:showCodeTxt('actionscript3-125'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-125">
<div class="actionscript3" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">/**</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Inizializza un array lineare che rappresenterà la nostra griglia di gioco.</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Questa &quot;griglia&quot; viene preimpostata a zero (0), valore che indica che nessun</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* segno (o/x) è stato fatto.</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Al player 1 (o) verrà associato il valore uno (1). Mentre al player 2 (x) verrà</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* associato il valore dieci (10). Con questo stratagemma quando ad esempio la</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* somma dei valori presenti nella riga 1 è uguale a 3, sapremo che ha vinto il player 1.</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* Se la somma, invece, della colonna 1 è 30, allora ha vinto il player 2... e via così.</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* 0 | 0 | 0</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* --+---+---</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* 0 | 0 | 0</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* --+---+---</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* 0 | 0 | 0</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* @param &nbsp; &nbsp; &nbsp; &nbsp;void</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* @return &nbsp; &nbsp; &nbsp; &nbsp; void</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;* @private</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3f5fbf;">&nbsp;*/</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> initCell<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// preimposto l'array di gioco a zero</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; __cell &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= <span style="color: #000000;">&#91;</span>0<span style="color: #000066; font-weight: bold;">,</span>0<span style="color: #000066; font-weight: bold;">,</span>0<span style="color: #000066; font-weight: bold;">,</span> 0<span style="color: #000066; font-weight: bold;">,</span>0<span style="color: #000066; font-weight: bold;">,</span>0<span style="color: #000066; font-weight: bold;">,</span> 0<span style="color: #000066; font-weight: bold;">,</span>0<span style="color: #000066; font-weight: bold;">,</span>0<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// inizia sempre il giocatore (player) numero 1</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; __player &nbsp; &nbsp; &nbsp; &nbsp;= <span style="color: #000000; font-weight:bold;color:#800000;">1</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// disegno la griglia a video</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; createGrid<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// mostro a video il turno del giocatore (in questo caso 1)</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; turno_txt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> &nbsp; &nbsp; = <span style="color: #990000;">'PLAYER '</span><span style="color: #000066; font-weight: bold;">+</span>__player<span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// questa variabile è usata per mettere il gioco in pausa se true</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// start-game</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; __stop &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Questo metodo <code>initCell()</code> si preoccupa di inizializzare tutte le variabili e creare tutti gli oggetti del gioco.</p>
<blockquote><p><strong>Tricks note</strong>: quasi tutti i programmatori di videogame conoscono perfettamente la tecnica di mappare l'area di gioco in un array ad una o più dimensioni. Questa tecnica, usata nei cosidetti <a target="_blank" href="http://en.wikipedia.org/wiki/Tile-based_game">Tile Game</a>, permette di eseguire tutta una serie di controlli in un'area <em>logica</em> svincolata dalla grafica a video. In questo specifico caso io ho usato un semplice array monodimensionale composto da 9 elementi che rappresentano le 9 caselle del gioco. Il fatto che gli elementi dell'array siano sequenziali, rispetto alla griglia 3 x 3, non è un problema come vedremo, ma solo una questione di <em>punti di vista</em>!<br />
Per chi vuole approfondire l'interessante argomento, consiglio la lettura di <em><a href="http://www.tonypa.pri.ee/tbw/start.html" target="_blank">Tile Based Games</a></em></p>
</blockquote>
<p>Tutte le variabili ad uso interno, globali a livello di classe, uso indicarle con il doppio <em>underscore</em> davanti. Queste, infatti, durante la prima stesura di una classe potrebbero diventare successivamente proprietà pubbliche, sfruttando l'incapsulamento proprio della programmazione OO (vedi <em><a href="http://www.undolog.com/2007/10/19/scrivere-buon-codice-oo-in-adobe-flash/trackback/">Scrivere buon codice OO in Adobe Flash</a></em>). <code>__player</code> e <code>__stop</code> indicano rispettivamente il giocatore attivo e lo stato del gioco.</p>
<p>Per adesso mi fermo qui! La prossima volta analizzeremo il metodo <code>createGrid()</code> e il resto del gioco, se avete dubbi o domande su questa parte commentate.</p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F03%2Factionscript-30-for-beginners-lesson-2%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%232&amp;bodytext=Come%20promesso%20ecco%20la%20seconda%20lezione%20su%20ActionScript%203.0%21%20Oggi%20inizieremo%20l%27analisi%20di%20un%20semplice%20progetto%20che%20riproduce%20il%20giochino%20del%20Tris%20o%20Tic%20Tac%20Toe.%20Ho%20cercato%20di%20inserire%20in%20questo%20esempio%20alcune%20caratteristiche%20particolari%20di%20ActionScript" title="Digg"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F03%2Factionscript-30-for-beginners-lesson-2%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%232&amp;notes=Come%20promesso%20ecco%20la%20seconda%20lezione%20su%20ActionScript%203.0%21%20Oggi%20inizieremo%20l%27analisi%20di%20un%20semplice%20progetto%20che%20riproduce%20il%20giochino%20del%20Tris%20o%20Tic%20Tac%20Toe.%20Ho%20cercato%20di%20inserire%20in%20questo%20esempio%20alcune%20caratteristiche%20particolari%20di%20ActionScript" title="del.icio.us"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F03%2Factionscript-30-for-beginners-lesson-2%2F" title="Technorati"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F03%2Factionscript-30-for-beginners-lesson-2%2F&amp;t=Actionscript%203.0%20for%20beginners%3A%20lesson%20%232" title="Facebook"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F03%2Factionscript-30-for-beginners-lesson-2%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%232&amp;annotation=Come%20promesso%20ecco%20la%20seconda%20lezione%20su%20ActionScript%203.0%21%20Oggi%20inizieremo%20l%27analisi%20di%20un%20semplice%20progetto%20che%20riproduce%20il%20giochino%20del%20Tris%20o%20Tic%20Tac%20Toe.%20Ho%20cercato%20di%20inserire%20in%20questo%20esempio%20alcune%20caratteristiche%20particolari%20di%20ActionScript" title="Google Bookmarks"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Actionscript%203.0%20for%20beginners%3A%20lesson%20%232%20-%20http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F03%2Factionscript-30-for-beginners-lesson-2%2F" title="Twitter"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://barrapunto.com/submit.pl?subj=Actionscript%203.0%20for%20beginners%3A%20lesson%20%232&amp;story=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F03%2Factionscript-30-for-beginners-lesson-2%2F" title="BarraPunto"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/barrapunto.png" title="BarraPunto" alt="BarraPunto" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://current.com/clipper.htm?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F03%2Factionscript-30-for-beginners-lesson-2%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%232" title="Current"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Actionscript%203.0%20for%20beginners%3A%20lesson%20%232&amp;body=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F03%2Factionscript-30-for-beginners-lesson-2%2F" title="email"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%232&amp;link=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F03%2Factionscript-30-for-beginners-lesson-2%2F" title="FriendFeed"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F03%2Factionscript-30-for-beginners-lesson-2%2F&amp;headline=Actionscript%203.0%20for%20beginners%3A%20lesson%20%232&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F03%2Factionscript-30-for-beginners-lesson-2%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%232&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Come%20promesso%20ecco%20la%20seconda%20lezione%20su%20ActionScript%203.0%21%20Oggi%20inizieremo%20l%27analisi%20di%20un%20semplice%20progetto%20che%20riproduce%20il%20giochino%20del%20Tris%20o%20Tic%20Tac%20Toe.%20Ho%20cercato%20di%20inserire%20in%20questo%20esempio%20alcune%20caratteristiche%20particolari%20di%20ActionScript" title="LinkedIn"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F03%2Factionscript-30-for-beginners-lesson-2%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%232" title="Live"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F03%2Factionscript-30-for-beginners-lesson-2%2F&amp;t=Actionscript%203.0%20for%20beginners%3A%20lesson%20%232" title="MySpace"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%232&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F03%2Factionscript-30-for-beginners-lesson-2%2F" title="Netvibes"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F03%2Factionscript-30-for-beginners-lesson-2%2F&amp;partner=sociable" title="Print"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.undolog.com/feed/" title="RSS"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://segnalo.alice.it/post.html.php?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F03%2Factionscript-30-for-beginners-lesson-2%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%232" title="Segnalo"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/segnalo.png" title="Segnalo" alt="Segnalo" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F03%2Factionscript-30-for-beginners-lesson-2%2F&amp;title=Actionscript%203.0%20for%20beginners%3A%20lesson%20%232" title="StumbleUpon"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.wikio.it/vote?url=http%3A%2F%2Fwww.undolog.com%2F2008%2F09%2F03%2Factionscript-30-for-beginners-lesson-2%2F" title="Wikio IT"><img src="http://www.undolog.com/wp-content/plugins/sociable/images/wikio.png" title="Wikio IT" alt="Wikio IT" class="sociable-hovers" /></a>


<br/><br/>
	Tags: <a href="http://www.undolog.com/category/sviluppo/flash-cs3/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/added_to_stage/" title="ADDED_TO_STAGE" rel="tag">ADDED_TO_STAGE</a>, <a href="http://www.undolog.com/tag/corso/" title="Corso" rel="tag">Corso</a>, <a href="http://www.undolog.com/category/sviluppo/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/tag/flash-cs3/" title="Flash CS3" rel="tag">Flash CS3</a>, <a href="http://www.undolog.com/category/sviluppo/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/lezione/" title="Lezione" rel="tag">Lezione</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/tag/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/category/tutorials/" title="Tutorials" rel="tag">Tutorials</a>, <a href="http://www.undolog.com/tag/tutorials/" title="Tutorials" rel="tag">Tutorials</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2009/01/22/actionscript-30-for-beginners-lesson-5/" title="Actionscript 3.0 for beginners: lesson #5 (22 gennaio, 2009)">Actionscript 3.0 for beginners: lesson #5</a> (4)</li>
	<li><a href="http://www.undolog.com/2008/11/11/actionscript-30-for-beginners-lesson-4/" title="Actionscript 3.0 for beginners: lesson #4 (11 novembre, 2008)">Actionscript 3.0 for beginners: lesson #4</a> (3)</li>
	<li><a href="http://www.undolog.com/2008/09/28/actionscript-30-for-beginners-lesson-3/" title="Actionscript 3.0 for beginners: lesson #3 (28 settembre, 2008)">Actionscript 3.0 for beginners: lesson #3</a> (0)</li>
	<li><a href="http://www.undolog.com/2008/08/08/actionscript-30-for-beginners-lesson-1/" title="Actionscript 3.0 for beginners: lesson #1 (8 agosto, 2008)">Actionscript 3.0 for beginners: lesson #1</a> (9)</li>
	<li><a href="http://www.undolog.com/2008/06/04/flash-cs3-creare-un-effetto-reflex-su-qualsiasi-movieclip/" title="Flash CS3: creare un effetto Reflex su qualsiasi MovieClip (4 giugno, 2008)">Flash CS3: creare un effetto Reflex su qualsiasi MovieClip</a> (12)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2008/09/03/actionscript-30-for-beginners-lesson-2/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
