<?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; Tutorials</title>
	<atom:link href="http://www.undolog.com/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.undolog.com</link>
	<description>Research &#38; Development  Blog</description>
	<lastBuildDate>Tue, 16 Mar 2010 14:38:48 +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>Come localizzare immagini e viste di Interface Builder</title>
		<link>http://www.undolog.com/2010/02/23/come-localizzare-immagini-e-viste-di-interface-builder/</link>
		<comments>http://www.undolog.com/2010/02/23/come-localizzare-immagini-e-viste-di-interface-builder/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 21:41:15 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[AppleSide]]></category>
		<category><![CDATA[Immagini]]></category>
		<category><![CDATA[Interface Builder]]></category>
		<category><![CDATA[Localizzazione]]></category>
		<category><![CDATA[XCode]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=2918</guid>
		<description><![CDATA[Dopo aver illustrato come localizzare le nostre stringhe in Xcode, vediamo adesso quanto risulta semplice - applicando la medesima tecnica - localizzare immagini e viste/interfacce realizzate con Interface Builder.
Localizzare risorse grafiche
Il processo, come accennato, è il medesimo; se abbiamo un'immagine già inserita nelle nostre risorse, o ne inseriamo una nuova, e vogliamo "localizzarla" - cioè [...]]]></description>
			<content:encoded><![CDATA[<p>Dopo aver illustrato <strong><a href="http://www.appleside.it/develop/localizzare-le-applicazioni-apple-iphone-in-modo-rapido/" target="_blank">come localizzare le nostre stringhe in Xcode</a></strong>, vediamo adesso quanto risulta semplice - applicando la medesima tecnica - localizzare immagini e viste/interfacce realizzate con <strong>Interface Builder</strong>.</p>
<h4>Localizzare risorse grafiche</h4>
<p>Il processo, come accennato, è il medesimo; se abbiamo un'immagine già inserita nelle nostre risorse, o ne inseriamo una nuova, e vogliamo "localizzarla" - cioè gestire due o più immagini in base alle lingue supportate - basterà cliccare con il tasto destro sull'immagine (<code>Adium.png</code> in questo esempio) e selezionare <strong>Get Info</strong>:</p>
<p class="center"><img title="Get Info" src="http://www.undolog.com/wp-content/uploads/2010/02/Schermata-2010-02-23-a-17.16.17.png" alt="" width="470" height="673" /></p>
<p>Clicchiamo <strong>Make File Localizable</strong> in basso a sinistra.</p>
<p class="center"><img class="alignnone size-full wp-image-2923" title="Localizzable" src="http://www.undolog.com/wp-content/uploads/2010/02/Schermata-2010-02-23-a-17.43.54.png" alt="" width="470" height="673" /></p>
<p>Clicchiamo su <strong>Add Localization</strong> e inseriamo <code>Italian</code>:</p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2010/02/Schermata-2010-02-23-a-17.44.01.png" alt="" title="Schermata 2010-02-23 a 17.44.01" width="264" height="121" class="alignnone size-full wp-image-2924" /></p>
<p>In modo da ottenere:</p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2010/02/Schermata-2010-02-23-a-17.44.17.png" alt="" title="Schermata 2010-02-23 a 17.44.17" width="158" height="87" style="border:1px solid #aaa" /></p>
<p>La nostra immagine viene spostata (fisicamente, una delle rare volte in cui quello che accade nell'alberatura Xcode si riflette sul filesystem) sotto le cartelle virtuali <code>English.lproj</code> e <code>Italian.lproj</code> esattamente come accadeva con il testo:</p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2010/02/Schermata-2010-02-23-a-17.51.47.png" alt="" title="Schermata 2010-02-23 a 17.51.47" width="400" height="168" style="border:1px solid #aaa" /></p>
<p>A questo punto ognuna delle cartelle <code>English.lproj</code> e <code>Italian.lproj</code> contiene una stessa versione dell'immagine. Questa immagine è manipolabile all'interno di <strong>Interface Builder</strong>, dove ne vedremo - per default - la versione inglese.<br />
Arrivati a questo punto, basta sovrascrivere uno (o entrambi i file <code>Adium.png</code>) per ottenere una localizzazione delle immagini "lampo".</p>
<h4>Localizzare i file XIB</h4>
<p>Anche le interfacce costruite con <strong>Interface Builder</strong> possono essere localizzate nella loro interezza, quando lo si ritiene necessario. Il procedimento è identico a quello svolto con le risorse grafiche: aggiungiamo un <code>ViewController</code> (ad esempio <code>infoViewController</code>) con interfaccia <strong>XIB</strong>, lo selezioniamo, scegliamo <strong>Get Info</strong> dal menu contestuale, rendiamo il file localizzabile, aggiungiamo la localizzazione in italiano:</p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2010/02/Schermata-2010-02-23-a-22.30.29.png" alt="ViewController" title="ViewController" width="213" height="95" style="border:1px solid #aaa" /></p>
<p>Cliccando su <strong>English</strong> o su <strong>Italian</strong> si aprirà Interface Builder! Questa volta, sul filesystem, noteremo che sono state create due cartelle (<code>English.lproj</code> e <code>Italian.lproj</code>) all'interno della classica cartella <strong>Classes</strong>. Entrambe avranno il loro file <code>infoViewController.xib</code>. La comodità, in questo, risolta evidente nel codice; quando andremo ad istanziare il nostro controller si avrà un codice "pulito" di questo tipo:</p>
<div class="igBar"><span id="lobjc-2"><a href="#" onclick="javascript:showCodeTxt('objc-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Objective-C:</span>
<div id="objc-2">
<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;">InfoViewController <span style="color: #002200;">*</span>info <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>InfoViewController 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: #002200;">&#91;</span>self.view addSubview<span style="color: #002200;">:</span>info.view<span style="color: #002200;">&#93;</span>;</div>
</li>
</ol>
</div>
</div>
</div>
<p>
Come vedete non c'è traccia di nessuna dichiarazione relativa alla localizzazione, totalmente gestita da sistema. Le due interfacce, ovviamente, possono essere completamente differenti, in quanto risultano a tutti gli effetti come due file XIB separati.</p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2010%2F02%2F23%2Fcome-localizzare-immagini-e-viste-di-interface-builder%2F&amp;title=Come%20localizzare%20immagini%20e%20viste%20di%20Interface%20Builder&amp;bodytext=Dopo%20aver%20illustrato%20come%20localizzare%20le%20nostre%20stringhe%20in%20Xcode%2C%20vediamo%20adesso%20quanto%20risulta%20semplice%20-%20applicando%20la%20medesima%20tecnica%20-%20localizzare%20immagini%20e%20viste%2Finterfacce%20realizzate%20con%20Interface%20Builder.%0D%0ALocalizzare%20risorse%20grafiche%0D%0AIl%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%2F2010%2F02%2F23%2Fcome-localizzare-immagini-e-viste-di-interface-builder%2F&amp;title=Come%20localizzare%20immagini%20e%20viste%20di%20Interface%20Builder&amp;notes=Dopo%20aver%20illustrato%20come%20localizzare%20le%20nostre%20stringhe%20in%20Xcode%2C%20vediamo%20adesso%20quanto%20risulta%20semplice%20-%20applicando%20la%20medesima%20tecnica%20-%20localizzare%20immagini%20e%20viste%2Finterfacce%20realizzate%20con%20Interface%20Builder.%0D%0ALocalizzare%20risorse%20grafiche%0D%0AIl%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%2F2010%2F02%2F23%2Fcome-localizzare-immagini-e-viste-di-interface-builder%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%2F2010%2F02%2F23%2Fcome-localizzare-immagini-e-viste-di-interface-builder%2F&amp;t=Come%20localizzare%20immagini%20e%20viste%20di%20Interface%20Builder" 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%2F2010%2F02%2F23%2Fcome-localizzare-immagini-e-viste-di-interface-builder%2F&amp;title=Come%20localizzare%20immagini%20e%20viste%20di%20Interface%20Builder&amp;annotation=Dopo%20aver%20illustrato%20come%20localizzare%20le%20nostre%20stringhe%20in%20Xcode%2C%20vediamo%20adesso%20quanto%20risulta%20semplice%20-%20applicando%20la%20medesima%20tecnica%20-%20localizzare%20immagini%20e%20viste%2Finterfacce%20realizzate%20con%20Interface%20Builder.%0D%0ALocalizzare%20risorse%20grafiche%0D%0AIl%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=Come%20localizzare%20immagini%20e%20viste%20di%20Interface%20Builder%20-%20http%3A%2F%2Fwww.undolog.com%2F2010%2F02%2F23%2Fcome-localizzare-immagini-e-viste-di-interface-builder%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%20localizzare%20immagini%20e%20viste%20di%20Interface%20Builder&amp;story=http%3A%2F%2Fwww.undolog.com%2F2010%2F02%2F23%2Fcome-localizzare-immagini-e-viste-di-interface-builder%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%2F2010%2F02%2F23%2Fcome-localizzare-immagini-e-viste-di-interface-builder%2F&amp;title=Come%20localizzare%20immagini%20e%20viste%20di%20Interface%20Builder" 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%20localizzare%20immagini%20e%20viste%20di%20Interface%20Builder&amp;body=http%3A%2F%2Fwww.undolog.com%2F2010%2F02%2F23%2Fcome-localizzare-immagini-e-viste-di-interface-builder%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%20localizzare%20immagini%20e%20viste%20di%20Interface%20Builder&amp;link=http%3A%2F%2Fwww.undolog.com%2F2010%2F02%2F23%2Fcome-localizzare-immagini-e-viste-di-interface-builder%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%2F2010%2F02%2F23%2Fcome-localizzare-immagini-e-viste-di-interface-builder%2F&amp;headline=Come%20localizzare%20immagini%20e%20viste%20di%20Interface%20Builder&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%2F2010%2F02%2F23%2Fcome-localizzare-immagini-e-viste-di-interface-builder%2F&amp;title=Come%20localizzare%20immagini%20e%20viste%20di%20Interface%20Builder&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Dopo%20aver%20illustrato%20come%20localizzare%20le%20nostre%20stringhe%20in%20Xcode%2C%20vediamo%20adesso%20quanto%20risulta%20semplice%20-%20applicando%20la%20medesima%20tecnica%20-%20localizzare%20immagini%20e%20viste%2Finterfacce%20realizzate%20con%20Interface%20Builder.%0D%0ALocalizzare%20risorse%20grafiche%0D%0AIl%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%2F2010%2F02%2F23%2Fcome-localizzare-immagini-e-viste-di-interface-builder%2F&amp;title=Come%20localizzare%20immagini%20e%20viste%20di%20Interface%20Builder" 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%2F2010%2F02%2F23%2Fcome-localizzare-immagini-e-viste-di-interface-builder%2F&amp;t=Come%20localizzare%20immagini%20e%20viste%20di%20Interface%20Builder" 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%20localizzare%20immagini%20e%20viste%20di%20Interface%20Builder&amp;url=http%3A%2F%2Fwww.undolog.com%2F2010%2F02%2F23%2Fcome-localizzare-immagini-e-viste-di-interface-builder%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%2F2010%2F02%2F23%2Fcome-localizzare-immagini-e-viste-di-interface-builder%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%2F2010%2F02%2F23%2Fcome-localizzare-immagini-e-viste-di-interface-builder%2F&amp;title=Come%20localizzare%20immagini%20e%20viste%20di%20Interface%20Builder" 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%2F2010%2F02%2F23%2Fcome-localizzare-immagini-e-viste-di-interface-builder%2F&amp;title=Come%20localizzare%20immagini%20e%20viste%20di%20Interface%20Builder" 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%2F2010%2F02%2F23%2Fcome-localizzare-immagini-e-viste-di-interface-builder%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/appleside/" title="AppleSide" rel="tag">AppleSide</a>, <a href="http://www.undolog.com/tag/immagini/" title="Immagini" rel="tag">Immagini</a>, <a href="http://www.undolog.com/tag/interface-builder/" title="Interface Builder" rel="tag">Interface Builder</a>, <a href="http://www.undolog.com/category/sviluppo/ipad/" title="iPad" rel="tag">iPad</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/tag/localizzazione/" title="Localizzazione" rel="tag">Localizzazione</a>, <a href="http://www.undolog.com/category/mobile/" title="Mobile" rel="tag">Mobile</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/tutorials/" title="Tutorials" rel="tag">Tutorials</a>, <a href="http://www.undolog.com/tag/xcode/" title="XCode" rel="tag">XCode</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2009/07/13/iphone-secondapp-indovina-il-numero-parte-2/" title="iPhone SecondApp: indovina il numero &#8211; parte 2 (13 luglio, 2009)">iPhone SecondApp: indovina il numero &#8211; parte 2</a> (0)</li>
	<li><a href="http://www.undolog.com/2009/06/23/iphone-firstapp-indovina-il-numero-parte-1/" title="iPhone FirstApp: indovina il numero &#8211; parte 1 (23 giugno, 2009)">iPhone FirstApp: indovina il numero &#8211; parte 1</a> (0)</li>
	<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/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>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2010/02/23/come-localizzare-immagini-e-viste-di-interface-builder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Personalizzare graficamente un Form</title>
		<link>http://www.undolog.com/2009/12/04/personalizzare-graficamente-un-form/</link>
		<comments>http://www.undolog.com/2009/12/04/personalizzare-graficamente-un-form/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 13:52:34 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[-moz-border-radius]]></category>
		<category><![CDATA[-webkit-border-radius]]></category>
		<category><![CDATA[background-image]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[Style Sheet]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=2724</guid>
		<description><![CDATA[Mi è stato chiesto come personalizzare graficamente un form, in particolare un form di ricerca come quello presente su questo blog. La tecnica utilizzata, o meglio che utilizzo io, è ovviamente valida per qualsiasi tipo di modulo form. Quello che cambia è solo la complessità del lavoro da svolgere in funzione della complessità del form [...]]]></description>
			<content:encoded><![CDATA[<p>Mi è stato chiesto come personalizzare graficamente un form, in particolare un form di ricerca come quello presente su questo blog. La tecnica utilizzata, o meglio che utilizzo io, è ovviamente valida per qualsiasi tipo di modulo form. Quello che cambia è solo la complessità del lavoro da svolgere in funzione della complessità del form stesso.</p>
<h4>Le basi</h4>
<p>Tramite i fogli di stile è possibile personalizzare completamente il layout di un qualsiasi modulo form. Uno degli ostacoli che si possono incontrare, come spesso accade, è relativo alla compatibilità con i vari browser in commercio e quindi con diversi risultati finali in base al browser utilizzato.<br />
Per questo, spesso, si opta per una soluzione sostanzialmente grafica, cioè si sfruttano delle immagini per ridefinire il layout grafico del form. Le immagini, infatti, sono le uniche entità che, salvo rai casi, sino ad oggi sono visualizzate sempre allo stesso modo su tutti i browser.</p>
<h4>Senza immagini</h4>
<p>Prima di vedere come alterare il layout di un form con delle immagini, vediamo quello che "sarebbe" possibile fare con i soli CSS. Un modulo form è formato nella maggiornza dei casi da campi <code>INPUT</code>. Tuttavia quello che vedremo è, in linea generale, applicabile a qualsiasi altro campo modulo. Tramite i CSS possiamo ridefinire l'aspetto del nostro campo <code>INPUT</code> agendo sulla sua dimensione, sul bordo, sullo sfondo, sul tipo di carattere, etc...<br />
Ad esempio è possibile migliorare la resa impostando semplicemente:</p>
<div class="igBar"><span id="lcss-10"><a href="#" onclick="javascript:showCodeTxt('css-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-10">
<div class="css" 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;">input <span style="color: #00AA00;">&#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: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#aaa</span><span style="color: #00AA00;">;</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; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">4px</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</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; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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: #00AA00;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
Mozilla FireFox e Safari permettono anche di regolare in modo semplice la rotondità dei bordi (vedi anche <em><a href="http://www.undolog.com/2008/10/16/css3-qualcuno-ha-visto-internet-explorer/">CSS3: qualcuno ha visto Internet Explorer?</a></em>):</p>
<div class="igBar"><span id="lcss-11"><a href="#" onclick="javascript:showCodeTxt('css-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-11">
<div class="css" 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;">input <span style="color: #00AA00;">&#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: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#aaa</span><span style="color: #00AA00;">;</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; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">4px</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</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; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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; -moz-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">6px</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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; -webkit-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">6px</span><span style="color: #00AA00;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
In aggiunta possiamo inserire un'immagine come sfondo, per rendere più "accessibile" il significato del campo stesso:</p>
<div class="igBar"><span id="lcss-12"><a href="#" onclick="javascript:showCodeTxt('css-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-12">
<div class="css" 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;">input <span style="color: #00AA00;">&#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: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#aaa</span><span style="color: #00AA00;">;</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; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">4px</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</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; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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; -moz-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">6px</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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; -webkit-border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">6px</span><span style="color: #00AA00;">;</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;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/icon.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</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; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
Se <code>icon.png</code> è un'icona di larghezza 16 pixel, tramite il <code>padding</code> permettiamo di posizionarla all'inizio del campo ma fuori dal testo.</p>
<h4>Le immagini nel Form</h4>
<p>L'ultimo esempio visto porterebbe ad una semplice soluzione nel momento in cui decidiamo di realizzare il layout del nostro campo <code>INPUT</code> completamene in grafica. Infatti in linea teorica basterebbe eliminare il bordo del campo e inserire un'immagine di background direttamente nel campo <code>INPUT</code>:</p>
<div class="igBar"><span id="lcss-13"><a href="#" onclick="javascript:showCodeTxt('css-13'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-13">
<div class="css" 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;">input <span style="color: #00AA00;">&#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: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</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; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">4px</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</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; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/custominput.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Dico in linea teorica perchè se da un lato questa tecnica funziona (vedi FireFox), dall'altro produce strani effetti su altri browser (vedi Microsoft Internet Explorer).<br />
Per sperare l'ostacolo si rende completamente trasparente il campo <code>INPUT</code> e l'immagine la si associa direttamente al tag <code>FORM</code>:</p>
<div class="igBar"><span id="lcss-14"><a href="#" onclick="javascript:showCodeTxt('css-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-14">
<div class="css" 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;">input <span style="color: #00AA00;">&#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: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</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; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">4px</span><span style="color: #00AA00;">;</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; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</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: #00AA00;">&#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;">form <span style="color: #00AA00;">&#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: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</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; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">24px</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/custominput.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</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: #00AA00;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
Il tutto con una "taggatura" HTML del tipo:</p>
<div class="igBar"><span id="lhtml-15"><a href="#" onclick="javascript:showCodeTxt('html-15'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-15">
<div class="html" 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;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Eform%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;form&gt;</span></a></span></div>
</li>
<li style="font-weight: 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;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Einput.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cerca&quot;</span> <span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&gt;</span></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: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3E%2Fform%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;/form&gt;</span></a></span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
In base alla grafica scelta e alla complessità del form, bisognerà solo "sovrapporre" in modo corretto, e quindi posizionare, il campo <code>INPUT</code> all'immagine grafica sottostante posta come sfondo del form. Questo è possibile inserendo gli opportuni margini al campo <code>INPUT</code> stesso, per farlo coincidere con il nostro layout: </p>
<div class="igBar"><span id="lcss-16"><a href="#" onclick="javascript:showCodeTxt('css-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-16">
<div class="css" 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;">input <span style="color: #00AA00;">&#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: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</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; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">4px</span><span style="color: #00AA00;">;</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; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</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;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</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; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">24px</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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: #00AA00;">&#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%2F12%2F04%2Fpersonalizzare-graficamente-un-form%2F&amp;title=Personalizzare%20graficamente%20un%20Form&amp;bodytext=Mi%20%C3%A8%20stato%20chiesto%20come%20personalizzare%20graficamente%20un%20form%2C%20in%20particolare%20un%20form%20di%20ricerca%20come%20quello%20presente%20su%20questo%20blog.%20La%20tecnica%20utilizzata%2C%20o%20meglio%20che%20utilizzo%20io%2C%20%C3%A8%20ovviamente%20valida%20per%20qualsiasi%20tipo%20di%20modulo%20form.%20Quello%20che%20c" 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%2F12%2F04%2Fpersonalizzare-graficamente-un-form%2F&amp;title=Personalizzare%20graficamente%20un%20Form&amp;notes=Mi%20%C3%A8%20stato%20chiesto%20come%20personalizzare%20graficamente%20un%20form%2C%20in%20particolare%20un%20form%20di%20ricerca%20come%20quello%20presente%20su%20questo%20blog.%20La%20tecnica%20utilizzata%2C%20o%20meglio%20che%20utilizzo%20io%2C%20%C3%A8%20ovviamente%20valida%20per%20qualsiasi%20tipo%20di%20modulo%20form.%20Quello%20che%20c" 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%2F12%2F04%2Fpersonalizzare-graficamente-un-form%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%2F12%2F04%2Fpersonalizzare-graficamente-un-form%2F&amp;t=Personalizzare%20graficamente%20un%20Form" 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%2F12%2F04%2Fpersonalizzare-graficamente-un-form%2F&amp;title=Personalizzare%20graficamente%20un%20Form&amp;annotation=Mi%20%C3%A8%20stato%20chiesto%20come%20personalizzare%20graficamente%20un%20form%2C%20in%20particolare%20un%20form%20di%20ricerca%20come%20quello%20presente%20su%20questo%20blog.%20La%20tecnica%20utilizzata%2C%20o%20meglio%20che%20utilizzo%20io%2C%20%C3%A8%20ovviamente%20valida%20per%20qualsiasi%20tipo%20di%20modulo%20form.%20Quello%20che%20c" 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=Personalizzare%20graficamente%20un%20Form%20-%20http%3A%2F%2Fwww.undolog.com%2F2009%2F12%2F04%2Fpersonalizzare-graficamente-un-form%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=Personalizzare%20graficamente%20un%20Form&amp;story=http%3A%2F%2Fwww.undolog.com%2F2009%2F12%2F04%2Fpersonalizzare-graficamente-un-form%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%2F12%2F04%2Fpersonalizzare-graficamente-un-form%2F&amp;title=Personalizzare%20graficamente%20un%20Form" 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=Personalizzare%20graficamente%20un%20Form&amp;body=http%3A%2F%2Fwww.undolog.com%2F2009%2F12%2F04%2Fpersonalizzare-graficamente-un-form%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=Personalizzare%20graficamente%20un%20Form&amp;link=http%3A%2F%2Fwww.undolog.com%2F2009%2F12%2F04%2Fpersonalizzare-graficamente-un-form%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%2F12%2F04%2Fpersonalizzare-graficamente-un-form%2F&amp;headline=Personalizzare%20graficamente%20un%20Form&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%2F12%2F04%2Fpersonalizzare-graficamente-un-form%2F&amp;title=Personalizzare%20graficamente%20un%20Form&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Mi%20%C3%A8%20stato%20chiesto%20come%20personalizzare%20graficamente%20un%20form%2C%20in%20particolare%20un%20form%20di%20ricerca%20come%20quello%20presente%20su%20questo%20blog.%20La%20tecnica%20utilizzata%2C%20o%20meglio%20che%20utilizzo%20io%2C%20%C3%A8%20ovviamente%20valida%20per%20qualsiasi%20tipo%20di%20modulo%20form.%20Quello%20che%20c" 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%2F12%2F04%2Fpersonalizzare-graficamente-un-form%2F&amp;title=Personalizzare%20graficamente%20un%20Form" 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%2F12%2F04%2Fpersonalizzare-graficamente-un-form%2F&amp;t=Personalizzare%20graficamente%20un%20Form" 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=Personalizzare%20graficamente%20un%20Form&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F12%2F04%2Fpersonalizzare-graficamente-un-form%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%2F12%2F04%2Fpersonalizzare-graficamente-un-form%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%2F12%2F04%2Fpersonalizzare-graficamente-un-form%2F&amp;title=Personalizzare%20graficamente%20un%20Form" 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%2F12%2F04%2Fpersonalizzare-graficamente-un-form%2F&amp;title=Personalizzare%20graficamente%20un%20Form" 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%2F12%2F04%2Fpersonalizzare-graficamente-un-form%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/moz-border-radius/" title="-moz-border-radius" rel="tag">-moz-border-radius</a>, <a href="http://www.undolog.com/tag/webkit-border-radius/" title="-webkit-border-radius" rel="tag">-webkit-border-radius</a>, <a href="http://www.undolog.com/tag/background-image/" title="background-image" rel="tag">background-image</a>, <a href="http://www.undolog.com/category/sviluppo/internet/css/" title="CSS" rel="tag">CSS</a>, <a href="http://www.undolog.com/tag/css/" title="CSS" rel="tag">CSS</a>, <a href="http://www.undolog.com/tag/css3/" title="CSS3" rel="tag">CSS3</a>, <a href="http://www.undolog.com/tag/form/" title="form" rel="tag">form</a>, <a href="http://www.undolog.com/category/sviluppo/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/style-sheet/" title="Style Sheet" rel="tag">Style Sheet</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/webkit/" title="WebKit" rel="tag">WebKit</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2010/01/21/firefox-3-5-7-come-risolvere-il-difetto-dei-bordi-arrotondati-su-unimmagine/" title="FireFox 3.5.7: come risolvere il difetto dei bordi arrotondati su un&#8217;immagine (21 gennaio, 2010)">FireFox 3.5.7: come risolvere il difetto dei bordi arrotondati su un&#8217;immagine</a> (1)</li>
	<li><a href="http://www.undolog.com/2008/10/16/css3-qualcuno-ha-visto-internet-explorer/" title="CSS3: qualcuno ha visto Internet Explorer? (16 ottobre, 2008)">CSS3: qualcuno ha visto Internet Explorer?</a> (5)</li>
	<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/02/05/very-short-trick-disabilitare-il-ridimensionamento-di-una-textarea-su-safari/" title="Very short trick: disabilitare il ridimensionamento di una textarea su Safari (5 febbraio, 2009)">Very short trick: disabilitare il ridimensionamento di una textarea su Safari</a> (7)</li>
	<li><a href="http://www.undolog.com/2009/05/18/very-short-trick-css-condizionali-e-ottimizzazione/" title="Very short trick: CSS condizionali e ottimizzazione (18 maggio, 2009)">Very short trick: CSS condizionali e ottimizzazione</a> (1)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2009/12/04/personalizzare-graficamente-un-form/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<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-17"><a href="#" onclick="javascript:showCodeTxt('code-17'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-17">
<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-18"><a href="#" onclick="javascript:showCodeTxt('actionscript3-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-18">
<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-19"><a href="#" onclick="javascript:showCodeTxt('actionscript3-19'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-19">
<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-20"><a href="#" onclick="javascript:showCodeTxt('javascript-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-20">
<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-21"><a href="#" onclick="javascript:showCodeTxt('actionscript3-21'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-21">
<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-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: #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-23"><a href="#" onclick="javascript:showCodeTxt('actionscript3-23'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-23">
<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-24"><a href="#" onclick="javascript:showCodeTxt('actionscript3-24'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-24">
<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-25"><a href="#" onclick="javascript:showCodeTxt('actionscript3-25'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-25">
<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>Photoshop tutorial: effetti con le ombre</title>
		<link>http://www.undolog.com/2009/08/28/photoshop-tutorial-effetti-con-le-ombre/</link>
		<comments>http://www.undolog.com/2009/08/28/photoshop-tutorial-effetti-con-le-ombre/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 23:16:01 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Case Study]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Grafica & Design]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Effetti]]></category>
		<category><![CDATA[shadow]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=2338</guid>
		<description><![CDATA[Come ottenere effetti particolari con ombre personalizzate costruite con layer appositamente distorti e manipolati]]></description>
			<content:encoded><![CDATA[<p>In questo tutorial voglio mostrarvi alcune effetti particolari che si possono applicare ad un semplice oggetto rettangolare giocando con le <strong>ombre</strong>. Ovviamente non mi riferisco all'effetto <strong><em>shadow</em></strong> applicabile su un layer, ma a vere e proprie ombre realizzate manualmente. Prima di tutto disegniamo su un layer un rettangolo tipo questo:</p>
<p class="center"><img title="Rettangolo" src="http://www.undolog.com/wp-content/uploads/2009/08/Immagine-1.png" alt="Rettangolo" width="210" height="206" /></p>
<p>Gli effetti che si possono creare sono vari e le varianti si basano tutte sul medesimo procedimento, lasciando ampio spazio all'immaginazione. Ecco alcuni esempi:</p>
<p class="center"><img title="Effeti ombra" src="http://www.undolog.com/wp-content/uploads/2009/08/shadow.jpg" alt="Effeti ombra" width="640" height="235" /></p>
<p>Tutti questi effetti hanno in comune l'estrema semplicità della loro realizzazione. Per realizzarli, infatti, è sufficiente <strong>aggiungere un layer sotto il nostro rettangolo</strong>, che sarà il layer ombra. Su questo traccieremo un'immagine (nera) identica al rettangolo originale. Per fare questo si può procedere in vari modi, dipendenti dalla complessità della forma principale. Nel nostro caso è possibile selezionare i contorni del rettangolo <strong>cliccando sul layer mantenendo premuto il tasto Command</strong> (Control su PC). Ottenuta la selezione clicchiamo sul layer ombra e riempiamolo del colore nero:</p>
<ul>
<li>Tasto destro del mouse sulla selezione e click su Riempi</li>
<li>Command + Cancel (ALT + Cancel su PC) se avete impostato il colore nero come colore di sfondo</li>
</ul>
<p>A questo punto applichiamo un effetto <strong>Sfocatura</strong> al layer ombra: dal menu <strong>Filtri </strong>selezionate <strong>Sfocatura-&gt;Controllo sfocatura...</strong> e inserito un valore di 3/4 a seconda del gusto. Ora ridimensionate l'ombra (che con la sfocatura sarà visibile sotto il nostro rettangolo) di un 90%. Fatto questo non rimane che <strong>decidere il tipo di effetto ombra da applicare</strong>. Potete infatti distorcere il layer con l'apposita funzione presente nel menu <strong>Modifica</strong>:</p>
<p class="center"><img style="border:1px solid #aaa" title="Altera immagine" src="http://www.undolog.com/wp-content/uploads/2009/08/Immagine-11.png" alt="Altera immagine" width="482" height="240" /></p>
<p>Arrivati a questo punto la vostra immaginazione determinerà il risultato finale. Se non volete <strong>Alterare </strong>manualmente l'ombra potete sfruttare alcune delle distorsioni predefinite nel menu che trovate in alto a destra:</p>
<p class="center"><img style="border:1px solid #aaa" title="Arcata" src="http://www.undolog.com/wp-content/uploads/2009/08/Immagine-3.png" alt="Arcata" width="226" height="364" /></p>
<p>Selezionando <strong>Arcata</strong>, ad esempio, potete aggiustare la deformazione e ricreare l'ultimo effetto mostrato negli esempi di sopra. Giocando poi con la trasparenza e le simmetrie è possibile ottenere:</p>
<p class="center"><img title="Trasparenza e simmetria" src="http://www.undolog.com/wp-content/uploads/2009/08/Immagine-2.png" alt="Trasparenza e simmetria" width="488" height="225" /></p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F28%2Fphotoshop-tutorial-effetti-con-le-ombre%2F&amp;title=Photoshop%20tutorial%3A%20effetti%20con%20le%20ombre&amp;bodytext=Come%20ottenere%20effetti%20particolari%20con%20ombre%20personalizzate%20costruite%20con%20layer%20appositamente%20distorti%20e%20manipolati" 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%2F28%2Fphotoshop-tutorial-effetti-con-le-ombre%2F&amp;title=Photoshop%20tutorial%3A%20effetti%20con%20le%20ombre&amp;notes=Come%20ottenere%20effetti%20particolari%20con%20ombre%20personalizzate%20costruite%20con%20layer%20appositamente%20distorti%20e%20manipolati" 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%2F28%2Fphotoshop-tutorial-effetti-con-le-ombre%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%2F28%2Fphotoshop-tutorial-effetti-con-le-ombre%2F&amp;t=Photoshop%20tutorial%3A%20effetti%20con%20le%20ombre" 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%2F28%2Fphotoshop-tutorial-effetti-con-le-ombre%2F&amp;title=Photoshop%20tutorial%3A%20effetti%20con%20le%20ombre&amp;annotation=Come%20ottenere%20effetti%20particolari%20con%20ombre%20personalizzate%20costruite%20con%20layer%20appositamente%20distorti%20e%20manipolati" 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=Photoshop%20tutorial%3A%20effetti%20con%20le%20ombre%20-%20http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F28%2Fphotoshop-tutorial-effetti-con-le-ombre%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=Photoshop%20tutorial%3A%20effetti%20con%20le%20ombre&amp;story=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F28%2Fphotoshop-tutorial-effetti-con-le-ombre%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%2F28%2Fphotoshop-tutorial-effetti-con-le-ombre%2F&amp;title=Photoshop%20tutorial%3A%20effetti%20con%20le%20ombre" 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=Photoshop%20tutorial%3A%20effetti%20con%20le%20ombre&amp;body=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F28%2Fphotoshop-tutorial-effetti-con-le-ombre%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=Photoshop%20tutorial%3A%20effetti%20con%20le%20ombre&amp;link=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F28%2Fphotoshop-tutorial-effetti-con-le-ombre%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%2F28%2Fphotoshop-tutorial-effetti-con-le-ombre%2F&amp;headline=Photoshop%20tutorial%3A%20effetti%20con%20le%20ombre&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%2F28%2Fphotoshop-tutorial-effetti-con-le-ombre%2F&amp;title=Photoshop%20tutorial%3A%20effetti%20con%20le%20ombre&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Come%20ottenere%20effetti%20particolari%20con%20ombre%20personalizzate%20costruite%20con%20layer%20appositamente%20distorti%20e%20manipolati" 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%2F28%2Fphotoshop-tutorial-effetti-con-le-ombre%2F&amp;title=Photoshop%20tutorial%3A%20effetti%20con%20le%20ombre" 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%2F28%2Fphotoshop-tutorial-effetti-con-le-ombre%2F&amp;t=Photoshop%20tutorial%3A%20effetti%20con%20le%20ombre" 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=Photoshop%20tutorial%3A%20effetti%20con%20le%20ombre&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F28%2Fphotoshop-tutorial-effetti-con-le-ombre%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%2F28%2Fphotoshop-tutorial-effetti-con-le-ombre%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%2F28%2Fphotoshop-tutorial-effetti-con-le-ombre%2F&amp;title=Photoshop%20tutorial%3A%20effetti%20con%20le%20ombre" 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%2F28%2Fphotoshop-tutorial-effetti-con-le-ombre%2F&amp;title=Photoshop%20tutorial%3A%20effetti%20con%20le%20ombre" 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%2F28%2Fphotoshop-tutorial-effetti-con-le-ombre%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/grafica-design/photoshop/case-study/" title="Case Study" rel="tag">Case Study</a>, <a href="http://www.undolog.com/tag/effetti/" title="Effetti" rel="tag">Effetti</a>, <a href="http://www.undolog.com/category/featured/" title="Featured" rel="tag">Featured</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/grafica-design/" title="Grafica &amp; Design" rel="tag">Grafica &amp; Design</a>, <a href="http://www.undolog.com/category/grafica-design/photoshop/" title="Photoshop" rel="tag">Photoshop</a>, <a href="http://www.undolog.com/tag/photoshop/" title="Photoshop" rel="tag">Photoshop</a>, <a href="http://www.undolog.com/tag/shadow/" title="shadow" rel="tag">shadow</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/2008/06/30/photoshop-tutorial-tecniche-di-riflessione/" title="Photoshop tutorial: tecniche di riflessione (30 giugno, 2008)">Photoshop tutorial: tecniche di riflessione</a> (9)</li>
	<li><a href="http://www.undolog.com/2008/02/26/photoshop-tutorial-pianeta-con-sole-che-sorge/" title="Photoshop tutorial: pianeta con sole che sorge (26 febbraio, 2008)">Photoshop tutorial: pianeta con sole che sorge</a> (4)</li>
	<li><a href="http://www.undolog.com/2008/02/29/photoshop-tutorial-icone-stile-web-20-in-3-passi/" title="Photoshop tutorial: icone stile web 2.0 in 3 passi (29 febbraio, 2008)">Photoshop tutorial: icone stile web 2.0 in 3 passi</a> (19)</li>
	<li><a href="http://www.undolog.com/2008/03/07/photoshop-tutorial-effetto-foglio-piegato/" title="Photoshop tutorial: effetto foglio piegato (7 marzo, 2008)">Photoshop tutorial: effetto foglio piegato</a> (15)</li>
	<li><a href="http://www.undolog.com/2009/03/30/photoshop-tutorial-curvare-un-testo-a-piacimento/" title="Photoshop tutorial: curvare un testo a piacimento (30 marzo, 2009)">Photoshop tutorial: curvare un testo a piacimento</a> (8)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2009/08/28/photoshop-tutorial-effetti-con-le-ombre/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Come impostare XCode per usare l&#8217;iPhone al posto del simulatore</title>
		<link>http://www.undolog.com/2009/08/27/come-impostare-xcode-per-usare-liphone-al-posto-del-simulatore/</link>
		<comments>http://www.undolog.com/2009/08/27/come-impostare-xcode-per-usare-liphone-al-posto-del-simulatore/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 23:05:21 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Debug]]></category>
		<category><![CDATA[Device]]></category>
		<category><![CDATA[Screencast]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=2319</guid>
		<description><![CDATA[Uno screencast di sette minuti completo di ogni dettaglio]]></description>
			<content:encoded><![CDATA[<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2009/08/imgartscreen.png" alt="Screencast" title="Screencast" width="595" height="193" /></p>
<p>In rete ho trovato un bellissimo <a target="_blank" href="http://www.mobileorchard.com/iphone-development-provisioning/"><strong>screencast</strong></a> su come configurare il nostro <em>device</em> <strong>iPhone</strong> in modo da poterlo utilizzare per il test di un'applicazione; al posto quindi del simulatore. Lo <a target="_blank" href="http://www.mobileorchard.com/iphone-development-provisioning/">screencast</a> dura circa sette minuti e ci guiderà passo per passo su tutto il processo di configurazione dell'ambiente XCode, la richiesta dei certificati, etc... così da poter lanciare il codice sorgente sul dispositivo <strong>iPhone</strong>. Contestualmente allo <a target="_blank" href="http://www.mobileorchard.com/iphone-development-provisioning/">screencast</a> potete avvalervi anche di una spiegazione testuale presente nel pacchetto.</p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F27%2Fcome-impostare-xcode-per-usare-liphone-al-posto-del-simulatore%2F&amp;title=Come%20impostare%20XCode%20per%20usare%20l%27iPhone%20al%20posto%20del%20simulatore&amp;bodytext=Uno%20screencast%20di%20sette%20minuti%20completo%20di%20ogni%20dettaglio" 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%2F27%2Fcome-impostare-xcode-per-usare-liphone-al-posto-del-simulatore%2F&amp;title=Come%20impostare%20XCode%20per%20usare%20l%27iPhone%20al%20posto%20del%20simulatore&amp;notes=Uno%20screencast%20di%20sette%20minuti%20completo%20di%20ogni%20dettaglio" 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%2F27%2Fcome-impostare-xcode-per-usare-liphone-al-posto-del-simulatore%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%2F27%2Fcome-impostare-xcode-per-usare-liphone-al-posto-del-simulatore%2F&amp;t=Come%20impostare%20XCode%20per%20usare%20l%27iPhone%20al%20posto%20del%20simulatore" 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%2F27%2Fcome-impostare-xcode-per-usare-liphone-al-posto-del-simulatore%2F&amp;title=Come%20impostare%20XCode%20per%20usare%20l%27iPhone%20al%20posto%20del%20simulatore&amp;annotation=Uno%20screencast%20di%20sette%20minuti%20completo%20di%20ogni%20dettaglio" 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%20impostare%20XCode%20per%20usare%20l%27iPhone%20al%20posto%20del%20simulatore%20-%20http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F27%2Fcome-impostare-xcode-per-usare-liphone-al-posto-del-simulatore%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%20impostare%20XCode%20per%20usare%20l%27iPhone%20al%20posto%20del%20simulatore&amp;story=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F27%2Fcome-impostare-xcode-per-usare-liphone-al-posto-del-simulatore%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%2F27%2Fcome-impostare-xcode-per-usare-liphone-al-posto-del-simulatore%2F&amp;title=Come%20impostare%20XCode%20per%20usare%20l%27iPhone%20al%20posto%20del%20simulatore" 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%20impostare%20XCode%20per%20usare%20l%27iPhone%20al%20posto%20del%20simulatore&amp;body=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F27%2Fcome-impostare-xcode-per-usare-liphone-al-posto-del-simulatore%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%20impostare%20XCode%20per%20usare%20l%27iPhone%20al%20posto%20del%20simulatore&amp;link=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F27%2Fcome-impostare-xcode-per-usare-liphone-al-posto-del-simulatore%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%2F27%2Fcome-impostare-xcode-per-usare-liphone-al-posto-del-simulatore%2F&amp;headline=Come%20impostare%20XCode%20per%20usare%20l%27iPhone%20al%20posto%20del%20simulatore&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%2F27%2Fcome-impostare-xcode-per-usare-liphone-al-posto-del-simulatore%2F&amp;title=Come%20impostare%20XCode%20per%20usare%20l%27iPhone%20al%20posto%20del%20simulatore&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Uno%20screencast%20di%20sette%20minuti%20completo%20di%20ogni%20dettaglio" 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%2F27%2Fcome-impostare-xcode-per-usare-liphone-al-posto-del-simulatore%2F&amp;title=Come%20impostare%20XCode%20per%20usare%20l%27iPhone%20al%20posto%20del%20simulatore" 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%2F27%2Fcome-impostare-xcode-per-usare-liphone-al-posto-del-simulatore%2F&amp;t=Come%20impostare%20XCode%20per%20usare%20l%27iPhone%20al%20posto%20del%20simulatore" 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%20impostare%20XCode%20per%20usare%20l%27iPhone%20al%20posto%20del%20simulatore&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F08%2F27%2Fcome-impostare-xcode-per-usare-liphone-al-posto-del-simulatore%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%2F27%2Fcome-impostare-xcode-per-usare-liphone-al-posto-del-simulatore%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%2F27%2Fcome-impostare-xcode-per-usare-liphone-al-posto-del-simulatore%2F&amp;title=Come%20impostare%20XCode%20per%20usare%20l%27iPhone%20al%20posto%20del%20simulatore" 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%2F27%2Fcome-impostare-xcode-per-usare-liphone-al-posto-del-simulatore%2F&amp;title=Come%20impostare%20XCode%20per%20usare%20l%27iPhone%20al%20posto%20del%20simulatore" 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%2F27%2Fcome-impostare-xcode-per-usare-liphone-al-posto-del-simulatore%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/apple/" title="Apple" rel="tag">Apple</a>, <a href="http://www.undolog.com/tag/debug/" title="Debug" rel="tag">Debug</a>, <a href="http://www.undolog.com/tag/device/" title="Device" rel="tag">Device</a>, <a href="http://www.undolog.com/category/featured/" title="Featured" rel="tag">Featured</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/screencast/" title="Screencast" rel="tag">Screencast</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><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2009/07/20/xcode-consigli-sul-debugging-preferences/" title="XCode: consigli sul Debugging Preferences (20 luglio, 2009)">XCode: consigli sul Debugging Preferences</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>
	<li><a href="http://www.undolog.com/2009/07/27/objective-c-unalternativa-alluso-di-cgrectmake/" title="Objective-C: un&#8217;alternativa all&#8217;uso di CGRectMake (27 luglio, 2009)">Objective-C: un&#8217;alternativa all&#8217;uso di CGRectMake</a> (2)</li>
	<li><a href="http://www.undolog.com/2009/06/29/iphone-tutti-i-font-di-sistema/" title="iPhone: tutti i font di sistema (29 giugno, 2009)">iPhone: tutti i font di sistema</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2009/08/27/come-impostare-xcode-per-usare-liphone-al-posto-del-simulatore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone SecondApp: indovina il numero &#8211; parte 2</title>
		<link>http://www.undolog.com/2009/07/13/iphone-secondapp-indovina-il-numero-parte-2/</link>
		<comments>http://www.undolog.com/2009/07/13/iphone-secondapp-indovina-il-numero-parte-2/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 06:00:41 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Google Code]]></category>
		<category><![CDATA[integerValue]]></category>
		<category><![CDATA[Interface Builder]]></category>
		<category><![CDATA[NSString]]></category>
		<category><![CDATA[UIAlertView]]></category>
		<category><![CDATA[UIButton]]></category>
		<category><![CDATA[UILabel]]></category>
		<category><![CDATA[UINavigationBar]]></category>
		<category><![CDATA[UIView]]></category>
		<category><![CDATA[UIViewController]]></category>
		<category><![CDATA[Undolibrary]]></category>
		<category><![CDATA[ViewController]]></category>
		<category><![CDATA[XCode]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=2189</guid>
		<description><![CDATA[Come anticipato in iPhone FirstApp: indovina il numero – parte 1 vediamo come realizzare un'applicazione per Apple iPhone senza usare Interface Builder! Anzi, elimineremo fisicamente i file di Interface Builder creati dal wizard di Xcode. Alla fine di questo post, quindi, avremo un'applicazione identica, in tutto e per tutto, a quella realizzata nella parte prima, [...]]]></description>
			<content:encoded><![CDATA[<p>Come anticipato in <em><a href="http://www.undolog.com/2009/06/23/iphone-firstapp-indovina-il-numero-parte-1/">iPhone FirstApp: indovina il numero – parte 1</a></em> vediamo come realizzare <strong>un'applicazione per Apple iPhone senza usare Interface Builder</strong>! Anzi, elimineremo fisicamente i file di Interface Builder creati dal wizard di Xcode. Alla fine di questo post, quindi, avremo un'applicazione identica, in tutto e per tutto, a quella realizzata nella parte prima, con la differenza che realizzeremo tutti i nostri componenti visivi, compresa la Window principale, completamente da codice.</p>
<p>L'applicazione già fatta, se volete solo scaricarla, è disponibile sul mio Google Code repository:</p>
<ul>
<li><a target="_blank" href="http://code.google.com/p/undolibrary/source/browse/trunk/iPhone/SecondApp/SecondApp/">Sfoglia sorgenti</a></li>
<li><a target="_blank" href="http://undolibrary.googlecode.com/files/SecondApp.zip">Sorgenti .zip (1005Kb)</a></li>
</ul>
<p>Vorrei far notare da subito come lo ZIP di questo esempio pesi meno di quello della scorsa volta! <img src='http://www.undolog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h4>Creiamo il progetto</h4>
<p>Iniziamo creando il nostro progetto <code>SecondApp</code> (per distinguerlo da FirstApp), anche se questa volta sceglieremo <strong>Window-based Application</strong>:</p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2009/07/newproject.png" alt="newproject" title="newproject" width="520" height="399" /></p>
<p>Adesso andiamo ad eliminare tutto ciò che riguarda Interface Builder. Eliminiamo il file <strong><code>MainWindow.xib</code></strong>, situato nella cartella <strong><code>Resources</code></strong>: eliminatelo anche dal file system, quindi selezionate <strong>Also Move to Trash</strong>. Selezionate, poi, il file <strong><code>SecondoApp-info.plist</code></strong> ed eliminate il riferimento alla <strong><code>MainWindow</code></strong> nella casella <strong>Main nib file base name</strong>:</p>
<p class="center"><img class="border" src="http://www.undolog.com/wp-content/uploads/2009/07/deleteib.png" alt="deleteib" title="deleteib" width="595" height="346" /></p>
<p>A questo punto non abbiamo più nessuna Window, almeno tramite Interface Builder. Quindi apriamo il file <strong><code>main.m</code></strong>, situato in <strong><code>Other Sources</code></strong>, e modifichiamo la funzione <code>main()</code> in questo modo:</p>
<div class="igBar"><span id="lobjc-32"><a href="#" onclick="javascript:showCodeTxt('objc-32'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Objective-C:</span>
<div id="objc-32">
<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: #a61390;">int</span> main<span style="color: #002200;">&#40;</span><span style="color: #a61390;">int</span> argc, <span style="color: #a61390;">char</span> <span style="color: #002200;">*</span>argv<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#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; </div>
</li>
<li style="font-weight: 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; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSAutoreleasePool_Class/"><span style="color: #400080;">NSAutoreleasePool</span></a> <span style="color: #002200;">*</span> pool <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSAutoreleasePool_Class/"><span style="color: #400080;">NSAutoreleasePool</span></a> 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;">&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; <span style="color: #11740a; font-style: italic;">// avendo eliminato il file .xib abbiamo perso il puntamento</span></div>
</li>
<li style="font-weight: 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: #11740a; font-style: italic;">// all'app delegate, quindi lo passiamo a &quot;mano&quot;</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;">int</span> retVal <span style="color: #002200;">=</span> UIApplicationMain<span style="color: #002200;">&#40;</span>argc, argv, <span style="color: #a61390;">nil</span>, <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;SecondAppAppDelegate&quot;</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;">&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: #002200;">&#91;</span>pool release<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;">&nbsp; &nbsp; <span style="color: #a61390;">return</span> retVal;</div>
</li>
<li style="font-weight: 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;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Apriamo quindi SecondAppAppDelegate.m e creiamo la Window principale via codice:</p>
<div class="igBar"><span id="lobjc-33"><a href="#" onclick="javascript:showCodeTxt('objc-33'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Objective-C:</span>
<div id="objc-33">
<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;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>applicationDidFinishLaunching<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIApplication <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>application <span style="color: #002200;">&#123;</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;</div>
</li>
<li style="font-weight: 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;">// ottiene le dimensioni delle schermo (320, 480)</span></div>
</li>
<li style="font-weight: 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; CGRect windowRect <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIScreen mainScreen<span style="color: #002200;">&#93;</span> applicationFrame<span style="color: #002200;">&#93;</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;">// creiamo una finestra - visto che abbiamo fatto bye bye a Interface Builder</span></div>
</li>
<li style="font-weight: 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; UIWindow <span style="color: #002200;">*</span>mainWindow <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIWindow alloc<span style="color: #002200;">&#93;</span> initWithFrame<span style="color: #002200;">:</span>windowRect<span style="color: #002200;">&#93;</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;">// impostiamo il background della Window a giallo, per differenziarlo</span></div>
</li>
<li style="font-weight: 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: #11740a; font-style: italic;">// dalla precedente applicazione FirstApp</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: #002200;">&#91;</span>mainWindow setBackgroundColor<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>UIColor yellowColor<span style="color: #002200;">&#93;</span><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;">&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; <span style="color: #002200;">&#91;</span>self setWindow<span style="color: #002200;">:</span>mainWindow<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;">&nbsp; &nbsp; <span style="color: #002200;">&#91;</span>window makeKeyAndVisible<span style="color: #002200;">&#93;</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; </div>
</li>
<li style="font-weight: 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: #002200;">&#91;</span>mainWindow release<span style="color: #002200;">&#93;</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;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Potete già provare l'applicazione; se appare una window gialla avete fatto tutto bene!</p>
<p>Nel file <code>SecondAppAppDelegate.h</code> possiamo eliminare <code>IBOutlet</code>, necessario solo se si usa Interface Builder. Inoltre aggiungiamo qui le nostre variabili globali che, nella scorsa volta, avevamo inserito nel Controller. Modifichiamo quindi il file <code>SecondAppAppDelegate.h</code>:</p>
<div class="igBar"><span id="lobjc-34"><a href="#" onclick="javascript:showCodeTxt('objc-34'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Objective-C:</span>
<div id="objc-34">
<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: #6e371a;">#import &lt;UIKit/UIKit.h&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;</div>
</li>
<li style="font-weight: 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;">@interface</span> SecondAppAppDelegate <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> &lt;UIApplicationDelegate&gt; <span style="color: #002200;">&#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; UIWindow <span style="color: #002200;">*</span>window;</div>
</li>
<li style="font-weight: 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; </div>
</li>
<li style="font-weight: 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; UITextField <span style="color: #002200;">*</span>numero;</div>
</li>
<li style="font-weight: 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; UIButton <span style="color: #002200;">*</span>bottone;</div>
</li>
<li style="font-weight: 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: #a61390;">int</span> numeroACaso;</div>
</li>
<li style="font-weight: 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;">&#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;</div>
</li>
<li style="font-weight: 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;">@property</span> <span style="color: #002200;">&#40;</span>nonatomic, retain<span style="color: #002200;">&#41;</span> UIWindow <span style="color: #002200;">*</span>window;</div>
</li>
<li style="font-weight: 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: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>controllaNumero;</div>
</li>
<li style="font-weight: 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: #a61390;">@end</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Anche in questo caso abbiamo preparato la definizione del metodo <strong><code>controllaNumero</code></strong>, come la scorsa volta, ma abbiamo eliminato l'indicazione <strong><code>IBAction</code></strong>, in quanto non stiamo usando Interface Builder.</p>
<h4>Costruiamo l'interfaccia da codice</h4>
<p>E' giunto il momento di creare tramite codice tutti i componenti della nostra interfaccia. Torniamo nel file <code>SecondAppAppDelegate.m</code>, posizioniamoci prima del <code>[mainWindow release]</code> ed inseriamo il seguente codice:</p>
<div class="igBar"><span id="lobjc-35"><a href="#" onclick="javascript:showCodeTxt('objc-35'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Objective-C:</span>
<div id="objc-35">
<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;">// crea la barra del titolo</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">UINavigationBar <span style="color: #002200;">*</span>myNavigationBar <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UINavigationBar alloc<span style="color: #002200;">&#93;</span> initWithFrame<span style="color: #002200;">:</span>CGRectMake<span style="color: #002200;">&#40;</span>0.0, 0.0, 320.0, 44.0<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</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;">myNavigationBar.barStyle <span style="color: #002200;">=</span> UIBarStyleDefault;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">UINavigationItem <span style="color: #002200;">*</span>navigationItem <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UINavigationItem alloc<span style="color: #002200;">&#93;</span> initWithTitle<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Indovina un numero&quot;</span><span style="color: #002200;">&#93;</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>myNavigationBar pushNavigationItem<span style="color: #002200;">:</span>navigationItem animated<span style="color: #002200;">:</span><span style="color: #a61390;">NO</span><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: #002200;">&#91;</span>window addSubview<span style="color: #002200;">:</span>myNavigationBar<span style="color: #002200;">&#93;</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; </div>
</li>
<li style="font-weight: 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;">// crea la label</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;">UILabel <span style="color: #002200;">*</span>myLabel <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UILabel alloc<span style="color: #002200;">&#93;</span> initWithFrame<span style="color: #002200;">:</span>CGRectMake<span style="color: #002200;">&#40;</span>10, 50, 300, 80<span style="color: #002200;">&#41;</span><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;">myLabel.backgroundColor <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIColor clearColor<span style="color: #002200;">&#93;</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;">myLabel.numberOfLines <span style="color: #002200;">=</span> <span style="color: #2400d9;color:#800000;">2</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">myLabel.text <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;iPhone ha pensato un numero da 1 a 10, prova ad indovinarlo?&quot;</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>window addSubview<span style="color: #002200;">:</span>myLabel<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;">&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;"><span style="color: #11740a; font-style: italic;">// crea il text input</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">numero <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UITextField alloc<span style="color: #002200;">&#93;</span> initWithFrame<span style="color: #002200;">:</span>CGRectMake<span style="color: #002200;">&#40;</span>10, 120, 300, 30<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</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;">numero.borderStyle <span style="color: #002200;">=</span> UITextBorderStyleRoundedRect;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">numero.textAlignment <span style="color: #002200;">=</span> UITextAlignmentCenter;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">numero.keyboardType <span style="color: #002200;">=</span> UIKeyboardTypeNumberPad;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">numero.placeholder <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Inserisci il numero&quot;</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>window addSubview<span style="color: #002200;">:</span>numero<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;">&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;"><span style="color: #11740a; font-style: italic;">// crea il bottone</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">bottone <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIButton buttonWithType<span style="color: #002200;">:</span>UIButtonTypeRoundedRect<span style="color: #002200;">&#93;</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;">bottone.frame <span style="color: #002200;">=</span> CGRectMake<span style="color: #002200;">&#40;</span>10, 180, 300, 30<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: #002200;">&#91;</span>bottone setTitle<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Premi qui&quot;</span> forState<span style="color: #002200;">:</span>UIControlStateNormal<span style="color: #002200;">&#93;</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>bottone addTarget<span style="color: #002200;">:</span>self action<span style="color: #002200;">:</span><span style="color: #a61390;">@selector</span><span style="color: #002200;">&#40;</span>controllaNumero<span style="color: #002200;">&#41;</span> forControlEvents<span style="color: #002200;">:</span>UIControlEventTouchUpInside<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: #002200;">&#91;</span>window addSubview<span style="color: #002200;">:</span>bottone<span style="color: #002200;">&#93;</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; </div>
</li>
<li style="font-weight: 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;">&#91;</span>myLabel release<span style="color: #002200;">&#93;</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>navigationItem release<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: #002200;">&#91;</span>myNavigationBar release<span style="color: #002200;">&#93;</span>;</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Dato che l'<code>applicationDidFinishLaunching</code> corrisponde alla <code>viewDidLoad</code> della scorsa volta, subito dopo il <code>[mainWindow release];</code> inseriamo:</p>
<div class="igBar"><span id="lobjc-36"><a href="#" onclick="javascript:showCodeTxt('objc-36'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Objective-C:</span>
<div id="objc-36">
<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;">numeroACaso <span style="color: #002200;">=</span> 1 <span style="color: #002200;">+</span> arc4random<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">%</span> <span style="color: #2400d9;color:#800000;">10</span>;</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ora non ci rimane che implementare il metodo <code>controllaNumero</code>, che sarà identico (a parte il prototipo) a quello usato la scorsa volta:</p>
<div class="igBar"><span id="lobjc-37"><a href="#" onclick="javascript:showCodeTxt('objc-37'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Objective-C:</span>
<div id="objc-37">
<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;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> controllaNumero <span style="color: #002200;">&#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; NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Premuto bottone di controlla numero&quot;</span><span style="color: #002200;">&#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; <span style="color: #a61390;">int</span> numeroInserito <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>numero.text integerValue<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;">&nbsp; &nbsp; <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>message;</div>
</li>
<li style="font-weight: 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; NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Il numero inserito è %d&quot;</span>, numeroInserito <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;">&nbsp; &nbsp; <span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span> numeroInserito &lt;numeroACaso <span style="color: #002200;">&#41;</span> <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; &nbsp; &nbsp; message <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Troppo basso...&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; <span style="color: #002200;">&#125;</span> <span style="color: #a61390;">else</span> <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>numeroInserito&gt; numeroACaso <span style="color: #002200;">&#41;</span> <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; &nbsp; &nbsp; message <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Troppo alto...&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; <span style="color: #002200;">&#125;</span> <span style="color: #a61390;">else</span> <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>numeroInserito <span style="color: #002200;">==</span> numeroACaso <span style="color: #002200;">&#41;</span> <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; &nbsp; &nbsp; message <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Bravo hai indovinato&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; numeroACaso <span style="color: #002200;">=</span> 1 <span style="color: #002200;">+</span> arc4random<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">%</span> <span style="color: #2400d9;color:#800000;">10</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; NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Numero pensato %d&quot;</span>, numeroACaso<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;">&nbsp; &nbsp; <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; &nbsp; UIAlertView <span style="color: #002200;">*</span>alertMessaggio <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIAlertView 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;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; initWithTitle<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Responso&quot;</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; message<span style="color: #002200;">:</span> message </div>
</li>
<li style="font-weight: 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; delegate<span style="color: #002200;">:</span><span style="color: #a61390;">nil</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; cancelButtonTitle<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;OK&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; &nbsp; &nbsp; &nbsp; &nbsp; otherButtonTitles<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</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: #002200;">&#91;</span>alertMessaggio show<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;">&nbsp; &nbsp; <span style="color: #002200;">&#91;</span>alertMessaggio release<span style="color: #002200;">&#93;</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; numero.text <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;&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;"><span style="color: #002200;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Abbiamo finito!</p>
<h4>Conclusioni e considerazioni</h4>
<p>Questo esempio non fa uso diretto di una <code>UIView</code> o di un <code>UIViewController</code>, proprio perchè volevo lasciarlo il più semplice e snello possibile e, anche, per dimostrare che non sono elementi sempre necessari. Tuttavia inserire gli oggetti direttamente nella window può avere un qualche senso in questo esempio ed in altri sporadici contesti. L'uso delle <code>UIView</code> e dei <code>UIViewController</code> portano comunque benefici in tantissimi altri casi, ein alcuni sono praticamente indispensabili; come avremo modo di vedere in futuro.</p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F07%2F13%2Fiphone-secondapp-indovina-il-numero-parte-2%2F&amp;title=iPhone%20SecondApp%3A%20indovina%20il%20numero%20-%20parte%202&amp;bodytext=Come%20anticipato%20in%20iPhone%20FirstApp%3A%20indovina%20il%20numero%20%E2%80%93%20parte%201%20vediamo%20come%20realizzare%20un%27applicazione%20per%20Apple%20iPhone%20senza%20usare%20Interface%20Builder%21%20Anzi%2C%20elimineremo%20fisicamente%20i%20file%20di%20Interface%20Builder%20creati%20dal%20wizard%20di%20Xcode.%20Alla%20fine" 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%2F07%2F13%2Fiphone-secondapp-indovina-il-numero-parte-2%2F&amp;title=iPhone%20SecondApp%3A%20indovina%20il%20numero%20-%20parte%202&amp;notes=Come%20anticipato%20in%20iPhone%20FirstApp%3A%20indovina%20il%20numero%20%E2%80%93%20parte%201%20vediamo%20come%20realizzare%20un%27applicazione%20per%20Apple%20iPhone%20senza%20usare%20Interface%20Builder%21%20Anzi%2C%20elimineremo%20fisicamente%20i%20file%20di%20Interface%20Builder%20creati%20dal%20wizard%20di%20Xcode.%20Alla%20fine" 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%2F07%2F13%2Fiphone-secondapp-indovina-il-numero-parte-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%2F2009%2F07%2F13%2Fiphone-secondapp-indovina-il-numero-parte-2%2F&amp;t=iPhone%20SecondApp%3A%20indovina%20il%20numero%20-%20parte%202" 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%2F07%2F13%2Fiphone-secondapp-indovina-il-numero-parte-2%2F&amp;title=iPhone%20SecondApp%3A%20indovina%20il%20numero%20-%20parte%202&amp;annotation=Come%20anticipato%20in%20iPhone%20FirstApp%3A%20indovina%20il%20numero%20%E2%80%93%20parte%201%20vediamo%20come%20realizzare%20un%27applicazione%20per%20Apple%20iPhone%20senza%20usare%20Interface%20Builder%21%20Anzi%2C%20elimineremo%20fisicamente%20i%20file%20di%20Interface%20Builder%20creati%20dal%20wizard%20di%20Xcode.%20Alla%20fine" 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=iPhone%20SecondApp%3A%20indovina%20il%20numero%20-%20parte%202%20-%20http%3A%2F%2Fwww.undolog.com%2F2009%2F07%2F13%2Fiphone-secondapp-indovina-il-numero-parte-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=iPhone%20SecondApp%3A%20indovina%20il%20numero%20-%20parte%202&amp;story=http%3A%2F%2Fwww.undolog.com%2F2009%2F07%2F13%2Fiphone-secondapp-indovina-il-numero-parte-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%2F2009%2F07%2F13%2Fiphone-secondapp-indovina-il-numero-parte-2%2F&amp;title=iPhone%20SecondApp%3A%20indovina%20il%20numero%20-%20parte%202" 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=iPhone%20SecondApp%3A%20indovina%20il%20numero%20-%20parte%202&amp;body=http%3A%2F%2Fwww.undolog.com%2F2009%2F07%2F13%2Fiphone-secondapp-indovina-il-numero-parte-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=iPhone%20SecondApp%3A%20indovina%20il%20numero%20-%20parte%202&amp;link=http%3A%2F%2Fwww.undolog.com%2F2009%2F07%2F13%2Fiphone-secondapp-indovina-il-numero-parte-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%2F2009%2F07%2F13%2Fiphone-secondapp-indovina-il-numero-parte-2%2F&amp;headline=iPhone%20SecondApp%3A%20indovina%20il%20numero%20-%20parte%202&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%2F07%2F13%2Fiphone-secondapp-indovina-il-numero-parte-2%2F&amp;title=iPhone%20SecondApp%3A%20indovina%20il%20numero%20-%20parte%202&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Come%20anticipato%20in%20iPhone%20FirstApp%3A%20indovina%20il%20numero%20%E2%80%93%20parte%201%20vediamo%20come%20realizzare%20un%27applicazione%20per%20Apple%20iPhone%20senza%20usare%20Interface%20Builder%21%20Anzi%2C%20elimineremo%20fisicamente%20i%20file%20di%20Interface%20Builder%20creati%20dal%20wizard%20di%20Xcode.%20Alla%20fine" 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%2F07%2F13%2Fiphone-secondapp-indovina-il-numero-parte-2%2F&amp;title=iPhone%20SecondApp%3A%20indovina%20il%20numero%20-%20parte%202" 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%2F07%2F13%2Fiphone-secondapp-indovina-il-numero-parte-2%2F&amp;t=iPhone%20SecondApp%3A%20indovina%20il%20numero%20-%20parte%202" 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=iPhone%20SecondApp%3A%20indovina%20il%20numero%20-%20parte%202&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F07%2F13%2Fiphone-secondapp-indovina-il-numero-parte-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%2F2009%2F07%2F13%2Fiphone-secondapp-indovina-il-numero-parte-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%2F2009%2F07%2F13%2Fiphone-secondapp-indovina-il-numero-parte-2%2F&amp;title=iPhone%20SecondApp%3A%20indovina%20il%20numero%20-%20parte%202" 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%2F07%2F13%2Fiphone-secondapp-indovina-il-numero-parte-2%2F&amp;title=iPhone%20SecondApp%3A%20indovina%20il%20numero%20-%20parte%202" 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%2F07%2F13%2Fiphone-secondapp-indovina-il-numero-parte-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/tag/apple/" title="Apple" rel="tag">Apple</a>, <a href="http://www.undolog.com/tag/google-code/" title="Google Code" rel="tag">Google Code</a>, <a href="http://www.undolog.com/tag/integervalue/" title="integerValue" rel="tag">integerValue</a>, <a href="http://www.undolog.com/tag/interface-builder/" title="Interface Builder" rel="tag">Interface Builder</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/nsstring/" title="NSString" rel="tag">NSString</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/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/uialertview/" title="UIAlertView" rel="tag">UIAlertView</a>, <a href="http://www.undolog.com/tag/uibutton/" title="UIButton" rel="tag">UIButton</a>, <a href="http://www.undolog.com/tag/uilabel/" title="UILabel" rel="tag">UILabel</a>, <a href="http://www.undolog.com/tag/uinavigationbar/" title="UINavigationBar" rel="tag">UINavigationBar</a>, <a href="http://www.undolog.com/tag/uiview/" title="UIView" rel="tag">UIView</a>, <a href="http://www.undolog.com/tag/uiviewcontroller/" title="UIViewController" rel="tag">UIViewController</a>, <a href="http://www.undolog.com/tag/undolibrary/" title="Undolibrary" rel="tag">Undolibrary</a>, <a href="http://www.undolog.com/tag/viewcontroller/" title="ViewController" rel="tag">ViewController</a>, <a href="http://www.undolog.com/tag/xcode/" title="XCode" rel="tag">XCode</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2009/06/23/iphone-firstapp-indovina-il-numero-parte-1/" title="iPhone FirstApp: indovina il numero &#8211; parte 1 (23 giugno, 2009)">iPhone FirstApp: indovina il numero &#8211; parte 1</a> (0)</li>
	<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/2009/07/23/xcode-shortcut/" title="Xcode shortcut (23 luglio, 2009)">Xcode shortcut</a> (0)</li>
	<li><a href="http://www.undolog.com/2009/07/27/objective-c-unalternativa-alluso-di-cgrectmake/" title="Objective-C: un&#8217;alternativa all&#8217;uso di CGRectMake (27 luglio, 2009)">Objective-C: un&#8217;alternativa all&#8217;uso di CGRectMake</a> (2)</li>
	<li><a href="http://www.undolog.com/2009/06/23/objective-c-conversione-dei-tipi/" title="Objective-C: conversione dei tipi (23 giugno, 2009)">Objective-C: conversione dei tipi</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2009/07/13/iphone-secondapp-indovina-il-numero-parte-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Very short trick: Wordpress, evidenziare i risultati di una ricerca</title>
		<link>http://www.undolog.com/2009/07/09/very-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca/</link>
		<comments>http://www.undolog.com/2009/07/09/very-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 07:00:51 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[get_the_excerpt()]]></category>
		<category><![CDATA[Loop]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[Search-Hilite]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=2158</guid>
		<description><![CDATA[Esistono numerosi Plugin per Wordpress che permettono di migliorare le caratteristiche e le prestazioni della funzione "cerca". Quasi tutti i Plugin disponibili hanno l'utile e gradevole caratteristica di evidenziare le parole cercate nel risultato delle ricerca. Se non avete intenzione di appensantire ulteriormente la vostra installazione Wordpress ma non volete rinunciare del tutto ad una [...]]]></description>
			<content:encoded><![CDATA[<p>Esistono numerosi Plugin per Wordpress che permettono di migliorare le caratteristiche e le prestazioni della funzione "cerca". Quasi tutti i Plugin disponibili hanno l'utile e gradevole caratteristica di <strong>evidenziare le parole cercate nel risultato delle ricerca</strong>. Se non avete intenzione di appensantire ulteriormente la vostra installazione Wordpress ma non volete rinunciare del tutto ad una funzionalità simile, ecco come implementare facilmente un "evidenzia" dei termii di ricerca nei risultati.</p>
<p>Aprite il file <strong><code>search.php</code></strong> e inserire il seguente codice all'interno del loop centrale o, se utilizzate un tema standard, cercate il <strong><code>div class="entry"</code></strong>. In pratica andiamo a modificare l'emissione del risultato dopo una ricerca:</p>
<div class="igBar"><span id="lphp-39"><a href="#" onclick="javascript:showCodeTxt('php-39'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-39">
<div class="php" 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;">&lt;div class=&quot;entry&quot;&gt;</div>
</li>
<li style="font-weight: 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; font-weight: bold;">&lt;?php</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: #666666; font-style: italic;">// Nella variabile $s c'è la stringa di ricerca</span></div>
</li>
<li style="font-weight: 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: #666666; font-style: italic;">// ad esempio: parolaA parolaB</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: #000088;">$keys</span> &nbsp; &nbsp;<span style="color: #339933;">=</span> <a href="http://www.php.net/explode"><span style="color: #990000;">explode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$s</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: 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: #666666; font-style: italic;">// Prelevo il riassunto, non il testo intero</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: #000088;">$excerpt</span> <span style="color: #339933;">=</span> get_the_excerpt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: 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: #666666; font-style: italic;">// avvolgo nel riassunto le parole cercate</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: #666666; font-style: italic;">// con &lt;strong class=&quot;evidenzia&quot;&gt;parolaA&lt;/strong&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; <span style="color: #000088;">$excerpt</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/('</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/implode"><span style="color: #990000;">implode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'|'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$keys</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">')/iu'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;strong class=&quot;evidenzia&quot;&gt;\0&lt;/strong&gt;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$excerpt</span><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;">&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Mostro il riassunto alterato</span></div>
</li>
<li style="font-weight: 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: #b1b100;">echo</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;the_excerpt&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$excerpt</span><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: #000000; font-weight: bold;">?&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;">&lt;p class=&quot;right more&quot;&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;Leggi tutto&lt;/a&gt;&lt;/p&gt;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#758DB8;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&lt;/div&gt;</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Tutte le parole inserite nel campo di ricerca saranno evidenziate (la classe CSS <code>evidenzia</code> potete definirla a piacere, ad esempio con un <code>background</code> giallino simile ad un evidenziatore... o quello che volete) nel risultato <strong>se presenti nel riassunto</strong>. Questa procedura, infatti, ha il limite di agire <strong>solo sulla prima parte del nostro post (excerpt)</strong> e non su tutto il suo contenuto. Tuttavia è una buona alternativa all'installazione di un ulteriore plugin.</p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F07%2F09%2Fvery-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca%2F&amp;title=Very%20short%20trick%3A%20Wordpress%2C%20evidenziare%20i%20risultati%20di%20una%20ricerca&amp;bodytext=Esistono%20numerosi%20Plugin%20per%20Wordpress%20che%20permettono%20di%20migliorare%20le%20caratteristiche%20e%20le%20prestazioni%20della%20funzione%20%22cerca%22.%20Quasi%20tutti%20i%20Plugin%20disponibili%20hanno%20l%27utile%20e%20gradevole%20caratteristica%20di%20evidenziare%20le%20parole%20cercate%20nel%20risultato%20d" 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%2F07%2F09%2Fvery-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca%2F&amp;title=Very%20short%20trick%3A%20Wordpress%2C%20evidenziare%20i%20risultati%20di%20una%20ricerca&amp;notes=Esistono%20numerosi%20Plugin%20per%20Wordpress%20che%20permettono%20di%20migliorare%20le%20caratteristiche%20e%20le%20prestazioni%20della%20funzione%20%22cerca%22.%20Quasi%20tutti%20i%20Plugin%20disponibili%20hanno%20l%27utile%20e%20gradevole%20caratteristica%20di%20evidenziare%20le%20parole%20cercate%20nel%20risultato%20d" 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%2F07%2F09%2Fvery-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca%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%2F07%2F09%2Fvery-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca%2F&amp;t=Very%20short%20trick%3A%20Wordpress%2C%20evidenziare%20i%20risultati%20di%20una%20ricerca" 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%2F07%2F09%2Fvery-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca%2F&amp;title=Very%20short%20trick%3A%20Wordpress%2C%20evidenziare%20i%20risultati%20di%20una%20ricerca&amp;annotation=Esistono%20numerosi%20Plugin%20per%20Wordpress%20che%20permettono%20di%20migliorare%20le%20caratteristiche%20e%20le%20prestazioni%20della%20funzione%20%22cerca%22.%20Quasi%20tutti%20i%20Plugin%20disponibili%20hanno%20l%27utile%20e%20gradevole%20caratteristica%20di%20evidenziare%20le%20parole%20cercate%20nel%20risultato%20d" 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%20Wordpress%2C%20evidenziare%20i%20risultati%20di%20una%20ricerca%20-%20http%3A%2F%2Fwww.undolog.com%2F2009%2F07%2F09%2Fvery-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca%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%20Wordpress%2C%20evidenziare%20i%20risultati%20di%20una%20ricerca&amp;story=http%3A%2F%2Fwww.undolog.com%2F2009%2F07%2F09%2Fvery-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca%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%2F07%2F09%2Fvery-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca%2F&amp;title=Very%20short%20trick%3A%20Wordpress%2C%20evidenziare%20i%20risultati%20di%20una%20ricerca" 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%20Wordpress%2C%20evidenziare%20i%20risultati%20di%20una%20ricerca&amp;body=http%3A%2F%2Fwww.undolog.com%2F2009%2F07%2F09%2Fvery-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca%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%20Wordpress%2C%20evidenziare%20i%20risultati%20di%20una%20ricerca&amp;link=http%3A%2F%2Fwww.undolog.com%2F2009%2F07%2F09%2Fvery-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca%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%2F07%2F09%2Fvery-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca%2F&amp;headline=Very%20short%20trick%3A%20Wordpress%2C%20evidenziare%20i%20risultati%20di%20una%20ricerca&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%2F07%2F09%2Fvery-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca%2F&amp;title=Very%20short%20trick%3A%20Wordpress%2C%20evidenziare%20i%20risultati%20di%20una%20ricerca&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Esistono%20numerosi%20Plugin%20per%20Wordpress%20che%20permettono%20di%20migliorare%20le%20caratteristiche%20e%20le%20prestazioni%20della%20funzione%20%22cerca%22.%20Quasi%20tutti%20i%20Plugin%20disponibili%20hanno%20l%27utile%20e%20gradevole%20caratteristica%20di%20evidenziare%20le%20parole%20cercate%20nel%20risultato%20d" 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%2F07%2F09%2Fvery-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca%2F&amp;title=Very%20short%20trick%3A%20Wordpress%2C%20evidenziare%20i%20risultati%20di%20una%20ricerca" 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%2F07%2F09%2Fvery-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca%2F&amp;t=Very%20short%20trick%3A%20Wordpress%2C%20evidenziare%20i%20risultati%20di%20una%20ricerca" 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%20Wordpress%2C%20evidenziare%20i%20risultati%20di%20una%20ricerca&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F07%2F09%2Fvery-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca%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%2F07%2F09%2Fvery-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca%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%2F07%2F09%2Fvery-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca%2F&amp;title=Very%20short%20trick%3A%20Wordpress%2C%20evidenziare%20i%20risultati%20di%20una%20ricerca" 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%2F07%2F09%2Fvery-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca%2F&amp;title=Very%20short%20trick%3A%20Wordpress%2C%20evidenziare%20i%20risultati%20di%20una%20ricerca" 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%2F07%2F09%2Fvery-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca%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/get_the_excerpt/" title="get_the_excerpt()" rel="tag">get_the_excerpt()</a>, <a href="http://www.undolog.com/tag/loop/" title="Loop" rel="tag">Loop</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/search/" title="search" rel="tag">search</a>, <a href="http://www.undolog.com/tag/search-hilite/" title="Search-Hilite" rel="tag">Search-Hilite</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>, <a href="http://www.undolog.com/category/tutorials/" title="Tutorials" rel="tag">Tutorials</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/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>
	<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/2008/10/17/wordpress-modifcare-adminbigwidth-per-gli-sviluppatori/" title="Wordpress: modifcare AdminBigWidth per gli sviluppatori (17 ottobre, 2008)">Wordpress: modifcare AdminBigWidth per gli sviluppatori</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/2008/12/22/wordpress-plugin-flash-feed-scroll-reader/" title="Wordpress Plugin: Flash Feed Scroll Reader (22 dicembre, 2008)">Wordpress Plugin: Flash Feed Scroll Reader</a> (7)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2009/07/09/very-short-trick-wordpress-evidenziare-i-risultati-di-una-ricerca/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Wordpress: usare gli shortcodes</title>
		<link>http://www.undolog.com/2009/07/03/wordpress-usare-gli-shortcodes/</link>
		<comments>http://www.undolog.com/2009/07/03/wordpress-usare-gli-shortcodes/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 05:00:15 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[add_shortcode()]]></category>
		<category><![CDATA[functions.php]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[shortcodes]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=1949</guid>
		<description><![CDATA[Dalla versione 2.5 di Wordpress (meglio 2.5.1) sono disponibili i cosidetti shortcodes, una procedura che permette di creare delle callback, o meglio degli hook, quando nel testo del nostro post viene trovata una stringa formattata con le parentesi quadre tipo [id_shortcode]. Prima della release 2.5 di Wordpress gli shortcodes erano implementati manualmente (vedi Napolux), ora [...]]]></description>
			<content:encoded><![CDATA[<p>Dalla versione 2.5 di Wordpress (meglio 2.5.1) sono disponibili i cosidetti <strong><a target="_blank" href="http://codex.wordpress.org/Shortcode_API">shortcodes</a></strong>, una procedura che permette di creare delle callback, o meglio degli hook, quando nel testo del nostro post viene trovata una stringa formattata con le parentesi quadre tipo <code>[id_shortcode]</code>. Prima della release 2.5 di Wordpress gli shortcodes erano implementati manualmente (vedi <a target="_blank" href="http://www.napolux.com/2008/wordpress-add_filter-e-altre-amenita.html">Napolux</a>), ora è possibile sfruttarli con più semplicità e per gli usi più disparati.</p>
<h4>Sintassi</h4>
<p>Per utilizzare gli shortcodes è sufficente creare una funzione di hook, con dei parametri standard e impostare lo shortcodes tramite <code>add_shortcode()</code>:</p>
<div class="igBar"><span id="lphp-53"><a href="#" onclick="javascript:showCodeTxt('php-53'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-53">
<div class="php" 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: #009933; 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: #009933; font-style: italic;">&nbsp;* Questo è il prototipo della funzione di hook</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: #009933; font-style: italic;">&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: #000000; font-weight: bold;">function</span> mio_shortcode_hook<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attrs</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#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: #666666; font-style: italic;">// codice qui</span></div>
</li>
<li style="font-weight: 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: #b1b100;">return</span> <span style="color: #0000ff;">&quot;Output nel post&quot;</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>
<li style="font-weight: 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: #009933; 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: #009933; font-style: italic;">&nbsp;* add_shortcode() accetta due parametri:</span></div>
</li>
<li style="font-weight: 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: #009933; font-style: italic;">&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: #009933; font-style: italic;">&nbsp;* @param string $tag Shortcode tag to be searched in post content.</span></div>
</li>
<li style="font-weight: 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: #009933; font-style: italic;">&nbsp;* @param callable $func Hook to run when shortcode is found.</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: #009933; font-style: italic;">&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;">add_shortcode<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;mio_shortcode&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;mio_shortcodes_hook&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Questo codice può essere posizionato nel file <code>functions.php</code>. Durante la scrittura del post inserendo <code>mio_shortcode</code> tra parentesi quadre sarà eseguito il codice dell'hook (della funzione) <code>mio_shortcode_hook()</code>.</p>
<p>La funzione di hook, e il nostro shortcode, possono essere utilizzati in vari modi a seconda delle necessità:</p>
<div class="igBar"><span id="lhtml-54"><a href="#" onclick="javascript:showCodeTxt('html-54'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-54">
<div class="html" 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;"><span style="color: #808080; font-style: italic;">&lt;!-- solo shortcode --&gt;</span></span></div>
</li>
<li style="font-weight: 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_shortcode]</div>
</li>
<li style="font-weight: 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;"><span style="color: #808080; font-style: italic;">&lt;!-- con attributi --&gt;</span></span></div>
</li>
<li style="font-weight: 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_shortcode color='#000000']</div>
</li>
<li style="font-weight: 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;"><span style="color: #808080; font-style: italic;">&lt;!-- con contenuto incluso --&gt;</span></span></div>
</li>
<li style="font-weight: 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_shortcode color='#000000']Sono il contenuto[/mio_shortcode]</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<blockquote><p><del datetime="2009-07-03T15:55:26+00:00"><strong>Note</strong>: nel codice qui sopra ho dovuto inserire uno spazio nello shortcode di chiusura tra l'apertura della parentesi quadra e lo slash. Tale spazio andrà eliminato nel vostro codice. Tutto questo a causa di un conflitto con il plugin che uso per visualizzare il codice, in quanto anc'esso usa una sintassi simile a quella degli shortcode</del></p>
</blockquote>
<h4>Gestione degli attributi</h4>
<p>Gli attributi inseriti in uno shortcode sono facilissimi da gestire ed è possibile impostare dei valore di default. Ecco ad esempio come creare uno shortcode che gestisca un titolo formattato in modo speciale:</p>
<div class="igBar"><span id="lphp-55"><a href="#" onclick="javascript:showCodeTxt('php-55'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-55">
<div class="php" 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: #000000; font-weight: bold;">function</span> mio_shortcode_hook<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attrs</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</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;">&nbsp; &nbsp; <a href="http://www.php.net/extract"><span style="color: #990000;">extract</span></a><span style="color: #009900;">&#40;</span> shortcode_atts<span style="color: #009900;">&#40;</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#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; &nbsp; &nbsp; <span style="color: #0000ff;">'attr_1'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'attributo 1 default'</span><span style="color: #339933;">,</span></div>
</li>
<li style="font-weight: 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: #0000ff;">'attr_2'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'attributo 2 default'</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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// ...etc</span></div>
</li>
<li style="font-weight: 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;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$attrs</span> <span style="color: #009900;">&#41;</span> <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;">&nbsp; &nbsp; <span style="color: #666666; 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: #009900;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Similmente a come abbiamo visto in <em><a href="http://www.undolog.com/2009/01/05/wordpress-wp_parse_args/">Wordpress: wp_parse_args()</a></em> , la gestione degli attributi è davvero semplice e permette di impostare dei valori di default in caso di assenza degli attributi stessi. Il codice sopra esposto "fonde" l'array <code>$attrs</code> con quello dinamico tramite la funzione <code>shortcode_atts()</code> (cugina della <code>wp_parse_args()</code>), rendendo disponibile nello scope della funzione (vedi <a target="_blank" href="http://php.net/extract"><code>extract()</code></a>) gli attributi come variabili. Gli attributi devono essere tutti in lowercase!</p>
<h4>Gestione del contenuto</h4>
<p>La modalità con il content è quella più versatile in particolari casi, ecco un esempio chiarificatore:</p>
<div class="igBar"><span id="lphp-56"><a href="#" onclick="javascript:showCodeTxt('php-56'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-56">
<div class="php" 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: #000000; font-weight: bold;">function</span> make_title_shortcode<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attrs</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</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;">&nbsp; &nbsp;<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'&lt;h1 title=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;&lt;span&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/span&gt;&lt;/h1&gt;'</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>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">add_shortcode<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'my-title'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'make_title_shortcode'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Utilizzando lo shortcode nel nostro post:</p>
<div class="igBar"><span id="lhtml-57"><a href="#" onclick="javascript:showCodeTxt('html-57'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-57">
<div class="html" 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;">[my-title]Questo è un titolo[/my-title]</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Avremo come output:</p>
<div class="igBar"><span id="lhtml-58"><a href="#" onclick="javascript:showCodeTxt('html-58'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-58">
<div class="html" 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;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Eh1.html"><span style="color: #000000; font-weight: bold;">&lt;h1</span></a> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Questo è un titolo&quot;</span>&gt;&lt;span&gt;</span>Questo è un titolo<span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;</span></a><span style="color: #66cc66;">/</span>span&gt;&lt;<span style="color: #66cc66;">/</span>h1&gt;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Possiamo migliorare il nostro esempio introducento anche degli attributi per rendere più personalizzabile il nostro shortcode:</p>
<div class="igBar"><span id="lphp-59"><a href="#" onclick="javascript:showCodeTxt('php-59'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-59">
<div class="php" 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: #000000; font-weight: bold;">function</span> make_title_shortcode<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attrs</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</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;">&nbsp; &nbsp; <a href="http://www.php.net/extract"><span style="color: #990000;">extract</span></a><span style="color: #009900;">&#40;</span> shortcode_atts<span style="color: #009900;">&#40;</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#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; &nbsp; <span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'my-title'</span><span style="color: #339933;">,</span></div>
</li>
<li style="font-weight: 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; <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$attrs</span> <span style="color: #009900;">&#41;</span> <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;">&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: #b1b100;">return</span> <span style="color: #0000ff;">'&lt;h1 class=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot; title=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;&lt;span&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/span&gt;&lt;/h1&gt;'</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>
<div class="igBar"><span id="lhtml-60"><a href="#" onclick="javascript:showCodeTxt('html-60'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-60">
<div class="html" 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;">[my-title class=&quot;color-red&quot;]Questo è un titolo[/my-title]</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="lhtml-61"><a href="#" onclick="javascript:showCodeTxt('html-61'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-61">
<div class="html" 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;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Eh1.html"><span style="color: #000000; font-weight: bold;">&lt;h1</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;color-red&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Questo è un titolo&quot;</span>&gt;&lt;span&gt;</span>Questo è un titolo<span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;</span></a><span style="color: #66cc66;">/</span>span&gt;&lt;<span style="color: #66cc66;">/</span>h1&gt;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Come già indicato potete trovare molte informazioni sulla <a target="_blank" href="http://codex.wordpress.org/Shortcode_API">documentazine ufficiale di Wordpress</a>. Ecco qualche utile shortcode.</p>
<h4>Mostrare AdSense nei post</h4>
<p>Inserire il codice qui sotto nel vostro file <code>functions.php</code>. Cambiate i codice Google AdSense con i vostri.</p>
<div class="igBar"><span id="lphp-62"><a href="#" onclick="javascript:showCodeTxt('php-62'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-62">
<div class="php" 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: #000000; font-weight: bold;">function</span> show_adsense<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;">&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--</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: #0000ff;"> &nbsp; &nbsp; &nbsp; &nbsp;google_ad_client = &quot;pub-9877654123213210&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;"><span style="color: #0000ff;"> &nbsp; &nbsp; &nbsp; &nbsp;google_ad_slot = &quot;9876543210&quot;;</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: #0000ff;"> &nbsp; &nbsp; &nbsp; &nbsp;google_ad_width = 468;</span></div>
</li>
<li style="font-weight: 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: #0000ff;"> &nbsp; &nbsp; &nbsp; &nbsp;google_ad_height = 60;</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: #0000ff;"> &nbsp; &nbsp; &nbsp; &nbsp;//--&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;"><span style="color: #0000ff;"> &nbsp; &nbsp; &nbsp; &nbsp;&lt;/script&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;"><span style="color: #0000ff;"> &nbsp; &nbsp; &nbsp; &nbsp;&lt;script type=&quot;text/javascript&quot; src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&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;"><span style="color: #0000ff;"> &nbsp; &nbsp; &nbsp; &nbsp;'</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>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">add_shortcode<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'myadsense'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'adsense'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Nel posto basta inserire:</p>
<div class="igBar"><span id="lhtml-63"><a href="#" onclick="javascript:showCodeTxt('html-63'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-63">
<div class="html" 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;">[myadsense]</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h4>Aggiungere note ad un post visibile solo dall'amministratore</h4>
<p>Questo shortcode permette di aggiungere delle note ad un post visibili solo ad un amministratore.</p>
<div class="igBar"><span id="lphp-64"><a href="#" onclick="javascript:showCodeTxt('php-64'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-64">
<div class="php" 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: #000000; font-weight: bold;">function</span> admin_note<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attrs</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</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;">&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> current_user_can<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'publish_posts'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#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; <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'&lt;div class=&quot;admin-note&quot;&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/div&gt;'</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: 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: #b1b100;">return</span> <span style="color: #0000ff;">''</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>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">add_shortcode<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'admin-note'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'admin_note'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="lhtml-65"><a href="#" onclick="javascript:showCodeTxt('html-65'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-65">
<div class="html" 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;">[note]Questa nota è visibile solo agli amministratori del blog[/note]</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Pubblicherò in futuro altri shortcode utili...</p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F07%2F03%2Fwordpress-usare-gli-shortcodes%2F&amp;title=Wordpress%3A%20usare%20gli%20shortcodes&amp;bodytext=Dalla%20versione%202.5%20di%20Wordpress%20%28meglio%202.5.1%29%20sono%20disponibili%20i%20cosidetti%20shortcodes%2C%20una%20procedura%20che%20permette%20di%20creare%20delle%20callback%2C%20o%20meglio%20degli%20hook%2C%20quando%20nel%20testo%20del%20nostro%20post%20viene%20trovata%20una%20stringa%20formattata%20con%20le%20parentesi%20q" 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%2F07%2F03%2Fwordpress-usare-gli-shortcodes%2F&amp;title=Wordpress%3A%20usare%20gli%20shortcodes&amp;notes=Dalla%20versione%202.5%20di%20Wordpress%20%28meglio%202.5.1%29%20sono%20disponibili%20i%20cosidetti%20shortcodes%2C%20una%20procedura%20che%20permette%20di%20creare%20delle%20callback%2C%20o%20meglio%20degli%20hook%2C%20quando%20nel%20testo%20del%20nostro%20post%20viene%20trovata%20una%20stringa%20formattata%20con%20le%20parentesi%20q" 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%2F07%2F03%2Fwordpress-usare-gli-shortcodes%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%2F07%2F03%2Fwordpress-usare-gli-shortcodes%2F&amp;t=Wordpress%3A%20usare%20gli%20shortcodes" 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%2F07%2F03%2Fwordpress-usare-gli-shortcodes%2F&amp;title=Wordpress%3A%20usare%20gli%20shortcodes&amp;annotation=Dalla%20versione%202.5%20di%20Wordpress%20%28meglio%202.5.1%29%20sono%20disponibili%20i%20cosidetti%20shortcodes%2C%20una%20procedura%20che%20permette%20di%20creare%20delle%20callback%2C%20o%20meglio%20degli%20hook%2C%20quando%20nel%20testo%20del%20nostro%20post%20viene%20trovata%20una%20stringa%20formattata%20con%20le%20parentesi%20q" 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%3A%20usare%20gli%20shortcodes%20-%20http%3A%2F%2Fwww.undolog.com%2F2009%2F07%2F03%2Fwordpress-usare-gli-shortcodes%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%3A%20usare%20gli%20shortcodes&amp;story=http%3A%2F%2Fwww.undolog.com%2F2009%2F07%2F03%2Fwordpress-usare-gli-shortcodes%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%2F07%2F03%2Fwordpress-usare-gli-shortcodes%2F&amp;title=Wordpress%3A%20usare%20gli%20shortcodes" 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%3A%20usare%20gli%20shortcodes&amp;body=http%3A%2F%2Fwww.undolog.com%2F2009%2F07%2F03%2Fwordpress-usare-gli-shortcodes%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%3A%20usare%20gli%20shortcodes&amp;link=http%3A%2F%2Fwww.undolog.com%2F2009%2F07%2F03%2Fwordpress-usare-gli-shortcodes%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%2F07%2F03%2Fwordpress-usare-gli-shortcodes%2F&amp;headline=Wordpress%3A%20usare%20gli%20shortcodes&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%2F07%2F03%2Fwordpress-usare-gli-shortcodes%2F&amp;title=Wordpress%3A%20usare%20gli%20shortcodes&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Dalla%20versione%202.5%20di%20Wordpress%20%28meglio%202.5.1%29%20sono%20disponibili%20i%20cosidetti%20shortcodes%2C%20una%20procedura%20che%20permette%20di%20creare%20delle%20callback%2C%20o%20meglio%20degli%20hook%2C%20quando%20nel%20testo%20del%20nostro%20post%20viene%20trovata%20una%20stringa%20formattata%20con%20le%20parentesi%20q" 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%2F07%2F03%2Fwordpress-usare-gli-shortcodes%2F&amp;title=Wordpress%3A%20usare%20gli%20shortcodes" 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%2F07%2F03%2Fwordpress-usare-gli-shortcodes%2F&amp;t=Wordpress%3A%20usare%20gli%20shortcodes" 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%3A%20usare%20gli%20shortcodes&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F07%2F03%2Fwordpress-usare-gli-shortcodes%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%2F07%2F03%2Fwordpress-usare-gli-shortcodes%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%2F07%2F03%2Fwordpress-usare-gli-shortcodes%2F&amp;title=Wordpress%3A%20usare%20gli%20shortcodes" 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%2F07%2F03%2Fwordpress-usare-gli-shortcodes%2F&amp;title=Wordpress%3A%20usare%20gli%20shortcodes" 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%2F07%2F03%2Fwordpress-usare-gli-shortcodes%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/add_shortcode/" title="add_shortcode()" rel="tag">add_shortcode()</a>, <a href="http://www.undolog.com/tag/functionsphp/" title="functions.php" rel="tag">functions.php</a>, <a href="http://www.undolog.com/tag/hook/" title="hook" rel="tag">hook</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/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/shortcodes/" title="shortcodes" rel="tag">shortcodes</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>, <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/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/01/16/wordpress-functionsphp-qualche-funzione-utile/" title="Wordpress: functions.php, qualche funzione utile (16 gennaio, 2009)">Wordpress: functions.php, qualche funzione utile</a> (0)</li>
	<li><a href="http://www.undolog.com/2010/02/06/wordpress-filtrate-il-contenuto-dei-commenti/" title="Wordpress: filtrate il contenuto dei commenti (6 febbraio, 2010)">Wordpress: filtrate il contenuto dei commenti</a> (2)</li>
	<li><a href="http://www.undolog.com/2010/01/26/wordpress-estendere-le-informazioni-utente/" title="Wordpress: estendere le informazioni utente (26 gennaio, 2010)">Wordpress: estendere le informazioni utente</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/07/03/wordpress-usare-gli-shortcodes/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>iPhone FirstApp: indovina il numero &#8211; parte 1</title>
		<link>http://www.undolog.com/2009/06/23/iphone-firstapp-indovina-il-numero-parte-1/</link>
		<comments>http://www.undolog.com/2009/06/23/iphone-firstapp-indovina-il-numero-parte-1/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 21:54:06 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Generale]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Videogames]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Google Code]]></category>
		<category><![CDATA[IBAction]]></category>
		<category><![CDATA[IBOutlet]]></category>
		<category><![CDATA[integerValue]]></category>
		<category><![CDATA[Interface Builder]]></category>
		<category><![CDATA[NSString]]></category>
		<category><![CDATA[UIAlertView]]></category>
		<category><![CDATA[UIButton]]></category>
		<category><![CDATA[UILabel]]></category>
		<category><![CDATA[UINavigationBar]]></category>
		<category><![CDATA[UIView]]></category>
		<category><![CDATA[Undolibrary]]></category>
		<category><![CDATA[ViewController]]></category>
		<category><![CDATA[XCode]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=1815</guid>
		<description><![CDATA[Il primo sorgente che mi è passato tra le mani era scritto in Basic e consisteva in poche righe di codice, per me illuminanti. Era un semplice giochino che generava un numero casuale da 1 a 10 e, tramite l'input da tastiera, verificava che il numero inserito era maggione, minore o uguale al numero casuale. [...]]]></description>
			<content:encoded><![CDATA[<p>Il primo sorgente che mi è passato tra le mani era scritto in Basic e consisteva in poche righe di codice, per me illuminanti. Era un semplice giochino che generava un numero casuale da 1 a 10 e, tramite l'input da tastiera, verificava che il numero inserito era maggione, minore o uguale al numero casuale. Nonostante la sua rozza semplicità rimane, per me, uno dei migliori esempi - semplici, divertenti e pratici - per spiegare a chi non sa nulla di programmazione cosa s'intenda effettivamente per "programma per computer". Così ho pensato di riproporlo per <strong>Apple iPhone</strong>, magari aiuterà qualcuno...</p>
<p>In questo post realizzeremo una particolare versione di "Indovina il numero" e la chiameremo FirstApp. Più avanti riscriveremo la stessa applicazione con metodi diversi, ad esempio creando manualmente un <code>UIView</code> o lasciando da parte Interface Builder.</p>
<p>L'applicazione già fatta, se volete solo scaricarla, è disponibile sul mio Google Code repository:</p>
<ul>
<li><a href="http://code.google.com/p/undolibrary/source/browse/trunk/iPhone/FirstApp/">Sfoglia sorgenti</a></li>
<li><a href="http://undolibrary.googlecode.com/files/FirstApp.zip">Sorgenti .zip (1.4Mb)</a></li>
</ul>
<h4>1 - Iniziamo</h4>
<p>Apriamo <strong>XCode</strong>, dal menu <strong>File</strong> selezioniamo <strong>New Project</strong> e scegliamo, per questa versione, di partire dal classico <strong>View-Based Application</strong> (la prossima volta partiremo da <strong>Window-Based Application</strong> ottenendo lo stesso identico risultato). Chiamate il progetto <code>FirstApp</code> e salvatelo dove più vi fa comodo.</p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2009/06/xcode-newproject.png" alt="XCode New Project" title="xcode-newproject" width="600" height="442" /></p>
<p>Come noterete sto usando ancora la versione di XCode per le <strong>SDK 2.2.1</strong>, in quanto le <strong>SDK 3.0</strong> non sono ancora "molto" stabili. Tenete bene a mente quest'immagine in quanto con la nuova versione di XCode alcuni template non saranno proprio identici e alcune cose cambieranno. Tuttavia per ora non vi dovete preoccupare di questo a meno che non state già utilizzando l'ultima release di XCode.</p>
<p><img src="http://www.undolog.com/wp-content/uploads/2009/06/viewcontroller.png" alt="viewcontroller" title="viewcontroller" width="230" height="331" style="float:left;margin:5px 10px 0 0" />In questa versione <strong>useremo Interface Builder</strong> quindi, per prima cosa, andremo a disegnare la nostra interfaccia utente. Apriamo dunque la cartella <strong>Resources</strong> e fate doppio click su <strong><code>FirstAppViewController.xib</code></strong>. Questo file è proprio di Interface Builder, come il file <strong><code>MainWindow.xib</code></strong> (vedi anche l'estensione del file <em><strong>X</strong> <strong>I</strong>nterface <strong>B</strong>uilder</em>).<br/>Eventuali altri <em>controller</em> saranno posizionati sempre in questa cartella. Le restanti cartelle contengono tutti gli altri file della nostra applicazione e, in particolare, noi lavoreremo molto su quelli presenti nella cartella <strong>Classes</strong>.<br/>Tornando ad Interface Builder ci troveremmo davanti ad una schermata vuota che rappresenta la nostra <code>View</code>, il contenitore dove saranno posizionati gli oggetti <strong>UIKit</strong> della nostra interfaccia utente. Questo oggetto visivo che stiamo guardando tramite Interface Builder è collegato al file <strong><code>FirstAppViewController.m</code></strong> (e .h) presente nella cartella <strong>Classes</strong>.</p>
<p><img style="float:left;margin:5px 10px 0 0" src="http://www.undolog.com/wp-content/uploads/2009/06/library.png" alt="library" title="library" width="172" height="232"/> Nella finestra <strong>Library</strong> troviamo tutti i componenti visivi per creare interfaccie standard, piacevoli ed accessibili sul nostro Apple iPhone.<br/>Questi sono comodamente ordinati per tipologia (vedi cartelle azzurre in alto). Per inserirli nella nostra View è sufficiente selezionare il componente dalla fienstra Library e trascinarlo all'interno della nostra finestra View, dove potremmo posizionarlo, ridimensionarlo e configurarlo a nostro piacimento (tutte cose fattibili anche da codice, come vedremo prossimamente).<br/>Prima di proseguire, se è la prima volta che lavorate con Interface Builder, divertitevi un po' provando i vari componenti e, quando ne avrete abbastanza, fate in modo di ottenere qualcosa di simile all'immagine mostrata qui sotto, ovvero un titolo realizzato con il componente <code>UINavigationBar</code>, un testo introduttivo (<code>UILabel</code>), un campo testo per l'inserimento del numero da indovinare (<code>UITextField</code>) e - finalmente - un semplice bottone (<code>UIButton</code>) per verificare se abbiamo indovinato:</p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2009/06/view.png" alt="view" title="view" width="224" height="351" /></p>
<p>L'impostazione dei componenti in Interface Builder avviene tramite una particolare finestra divisa sempre in quattro schede: attributes, connections, size e identity, una sorta di "ispettore" dei componenti. In base al componente selezionato la finestra Identity si configura con le appropriete caratteristiche relative al componente. Se selezioniamo la <code>UINavigationBar</code>, ad esempio, avremmo a disposizioni tutte le impostazioni possibili per questo tipo di componente.</p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2009/06/ispettore.png" alt="ispettore" title="ispettore" width="229" height="300"/></p>
<h4>2 - Codice</h4>
<p>Adesso che abbiamo stabilito e posizionato i nostri componenti visivi per l'interfaccia, andiamo a scrivere un po' di codice per manipolarli. Prima di tutto apriamo il file FirstAppViewController.h e facciamolo diventare così:</p>
<div class="igBar"><span id="lobjc-70"><a href="#" onclick="javascript:showCodeTxt('objc-70'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Objective-C:</span>
<div id="objc-70">
<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;">//</span></div>
</li>
<li style="font-weight: 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;">// &nbsp;FirstAppViewController.h</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;">// &nbsp;FirstApp</span></div>
</li>
<li style="font-weight: 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;">//</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;">// &nbsp;Created by Giovambattista Fazioli on 19/06/09.</span></div>
</li>
<li style="font-weight: 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;">// &nbsp;Copyright Saidmade srl 2009. All rights reserved.</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;">//</span></div>
</li>
<li style="font-weight: 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: #6e371a;">#import &lt;UIKit/UIKit.h&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;</div>
</li>
<li style="font-weight: 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;">@interface</span> FirstAppViewController <span style="color: #002200;">:</span> UIViewController <span style="color: #002200;">&#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; IBOutlet UITextField &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #002200;">*</span>numero;</div>
</li>
<li style="font-weight: 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; IBOutlet UIButton &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">*</span>bottone;</div>
</li>
<li style="font-weight: 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: #a61390;">int</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; numeroACaso;</div>
</li>
<li style="font-weight: 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;">&#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;</div>
</li>
<li style="font-weight: 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;">-</span><span style="color: #002200;">&#40;</span>IBAction<span style="color: #002200;">&#41;</span>controllaNumero;</div>
</li>
<li style="font-weight: 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; </div>
</li>
<li style="font-weight: 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>Le righe 12, 13 e 14 definiscono le "variabili" del nostro Game. Le prime due sono dei puntatori ai nostri oggetti grafici inseriti con Interface Builder: il campo testo e il bottone. <strong><code>IBOutlet</code></strong>, davati al tipo, serve a creare un link, una referenza, verso l'interfaccia <code>.xib</code> di Interface Builder. Infatti, nel caso volessimo creare i nostri componenti esclusivamenti tramite codice, senza passare per Interface Builder, basta eliminare la <strong><code>IBOutlet</code></strong>, in quanto inutile. La riga 17, invece, definisce un metodo (un messaggio-evento) che vogliamo far scattare quando si clicca il bottone. In questo file .h (header file) abbiamo eseguito solo definizioni. L'implementazione del codice vero e proprio avviene nel corrispettivo file .m: <strong><code>FirstAppViewController.m</code></strong>. Cliccando si <strong>CMD+ALT+FRECCIA SU</strong> si passa alternativamente dal file .h al file .m. Andiamo quindi ad editare <code>FirstAppViewController.m</code>. Prima di tutto eliminiamo i commento al meotdo <strong><code>viewDidLoad</code></strong> (33 esima riga circa) e facciamolo diventare:</p>
<div class="igBar"><span id="lobjc-71"><a href="#" onclick="javascript:showCodeTxt('objc-71'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Objective-C:</span>
<div id="objc-71">
<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;">// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.</span></div>
</li>
<li style="font-weight: 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>viewDidLoad <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: #002200;">&#91;</span>super viewDidLoad<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;">&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; numeroACaso <span style="color: #002200;">=</span> 1 <span style="color: #002200;">+</span> arc4random<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">%</span> <span style="color: #2400d9;color:#800000;">10</span>;</div>
</li>
<li style="font-weight: 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; NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Numero pensato %d&quot;</span>, numeroACaso<span style="color: #002200;">&#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;"><span style="color: #002200;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><code>viewDidLoad</code> è uno dei metodo richiamati all'avvio dell'applicazione. Se volete corrisponde un po' al <code>document onload</code> di Javascript o al <code>$(document).ready()</code> di <a target="_blank" href="http://jquery.com">jQuery</a>. Le righe che ho aggiunto sono la 5 e la 6. La 5, in particolare, <strong>crea un numero casuale compreso da 1 a 10</strong>! La riga numero 6, invece, è solo per debug e stampa sulla console il numero generato. Adesso scriviamo il codice (l'impementazione) del metodo <code>controllaNumero()</code> che abbiamo definito nel file <code>FirstAppViewController.h</code>:</p>
<div class="igBar"><span id="lobjc-72"><a href="#" onclick="javascript:showCodeTxt('objc-72'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Objective-C:</span>
<div id="objc-72">
<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;">-</span><span style="color: #002200;">&#40;</span>IBAction<span style="color: #002200;">&#41;</span>controllaNumero <span style="color: #002200;">&#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; NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Premuto bottone di controlla numero&quot;</span><span style="color: #002200;">&#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; </div>
</li>
<li style="font-weight: 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: #a61390;">int</span> numeroInserito <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>numero.text integerValue<span style="color: #002200;">&#93;</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; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span style="color: #400080;">NSString</span></a> &nbsp; &nbsp;<span style="color: #002200;">*</span>message;</div>
</li>
<li style="font-weight: 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; </div>
</li>
<li style="font-weight: 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; NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Il numero inserito è %d&quot;</span>, numeroInserito <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;">&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; <span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span> numeroInserito &lt;numeroACaso <span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#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; message <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Troppo basso...&quot;</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: #002200;">&#125;</span> <span style="color: #a61390;">else</span> <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>numeroInserito&gt; numeroACaso <span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#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; message <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Troppo alto...&quot;</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: #002200;">&#125;</span> &nbsp;<span style="color: #a61390;">else</span> <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>numeroInserito <span style="color: #002200;">==</span> numeroACaso <span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#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; message <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Bravo hai indovinato&quot;</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; numeroACaso <span style="color: #002200;">=</span> 1 <span style="color: #002200;">+</span> arc4random<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">%</span> <span style="color: #2400d9;color:#800000;">10</span>;</div>
</li>
<li style="font-weight: 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; NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Numero pensato %d&quot;</span>, numeroACaso<span style="color: #002200;">&#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; <span style="color: #002200;">&#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; </div>
</li>
<li style="font-weight: 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; UIAlertView <span style="color: #002200;">*</span>alertMessaggio <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIAlertView alloc<span style="color: #002200;">&#93;</span> initWithTitle<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Responso&quot;</span> message<span style="color: #002200;">:</span> message delegate<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span> cancelButtonTitle<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;OK&quot;</span> otherButtonTitles<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><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;">&nbsp; &nbsp; <span style="color: #002200;">&#91;</span>alertMessaggio show<span style="color: #002200;">&#93;</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: #002200;">&#91;</span>alertMessaggio release<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;">&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; numero.text <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;&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;"><span style="color: #002200;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Questo codice, l'ultimo che scriveremo prima di passare nuovamente a Interface Builder, possiamo definirlo come il cuore del sistema, o meglio del gioco. Esso, infatti, verifica se il numero inserito nel campo testo (<code>UITextField</code>) è minore, maggiore o uguale al numero "pensato" dal nostro iPhone. In base all'esito mostra un alert. La riga 2, come sempre, è solo per debug e stampa sulla console un messaggio quando clicchiamo il bottone. La riga 4, invece, è interessante; questa trasforma il contenuto testuale del nostro campo testo in un intero numerico. Questo è necessario per confrontare il numero casuale <code>numeroACaso</code> con il numero inserito dall'utente. In Objective-C, come nel C, non esistono conversioni di tipo implicite, come il altri linguaggi ad alto livello che non supportano la tipizazzione delle variabili in senso strict. In alcuni linguaggi, infatti, si possono confrontare stringhe e interi senza eseguire nessuna conversione esplicita o casting.</p>
<p>La riga 5 prepara un puntatore ad un stringa <code>message</code> che conterrà la risposta da visualizzare nell'alert. Le righe dalla 9 alla 17 controllano il numero inserito dall'utente con il numero casuale e ne traggono le dovute conseguenze. Ho inserito appositamente queste "<code>if</code>" brutali per rendere il più chiaro possibile il codice. In alternativa avremmo potuto usare:</p>
<div class="igBar"><span id="lobjc-73"><a href="#" onclick="javascript:showCodeTxt('objc-73'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Objective-C:</span>
<div id="objc-73">
<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: #a61390;">int</span> decisione <span style="color: #002200;">=</span> <span style="color: #002200;">&#40;</span> <span style="color: #002200;">&#40;</span>numeroInserito <span style="color: #002200;">-</span> numeroACaso<span style="color: #002200;">&#41;</span> &lt;0 <span style="color: #002200;">&#41;</span> ? <span style="color: #002200;">-</span>1 <span style="color: #002200;">:</span> <span style="color: #002200;">&#40;</span> <span style="color: #002200;">&#40;</span>numeroInserito <span style="color: #002200;">-</span> numeroACaso<span style="color: #002200;">&#41;</span> ? 1 <span style="color: #002200;">:</span> 0 <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;">&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: #a61390;">switch</span><span style="color: #002200;">&#40;</span> decisione <span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#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: #a61390;">case</span> <span style="color: #002200;">-</span><span style="color: #2400d9;color:#800000;">1</span><span style="color: #002200;">:</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; message <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Troppo basso...&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: #a61390;">break</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;">case</span> <span style="color: #2400d9;color:#800000;">1</span><span style="color: #002200;">:</span></div>
</li>
<li style="font-weight: 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; message <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Troppo alto...&quot;</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: #a61390;">break</span>;</div>
</li>
<li style="font-weight: 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: #a61390;">case</span> <span style="color: #2400d9;color:#800000;">0</span><span style="color: #002200;">:</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; message <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Bravo hai indovinato&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: #11740a; font-style: italic;">// ricominciamo...</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; numeroACaso <span style="color: #002200;">=</span> 1 <span style="color: #002200;">+</span> arc4random<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">%</span> <span style="color: #2400d9;color:#800000;">10</span>;</div>
</li>
<li style="font-weight: 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; NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Numero pensato %d&quot;</span>, numeroACaso<span style="color: #002200;">&#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; <span style="color: #a61390;">break</span>;</div>
</li>
<li style="font-weight: 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>
</ol>
</div>
</div>
</div>
<p></p>
<h4>Uniamo il code con Interface Builder</h4>
<p>Torniamo adesso su <strong>Interface Builder</strong>, cliccando sempre il file <code>FirstAppViewController.xib</code>. Quello che andremo a fare ora permetterà di linkare l'interfaccia visiva preparata con Interface Builder e il codice che abbiamo scritto, in particolare con i componenti <strong>evidenziati con <code>IBOutlet</code></strong>. I componenti che dobbiamo linkare al nostro codice sono il campo testo e il bottone, definiti nella definizione dell'interfaccia nel file <code>FirstAppViewController.h</code>. A questi gli avevamo dato il nome rispettivamente di <code>numero</code> e <code>bottone</code>. Da Interface Builder abbiamo vari modi per linkare i componenti visivi con il codice, uno dei più semplici è quello di cliccare con il tasto destro del mouse sul nostro componente visivo, ad esempio il campo testo (<code>UITextField</code>):</p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2009/06/iboutlet.png" alt="iboutlet" title="iboutlet" width="317" height="338" /></p>
<p>Questa finestra, diversa per ogni componente, ci mostre tutto quello che possiamo "linkare" con il codice. In particolare a noi interessa l'ultima voce, quella nella sezione Referencing Outlets: New Referencing Outlet. Clicchiamo sul "cerchietto" posto a destra e - mantenendo premuto il tasto del mouse - trascinatelo nella finestra princiaple <strong><code>FirstAppViewController.xib</code></strong> sopra l'icona <strong>FirstAppViewController</strong> (File's Owner):</p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2009/06/viewcontroller-link.jpg" alt="viewcontroller-link" title="viewcontroller-link" width="600" height="442" /></p>
<p>Rilasciando il tasto del mouse apparirà un menu con l'elenco di tutte le "variabili" (properties) <code>IBOutlet</code> e definite come <code>UITextField</code>:</p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2009/06/menu-outlet.jpg" alt="menu-outlet" title="menu-outlet" width="280" height="91" /></p>
<p>Nel nostro caso selezioniamo <code>numero</code>. Ripetiamo lo stesso identico procedimento anche per il bottone, con l'aggiunta che per quest'ultimo avevamo definito anche un evento: <code>- (IBAction) controllaNumero;</code>. Alla fine otteremo:</p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2009/06/ibaction.png" alt="ibaction" title="ibaction" width="317" height="336"  /></p>
<h4>Conclusioni</h4>
<p>Se avete fatto tutto in modo corretto abbiamo finito! Il nostro giochino è pronto. In caso potete scaricare il <a href="http://undolibrary.googlecode.com/files/FirstApp.zip">sorgente completo qui</a>. Ovviamente questo è solo un esempio e mancano alcuni dettagli per farlo diventare una vera applicazione; dalle icone 57x57 ai controlli sul numero inserito e altri dettagli ancora. Il processo di sviluppo qui illustrato può essere variato, passando ad esempio per Interface Builder una volta sola, cioè alla fine: prima si scrive tutto il codice e poi si va su Interface Builder a linkare gli oggetti. In questo esempio siamo passati subito su Interface Builder per disegnare la bozza della nostra interfaccia, essendo l'applicativo semplice.</p>
<p>La prossima volta vedremo come realizzare il medisimo "giochino" <strong>senza usare Interface Builder</strong>.</p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F23%2Fiphone-firstapp-indovina-il-numero-parte-1%2F&amp;title=iPhone%20FirstApp%3A%20indovina%20il%20numero%20-%20parte%201&amp;bodytext=Il%20primo%20sorgente%20che%20mi%20%C3%A8%20passato%20tra%20le%20mani%20era%20scritto%20in%20Basic%20e%20consisteva%20in%20poche%20righe%20di%20codice%2C%20per%20me%20illuminanti.%20Era%20un%20semplice%20giochino%20che%20generava%20un%20numero%20casuale%20da%201%20a%2010%20e%2C%20tramite%20l%27input%20da%20tastiera%2C%20verificava%20che%20il%20numero" 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%2F23%2Fiphone-firstapp-indovina-il-numero-parte-1%2F&amp;title=iPhone%20FirstApp%3A%20indovina%20il%20numero%20-%20parte%201&amp;notes=Il%20primo%20sorgente%20che%20mi%20%C3%A8%20passato%20tra%20le%20mani%20era%20scritto%20in%20Basic%20e%20consisteva%20in%20poche%20righe%20di%20codice%2C%20per%20me%20illuminanti.%20Era%20un%20semplice%20giochino%20che%20generava%20un%20numero%20casuale%20da%201%20a%2010%20e%2C%20tramite%20l%27input%20da%20tastiera%2C%20verificava%20che%20il%20numero" 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%2F23%2Fiphone-firstapp-indovina-il-numero-parte-1%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%2F23%2Fiphone-firstapp-indovina-il-numero-parte-1%2F&amp;t=iPhone%20FirstApp%3A%20indovina%20il%20numero%20-%20parte%201" 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%2F23%2Fiphone-firstapp-indovina-il-numero-parte-1%2F&amp;title=iPhone%20FirstApp%3A%20indovina%20il%20numero%20-%20parte%201&amp;annotation=Il%20primo%20sorgente%20che%20mi%20%C3%A8%20passato%20tra%20le%20mani%20era%20scritto%20in%20Basic%20e%20consisteva%20in%20poche%20righe%20di%20codice%2C%20per%20me%20illuminanti.%20Era%20un%20semplice%20giochino%20che%20generava%20un%20numero%20casuale%20da%201%20a%2010%20e%2C%20tramite%20l%27input%20da%20tastiera%2C%20verificava%20che%20il%20numero" 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=iPhone%20FirstApp%3A%20indovina%20il%20numero%20-%20parte%201%20-%20http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F23%2Fiphone-firstapp-indovina-il-numero-parte-1%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=iPhone%20FirstApp%3A%20indovina%20il%20numero%20-%20parte%201&amp;story=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F23%2Fiphone-firstapp-indovina-il-numero-parte-1%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%2F23%2Fiphone-firstapp-indovina-il-numero-parte-1%2F&amp;title=iPhone%20FirstApp%3A%20indovina%20il%20numero%20-%20parte%201" 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=iPhone%20FirstApp%3A%20indovina%20il%20numero%20-%20parte%201&amp;body=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F23%2Fiphone-firstapp-indovina-il-numero-parte-1%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=iPhone%20FirstApp%3A%20indovina%20il%20numero%20-%20parte%201&amp;link=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F23%2Fiphone-firstapp-indovina-il-numero-parte-1%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%2F23%2Fiphone-firstapp-indovina-il-numero-parte-1%2F&amp;headline=iPhone%20FirstApp%3A%20indovina%20il%20numero%20-%20parte%201&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%2F23%2Fiphone-firstapp-indovina-il-numero-parte-1%2F&amp;title=iPhone%20FirstApp%3A%20indovina%20il%20numero%20-%20parte%201&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Il%20primo%20sorgente%20che%20mi%20%C3%A8%20passato%20tra%20le%20mani%20era%20scritto%20in%20Basic%20e%20consisteva%20in%20poche%20righe%20di%20codice%2C%20per%20me%20illuminanti.%20Era%20un%20semplice%20giochino%20che%20generava%20un%20numero%20casuale%20da%201%20a%2010%20e%2C%20tramite%20l%27input%20da%20tastiera%2C%20verificava%20che%20il%20numero" 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%2F23%2Fiphone-firstapp-indovina-il-numero-parte-1%2F&amp;title=iPhone%20FirstApp%3A%20indovina%20il%20numero%20-%20parte%201" 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%2F23%2Fiphone-firstapp-indovina-il-numero-parte-1%2F&amp;t=iPhone%20FirstApp%3A%20indovina%20il%20numero%20-%20parte%201" 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=iPhone%20FirstApp%3A%20indovina%20il%20numero%20-%20parte%201&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F06%2F23%2Fiphone-firstapp-indovina-il-numero-parte-1%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%2F23%2Fiphone-firstapp-indovina-il-numero-parte-1%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%2F23%2Fiphone-firstapp-indovina-il-numero-parte-1%2F&amp;title=iPhone%20FirstApp%3A%20indovina%20il%20numero%20-%20parte%201" 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%2F23%2Fiphone-firstapp-indovina-il-numero-parte-1%2F&amp;title=iPhone%20FirstApp%3A%20indovina%20il%20numero%20-%20parte%201" 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%2F23%2Fiphone-firstapp-indovina-il-numero-parte-1%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/apple/" title="Apple" rel="tag">Apple</a>, <a href="http://www.undolog.com/category/generale/" title="Generale" rel="tag">Generale</a>, <a href="http://www.undolog.com/tag/google-code/" title="Google Code" rel="tag">Google Code</a>, <a href="http://www.undolog.com/tag/ibaction/" title="IBAction" rel="tag">IBAction</a>, <a href="http://www.undolog.com/tag/iboutlet/" title="IBOutlet" rel="tag">IBOutlet</a>, <a href="http://www.undolog.com/tag/integervalue/" title="integerValue" rel="tag">integerValue</a>, <a href="http://www.undolog.com/tag/interface-builder/" title="Interface Builder" rel="tag">Interface Builder</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/nsstring/" title="NSString" rel="tag">NSString</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/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/uialertview/" title="UIAlertView" rel="tag">UIAlertView</a>, <a href="http://www.undolog.com/tag/uibutton/" title="UIButton" rel="tag">UIButton</a>, <a href="http://www.undolog.com/tag/uilabel/" title="UILabel" rel="tag">UILabel</a>, <a href="http://www.undolog.com/tag/uinavigationbar/" title="UINavigationBar" rel="tag">UINavigationBar</a>, <a href="http://www.undolog.com/tag/uiview/" title="UIView" rel="tag">UIView</a>, <a href="http://www.undolog.com/tag/undolibrary/" title="Undolibrary" rel="tag">Undolibrary</a>, <a href="http://www.undolog.com/category/videogames/" title="Videogames" rel="tag">Videogames</a>, <a href="http://www.undolog.com/tag/viewcontroller/" title="ViewController" rel="tag">ViewController</a>, <a href="http://www.undolog.com/tag/xcode/" title="XCode" rel="tag">XCode</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2009/07/13/iphone-secondapp-indovina-il-numero-parte-2/" title="iPhone SecondApp: indovina il numero &#8211; parte 2 (13 luglio, 2009)">iPhone SecondApp: indovina il numero &#8211; parte 2</a> (0)</li>
	<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/2009/07/23/xcode-shortcut/" title="Xcode shortcut (23 luglio, 2009)">Xcode shortcut</a> (0)</li>
	<li><a href="http://www.undolog.com/2009/07/27/objective-c-unalternativa-alluso-di-cgrectmake/" title="Objective-C: un&#8217;alternativa all&#8217;uso di CGRectMake (27 luglio, 2009)">Objective-C: un&#8217;alternativa all&#8217;uso di CGRectMake</a> (2)</li>
	<li><a href="http://www.undolog.com/2009/06/23/objective-c-conversione-dei-tipi/" title="Objective-C: conversione dei tipi (23 giugno, 2009)">Objective-C: conversione dei tipi</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2009/06/23/iphone-firstapp-indovina-il-numero-parte-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sulla struttura ad oggetti di un Plugin Wordpress</title>
		<link>http://www.undolog.com/2009/04/24/sulla-struttura-ad-oggetti-di-un-plugin-wordpress/</link>
		<comments>http://www.undolog.com/2009/04/24/sulla-struttura-ad-oggetti-di-un-plugin-wordpress/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 09:12:00 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[ottimizzazione]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[prestazioni]]></category>
		<category><![CDATA[Wordpress 2.7]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=1538</guid>
		<description><![CDATA[Se ci affidassimo al semplice esempio hellodolly.php fornito da Wordpress, o anche alla stessa documentazione ufficiale, non arriveremmo mai alla stesura di un buon ed efficiente plugin. Vogliamo qui analizzare una possibile struttura, quindi uno scheletro, in grado di essere utilizzato più volte.
Le basi
Prima di tutto dobbiamo capire come e quando un plugin Wordpress viene [...]]]></description>
			<content:encoded><![CDATA[<p>Se ci affidassimo al semplice esempio <code>hellodolly.php</code> fornito da <a title="WordPress" href="http://www.wordpress.org" target="_blank">Wordpress</a>, o anche alla stessa documentazione ufficiale, non arriveremmo mai alla stesura di un buon ed efficiente plugin. Vogliamo qui analizzare una possibile struttura, quindi uno scheletro, in grado di essere utilizzato più volte.</p>
<h4>Le basi</h4>
<p>Prima di tutto dobbiamo capire come e quando un plugin Wordpress viene caricato nel sistema. Quando si attiva un plugin dall’amministrazione, il file che contiene il codice principale, riconosciuto dalle classiche linee di commento:</p>
<div class="igBar"><span id="lphp-79"><a href="#" onclick="javascript:showCodeTxt('php-79'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-79">
<div class="php" 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: #666666; 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: #666666; font-style: italic;">Plugin Name: Mio Plugin</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: #666666; font-style: italic;">Plugin URI: http://wordpress.org/extend/plugins/mioplugin/</span></div>
</li>
<li style="font-weight: 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: #666666; font-style: italic;">Description: Descrizione mio plugin</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: #666666; font-style: italic;">Version: 1.0.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;"><span style="color: #666666; font-style: italic;">Author: 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: #666666; font-style: italic;">Author URI: http://labs.saidmade.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: #666666; font-style: italic;">*/</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>viene caricato sia se ci troviamo nel front-end sia se ci troviamo nell’amministrazione (back-end):</p>
<p class="center"><img title="Schema di caricamento di un Plugin Wordpress" border="0" alt="Schema di caricamento di un Plugin Wordpress" src="http://www.undolog.com/wp-content/uploads/2009/04/image1.png" width="483" height="328"/></p>
<p><span id="more-1538"></span></p>
<p>Questo comportamento è di per sé corretto e, probabilmente, in molti casi non è preso in considerazione dallo sviluppatore. Inoltre alcuni plugin hanno una struttura (ad esempio non hanno impostazioni e quindi non necessitano di una amministrazione) tale da rendere inutile soffermarsi su tale punto.<br />Tuttavia va considerato che alcuni plugin hanno una consistente amministrazione, cioè portano con se molto codice usato solo nel back-end di Wordpress. In questi casi se non si prendono le opportune precauzioni si rischia di far caricare al front-end, cioè la parte visibile a navigatori, codice completamente inutile che non fa altro che appesantire il caricamento del blog.</p>
<h4>Possibili conflitti: spazio dei nomi</h4>
<p>Dal punto precedente si deduce un altro fatto importante; tutti i plugin Wordpress vengono caricati nella stessa area di funzionamento, il ché si traduce nella spiacevole conseguenza che se due diversi plugin hanno una funzione (una variabile o una costante) identificata dallo stesso nome, questi andranno in conflitto tra loro!</p>
<p>L’ideale, quindi, sarebbe quello di riuscire a:</p>
<ul>
<li>Separare il caricamento del codice per il front-end ed il back-end</li>
<li>Proteggere lo “spazio dei nomi” per evitare possibili conflitti con altri plugin caricati nel sistema</li>
</ul>
<h4>Front-end o Back-end?</h4>
<p>Il modo più semplice per determinare se si è in amministrazione (back-end) è quello di chiamare la funzione <code>is_admin()</code>:</p>
<div class="igBar"><span id="lphp-80"><a href="#" onclick="javascript:showCodeTxt('php-80'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-80">
<div class="php" 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: #b1b100;">if</span><span style="color: #009900;">&#40;</span> is_admin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// includi il codice lato back-end</span></div>
</li>
<li style="font-weight: 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: #b1b100;">else</span> <span style="color: #666666; font-style: italic;">// includi codice lato front-end</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>In pratica, schematizzando, possiamo realizzare:</p>
<p class="center"><img title="Font-end, Back-end" border="0" alt="Font-end, Back-end" src="http://www.undolog.com/wp-content/uploads/2009/04/image2.png" width="477" height="161"/></p>
<p>ovvero:</p>
<div class="igBar"><span id="lphp-81"><a href="#" onclick="javascript:showCodeTxt('php-81'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-81">
<div class="php" 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: #b1b100;">if</span><span style="color: #009900;">&#40;</span> is_admin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</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;">&nbsp; &nbsp; <span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'admin.php'</span> <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> <span style="color: #b1b100;">else</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;">&nbsp; &nbsp; <span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'client.php'</span> <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>
<h4>Uso delle classi per proteggere lo spazio dei nomi</h4>
<p>Per impedire sovrapposizioni spiacevoli un buon modo è quello di “avvolgere” le nostre funzioni e le nostre variabili in opportuni contenitori: gli oggetti. Definendo una classe abbiamo più possibilità di proteggere i nomi delle nostre funzioni ottenendo come ulteriore vantaggio il possibile riutilizzo del codice in futuri plugin. Questa tecnica permette di avere due plugin diversi, quindi due oggetti diversi, con il medesimo metodo (funzione). Il conflitto viene eliminato grazie alla nomenclatura diversa delle classi e delle loro istanze.</p>
<h4>Plugin Sketch</h4>
<p>Detto tutto ciò vediamo come realizzare uno Sketch (che potete trovare sempre aggiornato nel <a target="_blank" href="http://code.google.com/p/saidmade/source/browse/trunk/wordpress/plugins/sketch/">repository Google Code di Saidmade</a>), uno scheletro, da poter riutilizzare ogniqualvolta abbiamo bisogno di scrivere un plugin. Prima di tutto nella nuova organizzazione ad oggetti rendiamoci conto che se è vero che esiste una separazione "netta" tra la parte di back-end e quella front-end è vero anche che alcune "funzioni" sono e saranno condivise! Questo, a livello di programmazione ad oggetti, ci indica la strada da percorrerre in una possibile organizzazione del codice. Ad esempio, l'intuito ci suggerisce che la creazione di una classe "madre", cioè una classe da cui deriveranno le nostre classi "client" (front-end) e "admin" (back-end), sarebbe una buona cosa!<br />
Questa classe "madre" conterrà tutte le proprietà (variabili) e metodi (funzioni) condivise dagli ambienti front-end e back-end:</p>
<p class="center"><img src="http://www.undolog.com/wp-content/uploads/2009/04/wpplugin.jpg" alt="wpplugin" title="wpplugin" width="466" height="297"/></p>
<p>Avremo quindi la nostra classe "madre" e due classi specifiche per il front-end e il back-end:</p>
<div class="igBar"><span id="lcode-82"><a href="#" onclick="javascript:showCodeTxt('code-82'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-82">
<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;">wp-sketch_class.<span style="">php</span> &nbsp; <span style="color:#FF9933; font-style:italic;">// classe madre</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">wp-sketch_admin.<span style="">php</span> &nbsp; <span style="color:#FF9933; font-style:italic;">// classe per il back-end</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;">wp-sketch_client.<span style="">php</span> &nbsp;<span style="color:#FF9933; font-style:italic;">// classe per il front-end</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Il file principale (<code>wp-sketch.php</code>) non farà altro che includere nel modo opportuno queste classi ed istanziarle a dovere:</p>
<div class="igBar"><span id="lphp-83"><a href="#" onclick="javascript:showCodeTxt('php-83'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-83">
<div class="php" 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: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp-sketch_class.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// load the core class</span></div>
</li>
<li style="font-weight: 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: #b1b100;">if</span><span style="color: #009900;">&#40;</span> is_admin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #666666; font-style: italic;">// check admin</span></div>
</li>
<li style="font-weight: 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: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp-sketch_admin.php'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #666666; font-style: italic;">// load admin class</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: #666666; 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; <span style="color: #000088;">$wp_sketch_admin</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> WPSKETCH_ADMIN<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #666666; font-style: italic;">// create object</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> <span style="color: #b1b100;">else</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;">&nbsp; &nbsp; <span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp-sketch_client.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #666666; font-style: italic;">// load client front-end class</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: #000088;">$wp_sketch_client</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> WPSKETCH_CLIENT<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #666666; font-style: italic;">// create object</span></div>
</li>
<li style="font-weight: 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;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>In questo "contesto" bisogna solo stare attenti a definire in modo univoco le variabili che contengono le istanze delle classi (<code>$wp_sketch_admin</code> e <code>$wp_sketch_client</code>) e i nomi delle classi stesse (<code>WPSKETCH_ADMIN</code> e <code>WPSKETCH_CLIENT</code>), ma <strong>non</strong> i metodi e le proprietà in esse presenti.</p>
<p>Entrambe le classi <code>WPSKETCH_ADMIN</code> e <code>WPSKETCH_CLIENT</code> sono "sottoclassi" (figli) di <code>WPSKETCH_CLASS</code>, definita nel file <code>wp-sketch_class.php</code>. Questa, come accennato sopra, dovrà contenere solo gli elementi condivisi (variabili e funzioni) in quanto viene <strong>sempre</strong> caricata a prescindere se ci troviamo nel back-end o nel front-end.</p>
<h4>Concludendo...</h4>
<p>È possibile scaricare l'intero scheletro dal <a target="_blank" href="http://code.google.com/p/saidmade/source/browse/trunk/wordpress/plugins/sketch/">repository Google Code di Saidmade</a>. In questo troverete anche un file <code>wp-sketch_functions.php</code>, utilizzato per evitare che le chiamate alle funzioni nel front-end si traducano un una chiamata <code>oggetto->metodo()</code>. Di fatto è un file opzionale non sempre necessario.</p>
<p>Possibili sviluppi di quest'approccio sono la sempre migliore identificazione della sezione su cui stiamo operando e Wordpress, in questo senso, offre innumerevoli azioni di ottimizzazione da compiere, nell'ottica di caricare solo il codice necessario e quando davvero serve. Ulteiori esempi su questo versante li vedremo prossimamente.</p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F24%2Fsulla-struttura-ad-oggetti-di-un-plugin-wordpress%2F&amp;title=Sulla%20struttura%20ad%20oggetti%20di%20un%20Plugin%20Wordpress&amp;bodytext=Se%20ci%20affidassimo%20al%20semplice%20esempio%20hellodolly.php%20fornito%20da%20Wordpress%2C%20o%20anche%20alla%20stessa%20documentazione%20ufficiale%2C%20non%20arriveremmo%20mai%20alla%20stesura%20di%20un%20buon%20ed%20efficiente%20plugin.%20Vogliamo%20qui%20analizzare%20una%20possibile%20struttura%2C%20quindi%20uno%20sch" 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%2F24%2Fsulla-struttura-ad-oggetti-di-un-plugin-wordpress%2F&amp;title=Sulla%20struttura%20ad%20oggetti%20di%20un%20Plugin%20Wordpress&amp;notes=Se%20ci%20affidassimo%20al%20semplice%20esempio%20hellodolly.php%20fornito%20da%20Wordpress%2C%20o%20anche%20alla%20stessa%20documentazione%20ufficiale%2C%20non%20arriveremmo%20mai%20alla%20stesura%20di%20un%20buon%20ed%20efficiente%20plugin.%20Vogliamo%20qui%20analizzare%20una%20possibile%20struttura%2C%20quindi%20uno%20sch" 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%2F24%2Fsulla-struttura-ad-oggetti-di-un-plugin-wordpress%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%2F24%2Fsulla-struttura-ad-oggetti-di-un-plugin-wordpress%2F&amp;t=Sulla%20struttura%20ad%20oggetti%20di%20un%20Plugin%20Wordpress" 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%2F24%2Fsulla-struttura-ad-oggetti-di-un-plugin-wordpress%2F&amp;title=Sulla%20struttura%20ad%20oggetti%20di%20un%20Plugin%20Wordpress&amp;annotation=Se%20ci%20affidassimo%20al%20semplice%20esempio%20hellodolly.php%20fornito%20da%20Wordpress%2C%20o%20anche%20alla%20stessa%20documentazione%20ufficiale%2C%20non%20arriveremmo%20mai%20alla%20stesura%20di%20un%20buon%20ed%20efficiente%20plugin.%20Vogliamo%20qui%20analizzare%20una%20possibile%20struttura%2C%20quindi%20uno%20sch" 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=Sulla%20struttura%20ad%20oggetti%20di%20un%20Plugin%20Wordpress%20-%20http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F24%2Fsulla-struttura-ad-oggetti-di-un-plugin-wordpress%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=Sulla%20struttura%20ad%20oggetti%20di%20un%20Plugin%20Wordpress&amp;story=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F24%2Fsulla-struttura-ad-oggetti-di-un-plugin-wordpress%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%2F24%2Fsulla-struttura-ad-oggetti-di-un-plugin-wordpress%2F&amp;title=Sulla%20struttura%20ad%20oggetti%20di%20un%20Plugin%20Wordpress" 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=Sulla%20struttura%20ad%20oggetti%20di%20un%20Plugin%20Wordpress&amp;body=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F24%2Fsulla-struttura-ad-oggetti-di-un-plugin-wordpress%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=Sulla%20struttura%20ad%20oggetti%20di%20un%20Plugin%20Wordpress&amp;link=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F24%2Fsulla-struttura-ad-oggetti-di-un-plugin-wordpress%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%2F24%2Fsulla-struttura-ad-oggetti-di-un-plugin-wordpress%2F&amp;headline=Sulla%20struttura%20ad%20oggetti%20di%20un%20Plugin%20Wordpress&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%2F24%2Fsulla-struttura-ad-oggetti-di-un-plugin-wordpress%2F&amp;title=Sulla%20struttura%20ad%20oggetti%20di%20un%20Plugin%20Wordpress&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Se%20ci%20affidassimo%20al%20semplice%20esempio%20hellodolly.php%20fornito%20da%20Wordpress%2C%20o%20anche%20alla%20stessa%20documentazione%20ufficiale%2C%20non%20arriveremmo%20mai%20alla%20stesura%20di%20un%20buon%20ed%20efficiente%20plugin.%20Vogliamo%20qui%20analizzare%20una%20possibile%20struttura%2C%20quindi%20uno%20sch" 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%2F24%2Fsulla-struttura-ad-oggetti-di-un-plugin-wordpress%2F&amp;title=Sulla%20struttura%20ad%20oggetti%20di%20un%20Plugin%20Wordpress" 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%2F24%2Fsulla-struttura-ad-oggetti-di-un-plugin-wordpress%2F&amp;t=Sulla%20struttura%20ad%20oggetti%20di%20un%20Plugin%20Wordpress" 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=Sulla%20struttura%20ad%20oggetti%20di%20un%20Plugin%20Wordpress&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F04%2F24%2Fsulla-struttura-ad-oggetti-di-un-plugin-wordpress%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%2F24%2Fsulla-struttura-ad-oggetti-di-un-plugin-wordpress%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%2F24%2Fsulla-struttura-ad-oggetti-di-un-plugin-wordpress%2F&amp;title=Sulla%20struttura%20ad%20oggetti%20di%20un%20Plugin%20Wordpress" 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%2F24%2Fsulla-struttura-ad-oggetti-di-un-plugin-wordpress%2F&amp;title=Sulla%20struttura%20ad%20oggetti%20di%20un%20Plugin%20Wordpress" 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%2F24%2Fsulla-struttura-ad-oggetti-di-un-plugin-wordpress%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/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/ottimizzazione/" title="ottimizzazione" rel="tag">ottimizzazione</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/prestazioni/" title="prestazioni" rel="tag">prestazioni</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/category/sviluppo/internet/wordpress/" title="WordPress" rel="tag">WordPress</a>, <a href="http://www.undolog.com/tag/wordpress/" title="WordPress" rel="tag">WordPress</a>, <a href="http://www.undolog.com/tag/wordpress-27/" title="Wordpress 2.7" rel="tag">Wordpress 2.7</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<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>
	<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/2008/10/17/wordpress-modifcare-adminbigwidth-per-gli-sviluppatori/" title="Wordpress: modifcare AdminBigWidth per gli sviluppatori (17 ottobre, 2008)">Wordpress: modifcare AdminBigWidth per gli sviluppatori</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/2009/01/28/wordpress-bugs-nellinstallazione-dei-plugins-da-un-archivio-zip/" title="Wordpress: bugs nell&rsquo;installazione dei plugins da un archivio ZIP (28 gennaio, 2009)">Wordpress: bugs nell&rsquo;installazione dei plugins da un archivio ZIP</a> (3)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2009/04/24/sulla-struttura-ad-oggetti-di-un-plugin-wordpress/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Photoshop tutorial: curvare un testo a piacimento</title>
		<link>http://www.undolog.com/2009/03/30/photoshop-tutorial-curvare-un-testo-a-piacimento/</link>
		<comments>http://www.undolog.com/2009/03/30/photoshop-tutorial-curvare-un-testo-a-piacimento/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 21:54:40 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Case Study]]></category>
		<category><![CDATA[Grafica & Design]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Immagini]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=1496</guid>
		<description><![CDATA[Forse non tutti conoscono le potenzialità della gestione del testo in Photoshop, in particolare la sua caratteristica di poter manipolare il testo in modi assai evoluti. Se volessimo ad esempio “piegare” un testo, saremmo tentati di utilizzare la funzione “crea testo alterato”  , che apre una finestra con queste impostazioni:


Ora, a parte qualche raro [...]]]></description>
			<content:encoded><![CDATA[<p>Forse non tutti conoscono le potenzialità della <strong>gestione del testo in Photoshop</strong>, in particolare la sua caratteristica di poter manipolare il testo in modi assai evoluti. Se volessimo ad esempio “piegare” un testo, saremmo tentati di utilizzare la funzione “crea testo alterato” <img title="Altera testo" border="0" alt="Altera testo" align="absmiddle" src="http://www.undolog.com/wp-content/uploads/2009/03/image.png" width="26" height="22"/> , che apre una finestra con queste impostazioni:</p>
<p class="center"><img title="Altera testo" border="0" alt="Altera testo" src="http://www.undolog.com/wp-content/uploads/2009/03/image1.png" width="430" height="390"/></p>
<p><span id="more-1496"></span>
<p>Ora, a parte qualche raro caso di “semplice” distorsione, questa procedura può andare più che bene, ma cosa accade se, ad esempio, vogliamo deformare il nostro testo in modo tale che segua una circonferenza? In questo caso applicando la deformazione “arco” o tentando di usarne più di una i risultati saranno comunque scoraggianti. Esiste infatti un modo molto più semplice ed efficace per deformare un testo; è possibile farlo con pochissimi passi. Immaginiamo di voler inserire una scritta “intorno” ad un cerchio. Prima di tutto creiamo un nuovo layer ed effettuiamo un selezione circolare:</p>
<p class="center"><img title="Selezione circolare" border="0" alt="Selezione circolare" src="http://www.undolog.com/wp-content/uploads/2009/03/image2.png" width="302" height="93"/></p>
<p class="center"><img title="Selezione" border="0" alt="Selezione" src="http://www.undolog.com/wp-content/uploads/2009/03/image3.png" width="366" height="360"/></p>
<p>A questo punto clicchiamo con il tasto destro sulla selezione e selezioniamo “crea tracciato di lavoro…”</p>
<p class="center"><img title="Crea tracciato di lavoro" border="0" alt="Crea tracciato di lavoro" src="http://www.undolog.com/wp-content/uploads/2009/03/image4.png" width="402" height="504"/></p>
<p>Scegliamo la “tolleranza” in modo tale che il “tracciato di lavoro” sia il più possibile una circonferenza.</p>
<p class="center"><img title="Tolleranza" border="0" alt="Tolleranza" src="http://www.undolog.com/wp-content/uploads/2009/03/image5.png" width="337" height="339"/></p>
<p>Creato il nostro tracciato selezioniamo lo strumento testo <img align="absmiddle" title="Strumento testo" border="0" alt="Strumento testo" src="http://www.undolog.com/wp-content/uploads/2009/03/image6.png" width="31" height="24"/> e avviciniamoci alla curva fino a quando il cursore non assomiglia a quello della figura qui sotto:</p>
<p class="center"><img title="Testo" border="0" alt="Testo" src="http://www.undolog.com/wp-content/uploads/2009/03/image7.png" width="353" height="354"/></p>
<p>A questo punto… non resta che scrivere!</p>
<p class="center"><img title="Enjoy" border="0" alt="Enjoy" src="http://www.undolog.com/wp-content/uploads/2009/03/image8.png" width="394" height="383"/></p>
<p>Tramite i “tracciati”, quindi, è possibile far percorrere al nostro testo qualsiasi tipo di curva. Inoltre, una volta che il nostro testo segue la curva del tracciato, come nella figura qui sopra, è sempre possibile modificare il tracciato tramite lo strumento “seleziona tracciato” <img align="absmiddle" title="Selezione tracciato" border="0" alt="Selezione tracciato" src="http://www.undolog.com/wp-content/uploads/2009/03/image9.png" width="32" height="23"/> :</p>
<p class="center"><img title="Modifica del tracciato" border="0" alt="Modifica del tracciato" src="http://www.undolog.com/wp-content/uploads/2009/03/image10.png" width="393" height="380"/></p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F30%2Fphotoshop-tutorial-curvare-un-testo-a-piacimento%2F&amp;title=Photoshop%20tutorial%3A%20curvare%20un%20testo%20a%20piacimento&amp;bodytext=Forse%20non%20tutti%20conoscono%20le%20potenzialit%C3%A0%20della%20gestione%20del%20testo%20in%20Photoshop%2C%20in%20particolare%20la%20sua%20caratteristica%20di%20poter%20manipolare%20il%20testo%20in%20modi%20assai%20evoluti.%20Se%20volessimo%20ad%20esempio%20%E2%80%9Cpiegare%E2%80%9D%20un%20testo%2C%20saremmo%20tentati%20di%20utilizzare%20l" 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%2F30%2Fphotoshop-tutorial-curvare-un-testo-a-piacimento%2F&amp;title=Photoshop%20tutorial%3A%20curvare%20un%20testo%20a%20piacimento&amp;notes=Forse%20non%20tutti%20conoscono%20le%20potenzialit%C3%A0%20della%20gestione%20del%20testo%20in%20Photoshop%2C%20in%20particolare%20la%20sua%20caratteristica%20di%20poter%20manipolare%20il%20testo%20in%20modi%20assai%20evoluti.%20Se%20volessimo%20ad%20esempio%20%E2%80%9Cpiegare%E2%80%9D%20un%20testo%2C%20saremmo%20tentati%20di%20utilizzare%20l" 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%2F30%2Fphotoshop-tutorial-curvare-un-testo-a-piacimento%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%2F30%2Fphotoshop-tutorial-curvare-un-testo-a-piacimento%2F&amp;t=Photoshop%20tutorial%3A%20curvare%20un%20testo%20a%20piacimento" 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%2F30%2Fphotoshop-tutorial-curvare-un-testo-a-piacimento%2F&amp;title=Photoshop%20tutorial%3A%20curvare%20un%20testo%20a%20piacimento&amp;annotation=Forse%20non%20tutti%20conoscono%20le%20potenzialit%C3%A0%20della%20gestione%20del%20testo%20in%20Photoshop%2C%20in%20particolare%20la%20sua%20caratteristica%20di%20poter%20manipolare%20il%20testo%20in%20modi%20assai%20evoluti.%20Se%20volessimo%20ad%20esempio%20%E2%80%9Cpiegare%E2%80%9D%20un%20testo%2C%20saremmo%20tentati%20di%20utilizzare%20l" 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=Photoshop%20tutorial%3A%20curvare%20un%20testo%20a%20piacimento%20-%20http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F30%2Fphotoshop-tutorial-curvare-un-testo-a-piacimento%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=Photoshop%20tutorial%3A%20curvare%20un%20testo%20a%20piacimento&amp;story=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F30%2Fphotoshop-tutorial-curvare-un-testo-a-piacimento%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%2F30%2Fphotoshop-tutorial-curvare-un-testo-a-piacimento%2F&amp;title=Photoshop%20tutorial%3A%20curvare%20un%20testo%20a%20piacimento" 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=Photoshop%20tutorial%3A%20curvare%20un%20testo%20a%20piacimento&amp;body=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F30%2Fphotoshop-tutorial-curvare-un-testo-a-piacimento%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=Photoshop%20tutorial%3A%20curvare%20un%20testo%20a%20piacimento&amp;link=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F30%2Fphotoshop-tutorial-curvare-un-testo-a-piacimento%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%2F30%2Fphotoshop-tutorial-curvare-un-testo-a-piacimento%2F&amp;headline=Photoshop%20tutorial%3A%20curvare%20un%20testo%20a%20piacimento&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%2F30%2Fphotoshop-tutorial-curvare-un-testo-a-piacimento%2F&amp;title=Photoshop%20tutorial%3A%20curvare%20un%20testo%20a%20piacimento&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Forse%20non%20tutti%20conoscono%20le%20potenzialit%C3%A0%20della%20gestione%20del%20testo%20in%20Photoshop%2C%20in%20particolare%20la%20sua%20caratteristica%20di%20poter%20manipolare%20il%20testo%20in%20modi%20assai%20evoluti.%20Se%20volessimo%20ad%20esempio%20%E2%80%9Cpiegare%E2%80%9D%20un%20testo%2C%20saremmo%20tentati%20di%20utilizzare%20l" 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%2F30%2Fphotoshop-tutorial-curvare-un-testo-a-piacimento%2F&amp;title=Photoshop%20tutorial%3A%20curvare%20un%20testo%20a%20piacimento" 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%2F30%2Fphotoshop-tutorial-curvare-un-testo-a-piacimento%2F&amp;t=Photoshop%20tutorial%3A%20curvare%20un%20testo%20a%20piacimento" 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=Photoshop%20tutorial%3A%20curvare%20un%20testo%20a%20piacimento&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F30%2Fphotoshop-tutorial-curvare-un-testo-a-piacimento%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%2F30%2Fphotoshop-tutorial-curvare-un-testo-a-piacimento%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%2F30%2Fphotoshop-tutorial-curvare-un-testo-a-piacimento%2F&amp;title=Photoshop%20tutorial%3A%20curvare%20un%20testo%20a%20piacimento" 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%2F30%2Fphotoshop-tutorial-curvare-un-testo-a-piacimento%2F&amp;title=Photoshop%20tutorial%3A%20curvare%20un%20testo%20a%20piacimento" 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%2F30%2Fphotoshop-tutorial-curvare-un-testo-a-piacimento%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/grafica-design/photoshop/case-study/" title="Case Study" rel="tag">Case Study</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/grafica-design/" title="Grafica &amp; Design" rel="tag">Grafica &amp; Design</a>, <a href="http://www.undolog.com/tag/immagini/" title="Immagini" rel="tag">Immagini</a>, <a href="http://www.undolog.com/category/grafica-design/photoshop/" title="Photoshop" rel="tag">Photoshop</a>, <a href="http://www.undolog.com/tag/photoshop/" title="Photoshop" rel="tag">Photoshop</a>, <a href="http://www.undolog.com/category/software/" title="Software" rel="tag">Software</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/2008/02/26/photoshop-tutorial-pianeta-con-sole-che-sorge/" title="Photoshop tutorial: pianeta con sole che sorge (26 febbraio, 2008)">Photoshop tutorial: pianeta con sole che sorge</a> (4)</li>
	<li><a href="http://www.undolog.com/2008/02/29/photoshop-tutorial-icone-stile-web-20-in-3-passi/" title="Photoshop tutorial: icone stile web 2.0 in 3 passi (29 febbraio, 2008)">Photoshop tutorial: icone stile web 2.0 in 3 passi</a> (19)</li>
	<li><a href="http://www.undolog.com/2008/03/07/photoshop-tutorial-effetto-foglio-piegato/" title="Photoshop tutorial: effetto foglio piegato (7 marzo, 2008)">Photoshop tutorial: effetto foglio piegato</a> (15)</li>
	<li><a href="http://www.undolog.com/2009/08/28/photoshop-tutorial-effetti-con-le-ombre/" title="Photoshop tutorial: effetti con le ombre (28 agosto, 2009)">Photoshop tutorial: effetti con le ombre</a> (0)</li>
	<li><a href="http://www.undolog.com/2008/01/23/i-nuovi-strumenti-di-adobe-photoshop-cs3-extended/" title="I nuovi strumenti di Adobe Photoshop CS3 Extended (23 gennaio, 2008)">I nuovi strumenti di Adobe Photoshop CS3 Extended</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2009/03/30/photoshop-tutorial-curvare-un-testo-a-piacimento/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Wordpress: ordinare una serie di post per un campo qualsiasi</title>
		<link>http://www.undolog.com/2009/03/23/wordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi/</link>
		<comments>http://www.undolog.com/2009/03/23/wordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 07:00:02 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[callback]]></category>
		<category><![CDATA[ordinamento]]></category>
		<category><![CDATA[POST]]></category>
		<category><![CDATA[sort]]></category>
		<category><![CDATA[sorting]]></category>
		<category><![CDATA[stdClass Object]]></category>
		<category><![CDATA[usort()]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=1476</guid>
		<description><![CDATA[La tecnica che illustro qui è utile in molte situazioni dove, ad esempio, abbiamo un array di array o un array di oggetti. In Wordpress può capitare di dover manipolare un elenco di post, nel formato standard di array di stdClass Object, senza aver accesso alla select originale (sul database) che ha generato l'elenco (array) [...]]]></description>
			<content:encoded><![CDATA[<p>La tecnica che illustro qui è utile in molte situazioni dove, ad esempio, abbiamo un <code>array</code> di <code>array</code> o un <code>array</code> di oggetti. In Wordpress può capitare di dover manipolare un elenco di post, nel formato standard di <code>array</code> di <code>stdClass Object</code>, senza aver accesso alla select originale (sul database) che ha generato l'elenco (array) stesso:</p>
<div class="igBar"><span id="lcode-87"><a href="#" onclick="javascript:showCodeTxt('code-87'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-87">
<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;">Array</div>
</li>
<li style="font-weight: 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;">&#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:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span> =&gt; stdClass Object</div>
</li>
<li style="font-weight: 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:#006600; font-weight:bold;">&#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; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#91;</span>ID<span style="color:#006600; font-weight:bold;">&#93;</span> =&gt; <span style="color:#800000;color:#800000;">104</span></div>
</li>
<li style="font-weight: 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:#006600; font-weight:bold;">&#91;</span>post_author<span style="color:#006600; font-weight:bold;">&#93;</span> =&gt; <span style="color:#800000;color:#800000;">37</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; ...</div>
</li>
</ol>
</div>
</div>
</div>
<p>
<span id="more-1476"></span></p>
<p>È possibile tuttavia ordinare un tale <code>array</code> in un momento successivo, senza passare per il database, sfruttando la funzione php <code>usort()</code>. Questa permette di eseguire un ordinamento tramite una funzione <code>callback</code> personale. Ad esempio immaginiamo di voler ordinare i nostri post per <code>post_author</code> o per un qualsiasi altro campo che, a sua volta, può essere un <code>array</code> o un altro <code>stdClass Object</code>:</p>
<div class="igBar"><span id="lphp-88"><a href="#" onclick="javascript:showCodeTxt('php-88'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-88">
<div class="php" 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: #009933; 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: #009933; font-style: italic;">&nbsp;* $posts è il nostro array di oggetti &quot;post&quot; stdClass Object</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: #009933; font-style: italic;">&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;"><a href="http://www.php.net/usort"><span style="color: #990000;">usort</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$posts</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;__sort&quot;</span> <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;">&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: #000000; font-weight: bold;">function</span> __sort<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$a</span><span style="color: #339933;">,</span> <span style="color: #000088;">$b</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#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: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$a</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_author</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$b</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_author</span> <span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: 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: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$a</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_author</span><span style="color: #339933;">&gt;</span> <span style="color: #000088;">$b</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_author</span><span style="color: #009900;">&#41;</span> ? <span style="color: #339933;">-</span>1 <span style="color: #339933;">:</span> <span style="color: #cc66cc;color:#800000;">1</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #666666; font-style: italic;">// decrescente</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: #666666; font-style: italic;">// return ($a-&gt;post_author &lt;$b-&gt;post_author) ? -1 : 1; &nbsp; // crescente</span></div>
</li>
<li style="font-weight: 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;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Giocando sul maggiore ">" e minore "<" dell'ultima istruzione è possibile ordinare in modo decrescente o crescente.</p>
<p>Queste situazioni possono essere molto frequenti in contesti avanzati dove, ad esempio, si hanno una serie di elenchi da sottoporre a scansione. Un altro esempio è nel caso di aggregazioni, dove più liste di post, recuperati al limite da blog diversi, devono essere ordinate.</p>
<div class="igBar"><span id="lphp-89"><a href="#" onclick="javascript:showCodeTxt('php-89'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-89">
<div class="php" 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.php.net/array_push"><span style="color: #990000;">array_push</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$posts</span><span style="color: #339933;">,</span> <span style="color: #000088;">$lista_1</span><span style="color: #339933;">,</span> <span style="color: #000088;">$lista_2</span><span style="color: #339933;">,</span> <span style="color: #000088;">$lista_3</span><span style="color: #339933;">,</span> <span style="color: #339933;">...,</span> <span style="color: #000088;">$lista_n</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: 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: #009933; 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: #009933; font-style: italic;">&nbsp;* $posts è un array di liste, elenchi di post recuperati chissà</span></div>
</li>
<li style="font-weight: 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: #009933; font-style: italic;">&nbsp;* dove e chissà 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: #009933; font-style: italic;">&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;"><a href="http://www.php.net/usort"><span style="color: #990000;">usort</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$posts</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;__sort&quot;</span> <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;">&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: #000000; font-weight: bold;">function</span> __sort<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$a</span><span style="color: #339933;">,</span> <span style="color: #000088;">$b</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#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: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$a</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$b</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: 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: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$a</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #339933;">&lt;</span><span style="color: #000088;">$b</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #009900;">&#41;</span> ? <span style="color: #339933;">-</span>1 <span style="color: #339933;">:</span> <span style="color: #cc66cc;color:#800000;">1</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>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F23%2Fwordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi%2F&amp;title=Wordpress%3A%20ordinare%20una%20serie%20di%20post%20per%20un%20campo%20qualsiasi&amp;bodytext=La%20tecnica%20che%20illustro%20qui%20%C3%A8%20utile%20in%20molte%20situazioni%20dove%2C%20ad%20esempio%2C%20abbiamo%20un%20array%20di%20array%20o%20un%20array%20di%20oggetti.%20In%20Wordpress%20pu%C3%B2%20capitare%20di%20dover%20manipolare%20un%20elenco%20di%20post%2C%20nel%20formato%20standard%20di%20array%20di%20stdClass%20Object%2C%20senza%20aver" 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%2F23%2Fwordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi%2F&amp;title=Wordpress%3A%20ordinare%20una%20serie%20di%20post%20per%20un%20campo%20qualsiasi&amp;notes=La%20tecnica%20che%20illustro%20qui%20%C3%A8%20utile%20in%20molte%20situazioni%20dove%2C%20ad%20esempio%2C%20abbiamo%20un%20array%20di%20array%20o%20un%20array%20di%20oggetti.%20In%20Wordpress%20pu%C3%B2%20capitare%20di%20dover%20manipolare%20un%20elenco%20di%20post%2C%20nel%20formato%20standard%20di%20array%20di%20stdClass%20Object%2C%20senza%20aver" 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%2F23%2Fwordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi%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%2F23%2Fwordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi%2F&amp;t=Wordpress%3A%20ordinare%20una%20serie%20di%20post%20per%20un%20campo%20qualsiasi" 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%2F23%2Fwordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi%2F&amp;title=Wordpress%3A%20ordinare%20una%20serie%20di%20post%20per%20un%20campo%20qualsiasi&amp;annotation=La%20tecnica%20che%20illustro%20qui%20%C3%A8%20utile%20in%20molte%20situazioni%20dove%2C%20ad%20esempio%2C%20abbiamo%20un%20array%20di%20array%20o%20un%20array%20di%20oggetti.%20In%20Wordpress%20pu%C3%B2%20capitare%20di%20dover%20manipolare%20un%20elenco%20di%20post%2C%20nel%20formato%20standard%20di%20array%20di%20stdClass%20Object%2C%20senza%20aver" 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%3A%20ordinare%20una%20serie%20di%20post%20per%20un%20campo%20qualsiasi%20-%20http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F23%2Fwordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi%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%3A%20ordinare%20una%20serie%20di%20post%20per%20un%20campo%20qualsiasi&amp;story=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F23%2Fwordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi%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%2F23%2Fwordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi%2F&amp;title=Wordpress%3A%20ordinare%20una%20serie%20di%20post%20per%20un%20campo%20qualsiasi" 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%3A%20ordinare%20una%20serie%20di%20post%20per%20un%20campo%20qualsiasi&amp;body=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F23%2Fwordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi%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%3A%20ordinare%20una%20serie%20di%20post%20per%20un%20campo%20qualsiasi&amp;link=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F23%2Fwordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi%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%2F23%2Fwordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi%2F&amp;headline=Wordpress%3A%20ordinare%20una%20serie%20di%20post%20per%20un%20campo%20qualsiasi&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%2F23%2Fwordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi%2F&amp;title=Wordpress%3A%20ordinare%20una%20serie%20di%20post%20per%20un%20campo%20qualsiasi&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=La%20tecnica%20che%20illustro%20qui%20%C3%A8%20utile%20in%20molte%20situazioni%20dove%2C%20ad%20esempio%2C%20abbiamo%20un%20array%20di%20array%20o%20un%20array%20di%20oggetti.%20In%20Wordpress%20pu%C3%B2%20capitare%20di%20dover%20manipolare%20un%20elenco%20di%20post%2C%20nel%20formato%20standard%20di%20array%20di%20stdClass%20Object%2C%20senza%20aver" 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%2F23%2Fwordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi%2F&amp;title=Wordpress%3A%20ordinare%20una%20serie%20di%20post%20per%20un%20campo%20qualsiasi" 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%2F23%2Fwordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi%2F&amp;t=Wordpress%3A%20ordinare%20una%20serie%20di%20post%20per%20un%20campo%20qualsiasi" 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%3A%20ordinare%20una%20serie%20di%20post%20per%20un%20campo%20qualsiasi&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F03%2F23%2Fwordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi%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%2F23%2Fwordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi%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%2F23%2Fwordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi%2F&amp;title=Wordpress%3A%20ordinare%20una%20serie%20di%20post%20per%20un%20campo%20qualsiasi" 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%2F23%2Fwordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi%2F&amp;title=Wordpress%3A%20ordinare%20una%20serie%20di%20post%20per%20un%20campo%20qualsiasi" 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%2F23%2Fwordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi%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/callback/" title="callback" rel="tag">callback</a>, <a href="http://www.undolog.com/category/sviluppo/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/ordinamento/" title="ordinamento" rel="tag">ordinamento</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/post/" title="POST" rel="tag">POST</a>, <a href="http://www.undolog.com/tag/sort/" title="sort" rel="tag">sort</a>, <a href="http://www.undolog.com/tag/sorting/" title="sorting" rel="tag">sorting</a>, <a href="http://www.undolog.com/tag/stdclass-object/" title="stdClass Object" rel="tag">stdClass Object</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/usort/" title="usort()" rel="tag">usort()</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/2009/01/05/wordpress-wp_parse_args/" title="Wordpress: wp_parse_args() (5 gennaio, 2009)">Wordpress: wp_parse_args()</a> (3)</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/2009/03/12/very-short-trick-pagine-padri-e-pagine-figlie-in-wordpress/" title="Very short trick: pagine padri e pagine figlie in Wordpress (12 marzo, 2009)">Very short trick: pagine padri e pagine figlie in Wordpress</a> (1)</li>
	<li><a href="http://www.undolog.com/2009/07/02/very-short-snippet-wordpress-prossimamente-sul-vostro-blog/" title="Very short snippet: Wordpress, prossimamente sul vostro blog (2 luglio, 2009)">Very short snippet: Wordpress, prossimamente sul vostro blog</a> (1)</li>
	<li><a href="http://www.undolog.com/2009/06/05/very-short-snippet-visualizzare-una-lista-di-post-per-categoria-o-tag/" title="Very short snippet: visualizzare una lista di post per categoria o tag (5 giugno, 2009)">Very short snippet: visualizzare una lista di post per categoria o tag</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2009/03/23/wordpress-ordinare-una-serie-di-post-per-un-campo-qualsiasi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress: personalizzare la navigazione tra i post</title>
		<link>http://www.undolog.com/2009/02/09/wordpress-personalizzare-la-navigazione-tra-i-post/</link>
		<comments>http://www.undolog.com/2009/02/09/wordpress-personalizzare-la-navigazione-tra-i-post/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 05:00:11 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[Codice]]></category>
		<category><![CDATA[Funzione]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Layout]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PNG]]></category>
		<category><![CDATA[Stile]]></category>
		<category><![CDATA[Temi]]></category>
		<category><![CDATA[Template]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=1321</guid>
		<description><![CDATA[Wordpress mette a disposizione numerose funzioni per spostarsi tra i vari post e pagine in avanti ed indietro. Queste sono usate all'interno dei temi, spesso in modo del tutto interscambiabile, anche se contengono alcune differenze. Tutto questo, a dire il vero, creo non poca confusione al momento della scelta della funzione da usare. Eccone alcune [...]]]></description>
			<content:encoded><![CDATA[<p>Wordpress mette a disposizione numerose funzioni per spostarsi tra i vari post e pagine in avanti ed indietro. Queste sono usate all'interno dei temi, spesso in modo del tutto interscambiabile, anche se contengono alcune differenze. Tutto questo, a dire il vero, creo non poca confusione al momento della scelta della funzione da usare. Eccone alcune note:</p>
<ul>
<li><code>adjacent_post_link()</code></li>
<li><code>next_posts_link()</code></li>
<li><code>posts_nav_link()</code></li>
</ul>
<p><span id="more-1321"></span></p>
<p>Con la release 2.7 di Wordpress, poi, sono stati aggiunge altre funzioni (o rese pubbliche) usate in realtà all'interno di quelle già note. Ad esempio la <em>nuova</em> <code>get_next_posts_link()</code> è usata da <code>next_posts_link()</code>, disponibile dalla release 0.71. Ovviamente la <code>get_previous_posts_link()</code> viene chiamata da <code>previous_posts_link()</code>.</p>
<p>Per ragioni storiche e di compatibilità con i "vecchi" template, analizzando il codice sorgente di Wordpress ci si rende conto che alcune funzioni sono davvero ridondanti. Ad esempio <code>posts_nav_link()</code> chiama al suo interno <code>previous_posts_link()</code> e <code>next_posts_link()</code>. Tuttavia il codice (nella release 2.7 di Wordpress) di <code>next_posts_link()</code> è:</p>
<div class="igBar"><span id="lphp-94"><a href="#" onclick="javascript:showCodeTxt('php-94'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-94">
<div class="php" 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: #009933; 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: #009933; font-style: italic;">&nbsp;* Display the next posts pages link.</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: #009933; font-style: italic;">&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: #009933; font-style: italic;">&nbsp;* @since 0.71</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: #009933; font-style: italic;">&nbsp;* @uses get_next_posts_link()</span></div>
</li>
<li style="font-weight: 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: #009933; font-style: italic;">&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: #009933; font-style: italic;">&nbsp;* @param string $label Content for link text.</span></div>
</li>
<li style="font-weight: 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: #009933; font-style: italic;">&nbsp;* @param int $max_page Optional. Max pages.</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: #009933; font-style: italic;">&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: #000000; font-weight: bold;">function</span> next_posts_link<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$label</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Next Page &amp;raquo;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$max_page</span> <span style="color: #339933;">=</span> 0 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#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: #b1b100;">echo</span> get_next_posts_link<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$label</span><span style="color: #339933;">,</span> <span style="color: #000088;">$max_page</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: 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;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h4>Personalizzazione</h4>
<p>Lasciando da parte le questioni di codice sorgente a basso livello, torniamo ad affrontare l'argomento di questo post, cioè di come modificare facilmente il layout classico dell'avanti e indietro. La navigazione avanti ed indietro può essere posizionata dove si vuole, ad esempio nel file <code>archive.php</code> si può usare:</p>
<div class="igBar"><span id="lhtml-95"><a href="#" onclick="javascript:showCodeTxt('html-95'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-95">
<div class="html" 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;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Ediv.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;navigation&quot;</span><a href="http://december.com/html/4/element/%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: 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;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Ediv.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;prev alignleft&quot;</span>&gt;&lt;?php next_posts_link<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'&lt;span&gt;</span></span>Precedente<span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3E%2Fspan%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></a></span>') ?&gt;<span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3E%2Fdiv%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></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;">&nbsp;<span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Ediv.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;next alignright&quot;</span>&gt;&lt;?php previous_posts_link<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'&lt;span&gt;</span></span>Successivo<span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3E%2Fspan%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></a></span>') ?&gt;<span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3E%2Fdiv%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></a></span></div>
</li>
<li style="font-weight: 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;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3E%2Fdiv%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></a></span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Dato che ci stiamo muovendo in un archivio, che è limitato rispetto all'intera possibilità di post (perchè filtra per data, argomento, tag, etc...) usiamo <code>next_posts_link()</code> e <code>previous_posts_link()</code>. Impostando poi le label in modo opportuno, come nell'esempio, possiamo operare le modifiche di layout tramite il solo foglio di stile, lasciando un output HTML valido. Ad esempio è possibile "nascondere" le label e sostiturle con un'immagine usando:</p>
<div class="igBar"><span id="lcss-96"><a href="#" onclick="javascript:showCodeTxt('css-96'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-96">
<div class="css" 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: #6666ff;">.alignright</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">&#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: #6666ff;">.alignleft</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">&#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: #808080; font-style: italic;">/* personalizzazione della navigazione *&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;"><span style="color: #808080; font-style: italic;">div.navigation {display:block;height:38px;padding:16px 0 16px 16px;width:678px}</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: #808080; font-style: italic;">div.navigation div.prev a {display:block;width:38px;height:38px;background:url(images/prev_image.png) no-repeat}</span></div>
</li>
<li style="font-weight: 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: #808080; font-style: italic;">div.navigation div.next a {display:block;width:38px;height:38px;background:url(images/next_image.png) no-repeat}</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: #808080; font-style: italic;">div.navigation div.prev a span, div.navigation div.next a span{display:none}</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>L'ultima riga è quella che permette di nascondere i testi, ed è per questo che sono stati inseriti degli <code>span</code> nella chiamata alla funzione <code>next_posts_link()</code> e <code>previous_posts_link()</code></p>
<p>Per la navigazione nel file <code>single.php</code>, spesso si usa:</p>
<div class="igBar"><span id="lhtml-97"><a href="#" onclick="javascript:showCodeTxt('html-97'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-97">
<div class="html" 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;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Ediv.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;navigation&quot;</span><a href="http://december.com/html/4/element/%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: 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;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Ediv.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;prev alignleft&quot;</span>&gt;&lt;?php adjacent_post_link<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'%link'</span>, <span style="color: #ff0000;">'&lt;span&gt;</span></span>Precedente<span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3E%2Fspan%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></a></span>', false, '', true); &nbsp;?&gt;<span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3E%2Fdiv%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></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;">&nbsp;<span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Ediv.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;next alignright&quot;</span>&gt;&lt;?php adjacent_post_link<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'%link'</span>, <span style="color: #ff0000;">'&lt;span&gt;</span></span>Successivo<span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3E%2Fspan%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></a></span>', false, '', false); &nbsp;?&gt;<span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3E%2Fdiv%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></a></span></div>
</li>
<li style="font-weight: 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;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3E%2Fdiv%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></a></span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Anche in questo caso il codice CSS è sempre lo stesso.</p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F09%2Fwordpress-personalizzare-la-navigazione-tra-i-post%2F&amp;title=Wordpress%3A%20personalizzare%20la%20navigazione%20tra%20i%20post&amp;bodytext=Wordpress%20mette%20a%20disposizione%20numerose%20funzioni%20per%20spostarsi%20tra%20i%20vari%20post%20e%20pagine%20in%20avanti%20ed%20indietro.%20Queste%20sono%20usate%20all%27interno%20dei%20temi%2C%20spesso%20in%20modo%20del%20tutto%20interscambiabile%2C%20anche%20se%20contengono%20alcune%20differenze.%20Tutto%20questo%2C%20a%20d" 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%2F09%2Fwordpress-personalizzare-la-navigazione-tra-i-post%2F&amp;title=Wordpress%3A%20personalizzare%20la%20navigazione%20tra%20i%20post&amp;notes=Wordpress%20mette%20a%20disposizione%20numerose%20funzioni%20per%20spostarsi%20tra%20i%20vari%20post%20e%20pagine%20in%20avanti%20ed%20indietro.%20Queste%20sono%20usate%20all%27interno%20dei%20temi%2C%20spesso%20in%20modo%20del%20tutto%20interscambiabile%2C%20anche%20se%20contengono%20alcune%20differenze.%20Tutto%20questo%2C%20a%20d" 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%2F09%2Fwordpress-personalizzare-la-navigazione-tra-i-post%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%2F09%2Fwordpress-personalizzare-la-navigazione-tra-i-post%2F&amp;t=Wordpress%3A%20personalizzare%20la%20navigazione%20tra%20i%20post" 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%2F09%2Fwordpress-personalizzare-la-navigazione-tra-i-post%2F&amp;title=Wordpress%3A%20personalizzare%20la%20navigazione%20tra%20i%20post&amp;annotation=Wordpress%20mette%20a%20disposizione%20numerose%20funzioni%20per%20spostarsi%20tra%20i%20vari%20post%20e%20pagine%20in%20avanti%20ed%20indietro.%20Queste%20sono%20usate%20all%27interno%20dei%20temi%2C%20spesso%20in%20modo%20del%20tutto%20interscambiabile%2C%20anche%20se%20contengono%20alcune%20differenze.%20Tutto%20questo%2C%20a%20d" 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%3A%20personalizzare%20la%20navigazione%20tra%20i%20post%20-%20http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F09%2Fwordpress-personalizzare-la-navigazione-tra-i-post%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%3A%20personalizzare%20la%20navigazione%20tra%20i%20post&amp;story=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F09%2Fwordpress-personalizzare-la-navigazione-tra-i-post%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%2F09%2Fwordpress-personalizzare-la-navigazione-tra-i-post%2F&amp;title=Wordpress%3A%20personalizzare%20la%20navigazione%20tra%20i%20post" 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%3A%20personalizzare%20la%20navigazione%20tra%20i%20post&amp;body=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F09%2Fwordpress-personalizzare-la-navigazione-tra-i-post%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%3A%20personalizzare%20la%20navigazione%20tra%20i%20post&amp;link=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F09%2Fwordpress-personalizzare-la-navigazione-tra-i-post%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%2F09%2Fwordpress-personalizzare-la-navigazione-tra-i-post%2F&amp;headline=Wordpress%3A%20personalizzare%20la%20navigazione%20tra%20i%20post&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%2F09%2Fwordpress-personalizzare-la-navigazione-tra-i-post%2F&amp;title=Wordpress%3A%20personalizzare%20la%20navigazione%20tra%20i%20post&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Wordpress%20mette%20a%20disposizione%20numerose%20funzioni%20per%20spostarsi%20tra%20i%20vari%20post%20e%20pagine%20in%20avanti%20ed%20indietro.%20Queste%20sono%20usate%20all%27interno%20dei%20temi%2C%20spesso%20in%20modo%20del%20tutto%20interscambiabile%2C%20anche%20se%20contengono%20alcune%20differenze.%20Tutto%20questo%2C%20a%20d" 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%2F09%2Fwordpress-personalizzare-la-navigazione-tra-i-post%2F&amp;title=Wordpress%3A%20personalizzare%20la%20navigazione%20tra%20i%20post" 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%2F09%2Fwordpress-personalizzare-la-navigazione-tra-i-post%2F&amp;t=Wordpress%3A%20personalizzare%20la%20navigazione%20tra%20i%20post" 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%3A%20personalizzare%20la%20navigazione%20tra%20i%20post&amp;url=http%3A%2F%2Fwww.undolog.com%2F2009%2F02%2F09%2Fwordpress-personalizzare-la-navigazione-tra-i-post%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%2F09%2Fwordpress-personalizzare-la-navigazione-tra-i-post%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%2F09%2Fwordpress-personalizzare-la-navigazione-tra-i-post%2F&amp;title=Wordpress%3A%20personalizzare%20la%20navigazione%20tra%20i%20post" 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%2F09%2Fwordpress-personalizzare-la-navigazione-tra-i-post%2F&amp;title=Wordpress%3A%20personalizzare%20la%20navigazione%20tra%20i%20post" 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%2F09%2Fwordpress-personalizzare-la-navigazione-tra-i-post%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/class/" title="class" rel="tag">class</a>, <a href="http://www.undolog.com/tag/codice/" title="Codice" rel="tag">Codice</a>, <a href="http://www.undolog.com/category/sviluppo/internet/css/" title="CSS" rel="tag">CSS</a>, <a href="http://www.undolog.com/tag/css/" title="CSS" rel="tag">CSS</a>, <a href="http://www.undolog.com/tag/funzione/" title="Funzione" rel="tag">Funzione</a>, <a href="http://www.undolog.com/tag/html/" title="HTML" rel="tag">HTML</a>, <a href="http://www.undolog.com/category/sviluppo/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/layout/" title="Layout" rel="tag">Layout</a>, <a href="http://www.undolog.com/tag/php/" title="PHP" rel="tag">PHP</a>, <a href="http://www.undolog.com/tag/png/" title="PNG" rel="tag">PNG</a>, <a href="http://www.undolog.com/tag/stile/" title="Stile" rel="tag">Stile</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/tag/temi/" title="Temi" rel="tag">Temi</a>, <a href="http://www.undolog.com/tag/template/" title="Template" rel="tag">Template</a>, <a href="http://www.undolog.com/category/tutorials/" title="Tutorials" rel="tag">Tutorials</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/10/17/wordpress-modifcare-adminbigwidth-per-gli-sviluppatori/" title="Wordpress: modifcare AdminBigWidth per gli sviluppatori (17 ottobre, 2008)">Wordpress: modifcare AdminBigWidth per gli sviluppatori</a> (1)</li>
	<li><a href="http://www.undolog.com/2008/10/22/wordpress-migliorare-la-lista-dei-commenti/" title="Wordpress: migliorare la lista dei commenti (22 ottobre, 2008)">Wordpress: migliorare la lista dei commenti</a> (3)</li>
	<li><a href="http://www.undolog.com/2008/10/30/jquery-bordi-rotondi-sulle-immagini-per-sovrapposizione/" title="jQuery: bordi rotondi sulle immagini per sovrapposizione (30 ottobre, 2008)">jQuery: bordi rotondi sulle immagini per sovrapposizione</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/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>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2009/02/09/wordpress-personalizzare-la-navigazione-tra-i-post/feed/</wfw:commentRss>
		<slash:comments>5</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-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: #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-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: #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-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: #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-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: #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-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: #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>Creare un semplice Feed Reader con SimplePie e jQuery</title>
		<link>http://www.undolog.com/2008/12/15/creare-un-semplice-feed-reader-con-simplepie-e-jquery/</link>
		<comments>http://www.undolog.com/2008/12/15/creare-un-semplice-feed-reader-con-simplepie-e-jquery/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 10:55:30 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Google API]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[SimplePie]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=1023</guid>
		<description><![CDATA[SimplePie è una libreria PHP in grado di semplificare notevolmente il recupero e la manipolazione di Feed RSS o, più in generale, di formati XML. È possibile, ad esempio, scrivere poche righe di codice, sfruttando anche qualche "funzioncina" jQuery, per realizzare un News Ticker da inserire nel nostro sito/blog.
Cosa ci serve...
Prima di tutto scaricate SimplePie [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://simplepie.org/downloads/">SimplePie</a> è una libreria PHP in grado di semplificare notevolmente il recupero e la manipolazione di Feed RSS o, più in generale, di formati XML. È possibile, ad esempio, scrivere poche righe di codice, sfruttando anche qualche "funzioncina" <a target="_blank" href="http://jquery.com">jQuery</a>, per realizzare un <em>News Ticker</em> da inserire nel nostro sito/blog.</p>
<h4>Cosa ci serve...</h4>
<p>Prima di tutto scaricate <a target="_blank" href="http://simplepie.org/downloads/">SimplePie</a> e inserire, da qualche parte, il file <code>simplepie.inc</code> sul vostro sito/blog. Il codice per leggere e visualizzare un feed è il seguente:</p>
<div class="igBar"><span id="lphp-112"><a href="#" onclick="javascript:showCodeTxt('php-112'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-112">
<div class="php" 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: #009933; 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: #009933; font-style: italic;">&nbsp;* SimplePie sample</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: #009933; font-style: italic;">&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: #009933; font-style: italic;">&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: #009933; font-style: italic;">&nbsp;* @web &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://www.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: #009933; font-style: italic;">&nbsp;* @email &nbsp; &nbsp; &nbsp; &nbsp; g.fazioli@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: #009933; font-style: italic;">&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: #009933; font-style: italic;">&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: #666666; font-style: italic;">// inserire il percorso corretto </span></div>
</li>
<li style="font-weight: 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: #b1b100;">require_once</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;simplepie.inc&quot;</span><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: #666666; 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: #000000; font-weight: bold;">function</span> wordCut<span style="color: #009900;">&#40;</span><span style="color: #000088;">$c</span><span style="color: #339933;">,</span> <span style="color: #000088;">$l</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#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;"><span style="color: #000088;">$a</span><span style="color: #339933;">=</span> <a href="http://www.php.net/explode"><span style="color: #990000;">explode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: 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: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$a</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;</span> <span style="color: #000088;">$l</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#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: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$l</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$r</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: 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: #000088;">$r</span><span style="color: #339933;">=</span> <a href="http://www.php.net/implode"><span style="color: #990000;">implode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> <span style="color: #000088;">$r</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'...'</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;">&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$r</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: 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;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">return</span> <span style="color: #000088;">$c</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>
<li style="font-weight: 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: #666666; 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: #000088;">$max</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #339933;">=</span> <span style="color: #cc66cc;color:#800000;">10</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #666666; font-style: italic;">// last 10 post/news</span></div>
</li>
<li style="font-weight: 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: #000088;">$thefeed</span> &nbsp; &nbsp;<span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SimplePie<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://www.undolog.com/feed'</span><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: #000088;">$thefeed</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handle_content_type</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: 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: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span><span style="color: #000088;">$thefeed</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_item_quantity</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$max</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span> &nbsp;<span style="color: #009900;">&#41;</span> <span style="color: #000088;">$articles</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$thefeed</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_item</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><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: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$articles</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;li&gt;&lt;a href=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_link</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_title</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/a&gt; - '</span><span style="color: #339933;">.</span>wordCut<span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_description</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;color:#800000;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/li&gt;'</span><span style="color: #339933;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
<span id="more-1023"></span></p>
<p>In questo codice di esempio ho estratto gli ultimi 10 Feed da undolog.com e li ho formattati usando una lista <code>ul/li</code>. Ho recuperato sia il titolo (<code>$item->get_title()</code>) che una parte del contenuto (<code>$item->get_description()</code>). Ovviamente inserite questo codice all'interno di una formattazione HTML di questo tipo:</p>
<div class="igBar"><span id="lhtml-113"><a href="#" onclick="javascript:showCodeTxt('html-113'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-113">
<div class="html" 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;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Ediv.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;feed-ticker&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;display:none&quot;</span><a href="http://december.com/html/4/element/%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: 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;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Eul%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;ul&gt;</span></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;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;</span></a>?php <span style="color: #66cc66;">//</span> inserire qui il codice ?<a href="http://december.com/html/4/element/%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: 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;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3E%2Ful%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;/ul&gt;</span></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: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3E%2Fdiv%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></a></span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Veniamo ora alla parte Javascript per visualizzare "a turno", con una semplice animazione, i singoli titoli/contenuto dei feed:</p>
<div class="igBar"><span id="lhtml-114"><a href="#" onclick="javascript:showCodeTxt('html-114'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-114">
<div class="html" 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;">// includiamo jQuery tramite Google API</div>
</li>
<li style="font-weight: 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;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Escript.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.google.com/jsapi&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span>script&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;"><span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Escript.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span><a href="http://december.com/html/4/element/%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>google.load(&quot;jquery&quot;, &quot;1.2.6&quot;);<span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3E%2Fscript%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></a></span></div>
</li>
<li style="font-weight: 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;"><span style="color: #808080; font-style: italic;">&lt;!-- codice jQuery per animazione delle news --&gt;</span></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;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Escript.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sample.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span>script&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;"><span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Escript.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span><a href="http://december.com/html/4/element/%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&gt;</span></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;">// chiamo initNews() al completamento della pagina</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#FF9900;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">google.setOnLoadCallback( initNews );</div>
</li>
<li style="font-weight: 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;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3E%2Fscript%26amp%3Bgt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></a></span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Nel file <code>sample.js</code>, che potete chiamare e posizionare dove volete, abbiamo:</p>
<div class="igBar"><span id="ljavascript-115"><a href="#" onclick="javascript:showCodeTxt('javascript-115'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-115">
<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;"><span style="color: #006600; font-style: italic;">// globale</span></div>
</li>
<li style="font-weight: 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: #003366; font-weight: bold;">var</span> index_news <span style="color: #339933;">=</span> <span style="color: #CC0000;color:#800000;">0</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: #006600; 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: #003366; font-weight: bold;">function</span> initNews<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#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;">&#40;</span><span style="color: #3366CC;">'div#feed-ticker'</span><span style="color: #009900;">&#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; .<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</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;">&nbsp; &nbsp; &nbsp; &nbsp; <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;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div#feed-ticker li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">eq</span><span style="color: #009900;">&#40;</span> index_news <span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><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;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setTimeout<span style="color: #009900;">&#40;</span> next_news<span style="color: #339933;">,</span> 5000 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: 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;">&#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: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: 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;">&#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: #003366; font-weight: bold;">function</span> next_news<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#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;">&#40;</span><span style="color: #3366CC;">'div#feed-ticker li'</span><span style="color: #009900;">&#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; .<span style="color: #660066;">eq</span><span style="color: #009900;">&#40;</span> index_news <span style="color: #009900;">&#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; .<span style="color: #660066;">fadeOut</span><span style="color: #009900;">&#40;</span>1000<span style="color: #339933;">,</span> </div>
</li>
<li style="font-weight: 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: #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: 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; index_news<span style="color: #339933;">++;</span></div>
</li>
<li style="font-weight: 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: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> index_news<span style="color: #339933;">&gt;</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div#feed-ticker li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span><span style="color: #339933;">-</span>1 <span style="color: #009900;">&#41;</span> index_news <span style="color: #339933;">=</span> <span style="color: #CC0000;color:#800000;">0</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;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div#feed-ticker li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">eq</span><span style="color: #009900;">&#40;</span> index_news <span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: 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; setTimeout<span style="color: #009900;">&#40;</span> next_news<span style="color: #339933;">,</span> 5000 <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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#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;">&#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>Il risultato finale lo potete vedere su <a target="_blank" href="http://www.saidmade.com">saidmade.com</a> <img src='http://www.undolog.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F15%2Fcreare-un-semplice-feed-reader-con-simplepie-e-jquery%2F&amp;title=Creare%20un%20semplice%20Feed%20Reader%20con%20SimplePie%20e%20jQuery&amp;bodytext=SimplePie%20%C3%A8%20una%20libreria%20PHP%20in%20grado%20di%20semplificare%20notevolmente%20il%20recupero%20e%20la%20manipolazione%20di%20Feed%20RSS%20o%2C%20pi%C3%B9%20in%20generale%2C%20di%20formati%20XML.%20%C3%88%20possibile%2C%20ad%20esempio%2C%20scrivere%20poche%20righe%20di%20codice%2C%20sfruttando%20anche%20qualche%20%22funzioncina%22%20jQuer" 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%2F15%2Fcreare-un-semplice-feed-reader-con-simplepie-e-jquery%2F&amp;title=Creare%20un%20semplice%20Feed%20Reader%20con%20SimplePie%20e%20jQuery&amp;notes=SimplePie%20%C3%A8%20una%20libreria%20PHP%20in%20grado%20di%20semplificare%20notevolmente%20il%20recupero%20e%20la%20manipolazione%20di%20Feed%20RSS%20o%2C%20pi%C3%B9%20in%20generale%2C%20di%20formati%20XML.%20%C3%88%20possibile%2C%20ad%20esempio%2C%20scrivere%20poche%20righe%20di%20codice%2C%20sfruttando%20anche%20qualche%20%22funzioncina%22%20jQuer" 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%2F15%2Fcreare-un-semplice-feed-reader-con-simplepie-e-jquery%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%2F15%2Fcreare-un-semplice-feed-reader-con-simplepie-e-jquery%2F&amp;t=Creare%20un%20semplice%20Feed%20Reader%20con%20SimplePie%20e%20jQuery" 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%2F15%2Fcreare-un-semplice-feed-reader-con-simplepie-e-jquery%2F&amp;title=Creare%20un%20semplice%20Feed%20Reader%20con%20SimplePie%20e%20jQuery&amp;annotation=SimplePie%20%C3%A8%20una%20libreria%20PHP%20in%20grado%20di%20semplificare%20notevolmente%20il%20recupero%20e%20la%20manipolazione%20di%20Feed%20RSS%20o%2C%20pi%C3%B9%20in%20generale%2C%20di%20formati%20XML.%20%C3%88%20possibile%2C%20ad%20esempio%2C%20scrivere%20poche%20righe%20di%20codice%2C%20sfruttando%20anche%20qualche%20%22funzioncina%22%20jQuer" 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=Creare%20un%20semplice%20Feed%20Reader%20con%20SimplePie%20e%20jQuery%20-%20http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F15%2Fcreare-un-semplice-feed-reader-con-simplepie-e-jquery%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=Creare%20un%20semplice%20Feed%20Reader%20con%20SimplePie%20e%20jQuery&amp;story=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F15%2Fcreare-un-semplice-feed-reader-con-simplepie-e-jquery%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%2F15%2Fcreare-un-semplice-feed-reader-con-simplepie-e-jquery%2F&amp;title=Creare%20un%20semplice%20Feed%20Reader%20con%20SimplePie%20e%20jQuery" 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=Creare%20un%20semplice%20Feed%20Reader%20con%20SimplePie%20e%20jQuery&amp;body=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F15%2Fcreare-un-semplice-feed-reader-con-simplepie-e-jquery%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=Creare%20un%20semplice%20Feed%20Reader%20con%20SimplePie%20e%20jQuery&amp;link=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F15%2Fcreare-un-semplice-feed-reader-con-simplepie-e-jquery%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%2F15%2Fcreare-un-semplice-feed-reader-con-simplepie-e-jquery%2F&amp;headline=Creare%20un%20semplice%20Feed%20Reader%20con%20SimplePie%20e%20jQuery&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%2F15%2Fcreare-un-semplice-feed-reader-con-simplepie-e-jquery%2F&amp;title=Creare%20un%20semplice%20Feed%20Reader%20con%20SimplePie%20e%20jQuery&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=SimplePie%20%C3%A8%20una%20libreria%20PHP%20in%20grado%20di%20semplificare%20notevolmente%20il%20recupero%20e%20la%20manipolazione%20di%20Feed%20RSS%20o%2C%20pi%C3%B9%20in%20generale%2C%20di%20formati%20XML.%20%C3%88%20possibile%2C%20ad%20esempio%2C%20scrivere%20poche%20righe%20di%20codice%2C%20sfruttando%20anche%20qualche%20%22funzioncina%22%20jQuer" 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%2F15%2Fcreare-un-semplice-feed-reader-con-simplepie-e-jquery%2F&amp;title=Creare%20un%20semplice%20Feed%20Reader%20con%20SimplePie%20e%20jQuery" 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%2F15%2Fcreare-un-semplice-feed-reader-con-simplepie-e-jquery%2F&amp;t=Creare%20un%20semplice%20Feed%20Reader%20con%20SimplePie%20e%20jQuery" 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=Creare%20un%20semplice%20Feed%20Reader%20con%20SimplePie%20e%20jQuery&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F15%2Fcreare-un-semplice-feed-reader-con-simplepie-e-jquery%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%2F15%2Fcreare-un-semplice-feed-reader-con-simplepie-e-jquery%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%2F15%2Fcreare-un-semplice-feed-reader-con-simplepie-e-jquery%2F&amp;title=Creare%20un%20semplice%20Feed%20Reader%20con%20SimplePie%20e%20jQuery" 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%2F15%2Fcreare-un-semplice-feed-reader-con-simplepie-e-jquery%2F&amp;title=Creare%20un%20semplice%20Feed%20Reader%20con%20SimplePie%20e%20jQuery" 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%2F15%2Fcreare-un-semplice-feed-reader-con-simplepie-e-jquery%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/api/" title="api" rel="tag">api</a>, <a href="http://www.undolog.com/tag/feed/" title="feed" rel="tag">feed</a>, <a href="http://www.undolog.com/tag/google/" title="google" rel="tag">google</a>, <a href="http://www.undolog.com/tag/google-api/" title="Google API" rel="tag">Google API</a>, <a href="http://www.undolog.com/tag/html/" title="HTML" rel="tag">HTML</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/jquery/" title="jQuery" rel="tag">jQuery</a>, <a href="http://www.undolog.com/category/sviluppo/internet/javascript/jquery-javascript-internet-sviluppo/" title="jQuery" rel="tag">jQuery</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/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/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/xml/" title="xml" rel="tag">xml</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<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>
	<li><a href="http://www.undolog.com/2009/01/22/jquery-footer-caption-plugin-aggiungere-didascalie-alle-immagini/" title="jQuery footer caption Plugin: aggiungere didascalie alle immagini (22 gennaio, 2009)">jQuery footer caption Plugin: aggiungere didascalie alle immagini</a> (0)</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>
	<li><a href="http://www.undolog.com/2008/12/22/wordpress-plugin-flash-feed-scroll-reader/" title="Wordpress Plugin: Flash Feed Scroll Reader (22 dicembre, 2008)">Wordpress Plugin: Flash Feed Scroll Reader</a> (7)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2008/12/15/creare-un-semplice-feed-reader-con-simplepie-e-jquery/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How I did it: come creare uno sticker-ribbon in 3 passi</title>
		<link>http://www.undolog.com/2008/12/02/how-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi/</link>
		<comments>http://www.undolog.com/2008/12/02/how-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 23:39:21 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Ribbon]]></category>
		<category><![CDATA[Sticker]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=1004</guid>
		<description><![CDATA[Gli sticker (o ribbon) sono quelle immagini che vengono posizionate in alto a destra, o in alto a sinistra, ed hanno comunemente una forma angolare a fascia. Ne esistono di vari tipi, dalle semplici immagini statiche ai più spettacolari filmati Flash. A volte sono costruiti in modo tale da rimanere nella loro posizione anche quando [...]]]></description>
			<content:encoded><![CDATA[<p>Gli sticker (o ribbon) sono quelle immagini che vengono posizionate in alto a destra, o in alto a sinistra, ed hanno comunemente una forma angolare a fascia. Ne esistono di vari tipi, dalle semplici immagini statiche ai più spettacolari filmati Flash. A volte sono costruiti in modo tale da rimanere nella loro posizione anche quando scorriamo il contenuto della finestra del browser.<br />Se non volete affidarvi a servizi come <a title="QuickRibbon.com" href="http://quickribbon.com/" target="_blank">QuickRibbon.com</a>, ma volete costruire un ribbon tutto vostro, ecco 3 semplice passi da seguire.</p>
<h4>1. Creiamo l'immagine</h4>
<p>Prima di tutto creiamo l'immagine che vogliamo posizionare in uno degli angoli destro o sinistro. L'immagine qui sotto, di 163x163 pixel, ecostruita per l'angolo superiore sinistro.</p>
<p class="center"><img height="323" alt="Sticker Ribbon" src="http://www.undolog.com/wp-content/uploads/2008/12/image.png" width="494" border="0"></p>
<p>Per rendere l'effetto di sovrapposizione completo bisogna scegliere, al momento del salvataggio, un formato che supporti la trasparenza, come il GIF o il PNG.</p>
<h4>2. Il codice HTML</h4>
<p>Salvata la nostra immagine possiamo inserirla nella nostra pagina, avvolgendo il tag <code>img</code> con un <code>div</code> contenitore, che useremo puoi per posizionare l'immagine nell'angolo:</p>
<div class="igBar"><span id="lhtml-120"><a href="#" onclick="javascript:showCodeTxt('html-120'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-120">
<div class="html" 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;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Ediv.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ribbon&quot;</span>&gt;&lt;img <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ribbon.gif&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Ribbon Test&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;163&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;163&quot;</span> <span style="color: #000066;">border</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;0&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span>div&gt;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Se il nostro sticker deve possedere un link, possiamo avvalerci del tag <code>map</code> per definire un'area sensibile che non sia rettangolare. Lo sticker presentato in questo esempio, infatti, hai una forma obliqua e la trasparenza ne evidenzia perfettamente i contorni. Sarebbe quindi sconveniente permette di cliccare su un'area vuota aggiungendo semplicemente un tag <code>a</code> introno all'immagine. Usiamo allora questa sintassi:</p>
<div class="igBar"><span id="lhtml-121"><a href="#" onclick="javascript:showCodeTxt('html-121'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-121">
<div class="html" 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;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Ediv.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ribbon&quot;</span>&gt;&lt;img <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ribbon.gif&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Ribbon Test&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;163&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;163&quot;</span> <span style="color: #000066;">border</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">usemap</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#ribbonlink&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span>div&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;"><span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Emap.html"><span style="color: #000000; font-weight: bold;">&lt;map</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ribbonlink&quot;</span>&gt;&lt;area <span style="color: #000066;">shape</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;poly&quot;</span> <span style="color: #000066;">coords</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;163,0,0,163,0,129,129,0&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://undolog.com&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span>map&gt;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>L'attributo <code>coords</code> del tag <code>area</code> definisce le coordinate del nostro ribbon.</p>
<h4>3. il codice CSS</h4>
<p>Aggiungiamo adesso le definizioni degli stili che permetteranno al nostro sticker di posizionarsi sulla pagina in modo corretto:</p>
<div class="igBar"><span id="lcss-122"><a href="#" onclick="javascript:showCodeTxt('css-122'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-122">
<div class="css" 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;">div.ribbon<span style="color: #00AA00;">&#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: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</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; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>left<span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">163px</span><span style="color: #00AA00;">;</span>width<span style="color: #00AA00;">:</span><span style="color: #933;">163px</span><span style="color: #00AA00;">;</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; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #00AA00;">;</span>padding<span style="color: #00AA00;">:</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">visible</span><span style="color: #00AA00;">;</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; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span>10000<span style="color: #00AA00;">&#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;">div.ribbonimg<span style="color: #00AA00;">&#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: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #00AA00;">;</span>padding<span style="color: #00AA00;">:</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #00AA00;">;</span>margin<span style="color: #00AA00;">:</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #00AA00;">;</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; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Se vogliamo che il ribbon rimanga "appiccicato" al video, anche se scorriamo la finestra, basta modificare il tipo <code>absolute</code> dello stile <code>position</code> in <code>fixed</code>:</p>
<div class="igBar"><span id="lcss-123"><a href="#" onclick="javascript:showCodeTxt('css-123'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-123">
<div class="css" 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;">div.ribbon<span style="color: #00AA00;">&#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: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">fixed</span><span style="color: #00AA00;">;</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; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>left<span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">163px</span><span style="color: #00AA00;">;</span>width<span style="color: #00AA00;">:</span><span style="color: #933;">163px</span><span style="color: #00AA00;">;</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; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #00AA00;">;</span>padding<span style="color: #00AA00;">:</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">visible</span><span style="color: #00AA00;">;</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; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span></div>
</li>
<li style="font-weight: 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; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;color:#800000;">10000</span><span style="color: #00AA00;">&#125;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<blockquote><p><strong>Nota</strong>: il tipo <code>fixed</code>, nello stile <code>position</code>, fino a poco tempo fa non era supportato da tutti i browser. Per rendere l'effetto, infatti, si era costretti ad usare una funzione Javascript che, ad intervalli regolari, controllava l'eventuale scorrimento del contenuto della finestra e riposizionava il ribbon in modo che desse l'impressione di rimanere sostanzialmente immobile. Fortunatamente, oggi, a parte qualche obsoleta versione di Explorer, tutti i browser supportano il tipo <code>fixed</code>.</p>
</blockquote>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F02%2Fhow-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi%2F&amp;title=How%20I%20did%20it%3A%20come%20creare%20uno%20sticker-ribbon%20in%203%20passi&amp;bodytext=Gli%20sticker%20%28o%20ribbon%29%20sono%20quelle%20immagini%20che%20vengono%20posizionate%20in%20alto%20a%20destra%2C%20o%20in%20alto%20a%20sinistra%2C%20ed%20hanno%20comunemente%20una%20forma%20angolare%20a%20fascia.%20Ne%20esistono%20di%20vari%20tipi%2C%20dalle%20semplici%20immagini%20statiche%20ai%20pi%C3%B9%20spettacolari%20filmati%20Flas" 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%2F02%2Fhow-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi%2F&amp;title=How%20I%20did%20it%3A%20come%20creare%20uno%20sticker-ribbon%20in%203%20passi&amp;notes=Gli%20sticker%20%28o%20ribbon%29%20sono%20quelle%20immagini%20che%20vengono%20posizionate%20in%20alto%20a%20destra%2C%20o%20in%20alto%20a%20sinistra%2C%20ed%20hanno%20comunemente%20una%20forma%20angolare%20a%20fascia.%20Ne%20esistono%20di%20vari%20tipi%2C%20dalle%20semplici%20immagini%20statiche%20ai%20pi%C3%B9%20spettacolari%20filmati%20Flas" 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%2F02%2Fhow-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi%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%2F02%2Fhow-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi%2F&amp;t=How%20I%20did%20it%3A%20come%20creare%20uno%20sticker-ribbon%20in%203%20passi" 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%2F02%2Fhow-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi%2F&amp;title=How%20I%20did%20it%3A%20come%20creare%20uno%20sticker-ribbon%20in%203%20passi&amp;annotation=Gli%20sticker%20%28o%20ribbon%29%20sono%20quelle%20immagini%20che%20vengono%20posizionate%20in%20alto%20a%20destra%2C%20o%20in%20alto%20a%20sinistra%2C%20ed%20hanno%20comunemente%20una%20forma%20angolare%20a%20fascia.%20Ne%20esistono%20di%20vari%20tipi%2C%20dalle%20semplici%20immagini%20statiche%20ai%20pi%C3%B9%20spettacolari%20filmati%20Flas" 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=How%20I%20did%20it%3A%20come%20creare%20uno%20sticker-ribbon%20in%203%20passi%20-%20http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F02%2Fhow-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi%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=How%20I%20did%20it%3A%20come%20creare%20uno%20sticker-ribbon%20in%203%20passi&amp;story=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F02%2Fhow-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi%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%2F02%2Fhow-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi%2F&amp;title=How%20I%20did%20it%3A%20come%20creare%20uno%20sticker-ribbon%20in%203%20passi" 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=How%20I%20did%20it%3A%20come%20creare%20uno%20sticker-ribbon%20in%203%20passi&amp;body=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F02%2Fhow-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi%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=How%20I%20did%20it%3A%20come%20creare%20uno%20sticker-ribbon%20in%203%20passi&amp;link=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F02%2Fhow-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi%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%2F02%2Fhow-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi%2F&amp;headline=How%20I%20did%20it%3A%20come%20creare%20uno%20sticker-ribbon%20in%203%20passi&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%2F02%2Fhow-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi%2F&amp;title=How%20I%20did%20it%3A%20come%20creare%20uno%20sticker-ribbon%20in%203%20passi&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Gli%20sticker%20%28o%20ribbon%29%20sono%20quelle%20immagini%20che%20vengono%20posizionate%20in%20alto%20a%20destra%2C%20o%20in%20alto%20a%20sinistra%2C%20ed%20hanno%20comunemente%20una%20forma%20angolare%20a%20fascia.%20Ne%20esistono%20di%20vari%20tipi%2C%20dalle%20semplici%20immagini%20statiche%20ai%20pi%C3%B9%20spettacolari%20filmati%20Flas" 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%2F02%2Fhow-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi%2F&amp;title=How%20I%20did%20it%3A%20come%20creare%20uno%20sticker-ribbon%20in%203%20passi" 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%2F02%2Fhow-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi%2F&amp;t=How%20I%20did%20it%3A%20come%20creare%20uno%20sticker-ribbon%20in%203%20passi" 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=How%20I%20did%20it%3A%20come%20creare%20uno%20sticker-ribbon%20in%203%20passi&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F12%2F02%2Fhow-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi%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%2F02%2Fhow-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi%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%2F02%2Fhow-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi%2F&amp;title=How%20I%20did%20it%3A%20come%20creare%20uno%20sticker-ribbon%20in%203%20passi" 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%2F02%2Fhow-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi%2F&amp;title=How%20I%20did%20it%3A%20come%20creare%20uno%20sticker-ribbon%20in%203%20passi" 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%2F02%2Fhow-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi%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/browser/" title="browser" rel="tag">browser</a>, <a href="http://www.undolog.com/category/sviluppo/internet/css/" title="CSS" rel="tag">CSS</a>, <a href="http://www.undolog.com/tag/css/" title="CSS" rel="tag">CSS</a>, <a href="http://www.undolog.com/tag/html/" title="HTML" rel="tag">HTML</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/ribbon/" title="Ribbon" rel="tag">Ribbon</a>, <a href="http://www.undolog.com/tag/sticker/" title="Sticker" rel="tag">Sticker</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/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/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/2008/10/30/jquery-bordi-rotondi-sulle-immagini-per-sovrapposizione/" title="jQuery: bordi rotondi sulle immagini per sovrapposizione (30 ottobre, 2008)">jQuery: bordi rotondi sulle immagini per sovrapposizione</a> (1)</li>
	<li><a href="http://www.undolog.com/2008/12/04/very-short-trick-come-centrare-elementi-sulla-pagina-anche-su-ie5/" title="Very short trick: come centrare elementi sulla pagina, anche su IE5 (4 dicembre, 2008)">Very short trick: come centrare elementi sulla pagina, anche su IE5</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>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2008/12/02/how-i-did-it-come-creare-uno-sticker-ribbon-in-3-passi/feed/</wfw:commentRss>
		<slash:comments>2</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-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: #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-135"><a href="#" onclick="javascript:showCodeTxt('actionscript3-135'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-135">
<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-136"><a href="#" onclick="javascript:showCodeTxt('actionscript3-136'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-136">
<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-137"><a href="#" onclick="javascript:showCodeTxt('actionscript3-137'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-137">
<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-138"><a href="#" onclick="javascript:showCodeTxt('actionscript3-138'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-138">
<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-139"><a href="#" onclick="javascript:showCodeTxt('actionscript3-139'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-139">
<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-140"><a href="#" onclick="javascript:showCodeTxt('actionscript3-140'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-140">
<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-141"><a href="#" onclick="javascript:showCodeTxt('actionscript3-141'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-141">
<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-142"><a href="#" onclick="javascript:showCodeTxt('actionscript3-142'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-142">
<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-143"><a href="#" onclick="javascript:showCodeTxt('actionscript3-143'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript3-143">
<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>Wordpress: rimuovere i menu dell&#8217;amministrazione</title>
		<link>http://www.undolog.com/2008/11/01/wordpress-rimuovere-i-menu-dellamministrazione/</link>
		<comments>http://www.undolog.com/2008/11/01/wordpress-rimuovere-i-menu-dellamministrazione/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 14:48:48 +0000</pubDate>
		<dc:creator>Giovambattista Fazioli</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Sviluppo]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[add_action()]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[Menu]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Plugins]]></category>

		<guid isPermaLink="false">http://www.undolog.com/?p=831</guid>
		<description><![CDATA[Può risultare utile, a volte, "oscurare" alcuni menu dell'amministrazione di Wordpress, soprattutto se si è sviluppato un sito/blog per un cliente e non si vuole permettere l'accesso a funzionalità particolarmente delicate. Esistono Plugin che svolgono questa già funzione ma, per avere un controllo personale e completo, vediamo come funziona in dettaglio questa caratteristica.
Come sempre sfruttiamo [...]]]></description>
			<content:encoded><![CDATA[<p>Può risultare utile, a volte, "oscurare" alcuni menu dell'amministrazione di Wordpress, soprattutto se si è sviluppato un sito/blog per un cliente e non si vuole permettere l'accesso a funzionalità particolarmente delicate. Esistono Plugin che svolgono questa già funzione ma, per avere un controllo personale e completo, vediamo come funziona in dettaglio questa caratteristica.<br />
Come sempre sfruttiamo le utilissime Action messe a disposizione da Wordpress, in questo caso <code>admin_menu</code>. Tramite la variabile globale <code>$menu</code> possiamo accedere alla lista dei menu dell'amministrazione. Possiamo individuare il menu da "eliminare" in due modi: tramite l'etichetta o tramite il link a cui punta (vedi parti commentati nell'esempio qui sotto). Nell'esempio proposto vengono "oscurate" le voci di menu Design, Impostazioni e Plugins:</p>
<div class="igBar"><span id="lphp-145"><a href="#" onclick="javascript:showCodeTxt('php-145'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-145">
<div class="php" 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: #000000; font-weight: bold;">function</span> remove_menu_item<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;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">global</span> &nbsp;<span style="color: #000088;">$menu</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;">&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// tramite label</span></div>
</li>
<li style="font-weight: 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: #000088;">$removes</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Design'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Impostazioni'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Plugins'</span> <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;">&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// tramite link</span></div>
</li>
<li style="font-weight: 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: #666666; font-style: italic;">// $removes = array( 'themes.php', 'options-general.php', 'plugins.php' );</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: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$removes</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$todel</span> <span style="color: #009900;">&#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; <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$menu</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$sm</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sm</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$todel</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$menu</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#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: #666666; font-style: italic;">// tramite link</span></div>
</li>
<li style="font-weight: 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: #666666; font-style: italic;">// foreach($menu as $key =&gt; $sm) if($sm[2] == $todel ) { unset( $menu[$key] ); break; } &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: #009900;">&#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: #666666; 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;">add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin_menu'</span><span style="color: #339933;">,</span> &nbsp; &nbsp;<span style="color: #0000ff;">'remove_menu_item'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>L'uso del link come chiave per la rimozione (<code>$sm[2]</code> nelle parti commentate nel codice qui sorpra), è utile quando non si ha certezza della lingua - localizzazione - con cui è stato installato Wordpress. Con questa tecnica, tuttavia, <strong>il menu è rimosso solo a livello di interfaccia</strong>, quindi sarà possibile ancora accedere alla pagina tramite una link diretto.</p>




	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F01%2Fwordpress-rimuovere-i-menu-dellamministrazione%2F&amp;title=Wordpress%3A%20rimuovere%20i%20menu%20dell%27amministrazione%20&amp;bodytext=Pu%C3%B2%20risultare%20utile%2C%20a%20volte%2C%20%22oscurare%22%20alcuni%20menu%20dell%27amministrazione%20di%20Wordpress%2C%20soprattutto%20se%20si%20%C3%A8%20sviluppato%20un%20sito%2Fblog%20per%20un%20cliente%20e%20non%20si%20vuole%20permettere%20l%27accesso%20a%20funzionalit%C3%A0%20particolarmente%20delicate.%20Esistono%20Plugin%20che%20svo" 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%2F01%2Fwordpress-rimuovere-i-menu-dellamministrazione%2F&amp;title=Wordpress%3A%20rimuovere%20i%20menu%20dell%27amministrazione%20&amp;notes=Pu%C3%B2%20risultare%20utile%2C%20a%20volte%2C%20%22oscurare%22%20alcuni%20menu%20dell%27amministrazione%20di%20Wordpress%2C%20soprattutto%20se%20si%20%C3%A8%20sviluppato%20un%20sito%2Fblog%20per%20un%20cliente%20e%20non%20si%20vuole%20permettere%20l%27accesso%20a%20funzionalit%C3%A0%20particolarmente%20delicate.%20Esistono%20Plugin%20che%20svo" 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%2F01%2Fwordpress-rimuovere-i-menu-dellamministrazione%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%2F01%2Fwordpress-rimuovere-i-menu-dellamministrazione%2F&amp;t=Wordpress%3A%20rimuovere%20i%20menu%20dell%27amministrazione%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%2F2008%2F11%2F01%2Fwordpress-rimuovere-i-menu-dellamministrazione%2F&amp;title=Wordpress%3A%20rimuovere%20i%20menu%20dell%27amministrazione%20&amp;annotation=Pu%C3%B2%20risultare%20utile%2C%20a%20volte%2C%20%22oscurare%22%20alcuni%20menu%20dell%27amministrazione%20di%20Wordpress%2C%20soprattutto%20se%20si%20%C3%A8%20sviluppato%20un%20sito%2Fblog%20per%20un%20cliente%20e%20non%20si%20vuole%20permettere%20l%27accesso%20a%20funzionalit%C3%A0%20particolarmente%20delicate.%20Esistono%20Plugin%20che%20svo" 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%3A%20rimuovere%20i%20menu%20dell%27amministrazione%20%20-%20http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F01%2Fwordpress-rimuovere-i-menu-dellamministrazione%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%3A%20rimuovere%20i%20menu%20dell%27amministrazione%20&amp;story=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F01%2Fwordpress-rimuovere-i-menu-dellamministrazione%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%2F01%2Fwordpress-rimuovere-i-menu-dellamministrazione%2F&amp;title=Wordpress%3A%20rimuovere%20i%20menu%20dell%27amministrazione%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=Wordpress%3A%20rimuovere%20i%20menu%20dell%27amministrazione%20&amp;body=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F01%2Fwordpress-rimuovere-i-menu-dellamministrazione%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%3A%20rimuovere%20i%20menu%20dell%27amministrazione%20&amp;link=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F01%2Fwordpress-rimuovere-i-menu-dellamministrazione%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%2F01%2Fwordpress-rimuovere-i-menu-dellamministrazione%2F&amp;headline=Wordpress%3A%20rimuovere%20i%20menu%20dell%27amministrazione%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%2F2008%2F11%2F01%2Fwordpress-rimuovere-i-menu-dellamministrazione%2F&amp;title=Wordpress%3A%20rimuovere%20i%20menu%20dell%27amministrazione%20&amp;source=Undolog.com+Research+%26amp%3B+Development++Blog&amp;summary=Pu%C3%B2%20risultare%20utile%2C%20a%20volte%2C%20%22oscurare%22%20alcuni%20menu%20dell%27amministrazione%20di%20Wordpress%2C%20soprattutto%20se%20si%20%C3%A8%20sviluppato%20un%20sito%2Fblog%20per%20un%20cliente%20e%20non%20si%20vuole%20permettere%20l%27accesso%20a%20funzionalit%C3%A0%20particolarmente%20delicate.%20Esistono%20Plugin%20che%20svo" 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%2F01%2Fwordpress-rimuovere-i-menu-dellamministrazione%2F&amp;title=Wordpress%3A%20rimuovere%20i%20menu%20dell%27amministrazione%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%2F2008%2F11%2F01%2Fwordpress-rimuovere-i-menu-dellamministrazione%2F&amp;t=Wordpress%3A%20rimuovere%20i%20menu%20dell%27amministrazione%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=Wordpress%3A%20rimuovere%20i%20menu%20dell%27amministrazione%20&amp;url=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F01%2Fwordpress-rimuovere-i-menu-dellamministrazione%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%2F01%2Fwordpress-rimuovere-i-menu-dellamministrazione%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%2F01%2Fwordpress-rimuovere-i-menu-dellamministrazione%2F&amp;title=Wordpress%3A%20rimuovere%20i%20menu%20dell%27amministrazione%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%2F2008%2F11%2F01%2Fwordpress-rimuovere-i-menu-dellamministrazione%2F&amp;title=Wordpress%3A%20rimuovere%20i%20menu%20dell%27amministrazione%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%2F2008%2F11%2F01%2Fwordpress-rimuovere-i-menu-dellamministrazione%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/add_action/" title="add_action()" rel="tag">add_action()</a>, <a href="http://www.undolog.com/tag/blog/" title="blog" rel="tag">blog</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/menu/" title="Menu" rel="tag">Menu</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/plugins/" title="Plugins" rel="tag">Plugins</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/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/10/27/wordpress-scrivere-un-logout-personale/" title="Wordpress: scrivere un logout personale (27 ottobre, 2008)">Wordpress: scrivere un logout personale</a> (2)</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/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>
	<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/2008/10/08/very-short-trick-avoid-error-message-in-php/" title="Very short trick: avoid error message in PHP (8 ottobre, 2008)">Very short trick: avoid error message in PHP</a> (1)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.undolog.com/2008/11/01/wordpress-rimuovere-i-menu-dellamministrazione/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
