<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="http://feeds.feedburner.com/~d/styles/rss2italianfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Undolog.com</title><link>http://www.undolog.com</link><description>Research &amp; Development  Blog</description><language>en</language><generator>http://wordpress.org/?v=2.6</generator><creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/2.0/</creativeCommons:license><image><link>http://creativecommons.org/licenses/by-nc-nd/2.0/</link><url>http://creativecommons.org/images/public/somerights20.gif</url><title>Some Rights Reserved</title></image><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/undolog" type="application/rss+xml" /><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Fundolog" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/undolog" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fundolog" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fundolog" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Fundolog" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://add.my.yahoo.com/content?lg=it&amp;url=http%3A%2F%2Ffeeds.feedburner.com%2Fundolog" src="http://eur.i1.yimg.com/eur.yimg.com/i/it/my/mioya1.gif">Subscribe with Mio Yahoo!</feedburner:feedFlare><item><title>Very short snippet: Wordpress, separare le categorie in due colonne</title><link>http://feeds.feedburner.com/~r/undolog/~3/457949876/</link><category>CSS</category><category>Internet</category><category>PHP</category><category>Sviluppo</category><category>WordPress</category><category>Categorie</category><category>Codice</category><category>Snipp</category><category>Snippets</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Giovambattista Fazioli</dc:creator><pubDate>Tue, 18 Nov 2008 22:00:27 -0600</pubDate><guid isPermaLink="false">http://www.undolog.com/?p=975</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Prendendo spunto da <em><a target="_blank" href="http://www.geeksource.eu/Blog/2008/11/18/wordpress-hack-2-separare-le-categorie-in-colonne-nella-sidebar/">Wordpress Hack #2 - Separare le categorie in colonne nella sidebar</a></em> può tornare utile "spezzare" in due colonne la lista delle categorie di Wordpress. Se la sequenza che vogliamo ottenere è da sinistra a destra, cioè cat1 | cat2 (a capo) cat3 | cat4 (a capo) etc... non è necessario usare un codice PHP, ma basta giocare con gli stili impostando il tag <code>li</code> a <code>float:left</code> e "chiudendo" con l'opportuna <code>width</code> il tag <code>ul</code>, in modo a mandare "a capo" il successivo <code>li</code>. Nei casi invece dove il css non arriva, ad esempio nella sequenza cat1 | cat3 (a capo) cat2 | cat4, possiamo usare questo semplice codice:</p>
<div class="igBar"><span id="lphp-2"><a href="#" onclick="javascript:showCodeTxt('php-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-2">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$cats</span>&nbsp; &nbsp; &nbsp; &nbsp;= <a href="http://www.php.net/explode"><span style="color:#000066;">explode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"&lt;br /&gt;"</span>,wp_list_categories<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'title_li=&amp;echo=0&amp;depth=1&amp;style=none'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$middle</span>&nbsp; &nbsp; &nbsp;= <a href="http://www.php.net/round"><span style="color:#000066;">round</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/sizeof"><span style="color:#000066;">sizeof</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$cats</span><span style="color:#006600; font-weight:bold;">&#41;</span>-<span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>/<span style="color:#CC66CC;color:#800000;">2</span> <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$cats_left</span>&nbsp; = <a href="http://www.php.net/array_slice"><span style="color:#000066;">array_slice</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$cats</span>, <span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#0000FF;">$middle</span> <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$cats_right</span> = <a href="http://www.php.net/array_slice"><span style="color:#000066;">array_slice</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$cats</span>, <span style="color:#0000FF;">$middle</span>, -<span style="color:#CC66CC;color:#800000;">1</span> <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;ul class=&quot;left&quot;&gt;&lt;li&gt;'</span>.<a href="http://www.php.net/implode"><span style="color:#000066;">implode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'&lt;/li&gt;&lt;li&gt;'</span>, <span style="color:#0000FF;">$cats_left</span> <span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#FF0000;">'&lt;/li&gt;&lt;/ul&gt;'</span>.</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color:#FF0000;">'&lt;ul class=&quot;right&quot;&gt;&lt;li&gt;'</span>.<a href="http://www.php.net/implode"><span style="color:#000066;">implode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'&lt;/li&gt;&lt;li&gt;'</span>, <span style="color:#0000FF;">$cats_right</span> <span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#FF0000;">'&lt;/li&gt;&lt;/ul&gt;'</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>

	Tags: <a href="http://www.undolog.com/tag/categorie/" title="Categorie" rel="tag">Categorie</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/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/snipp/" title="Snipp" rel="tag">Snipp</a>, <a href="http://www.undolog.com/tag/snippets/" title="Snippets" rel="tag">Snippets</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</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/11/03/very-short-snippet-wordpress-administrator/" title="Very short snippet: Wordpress administrator? (3 Novembre, 2008)">Very short snippet: Wordpress administrator?</a> (0)</li>
	<li><a href="http://www.undolog.com/2008/04/26/snipplr-code-20-frammenti-snipp-di-codice-utile/" title="Snipplr code 2.0: frammenti (snipp) di codice utile (26 Aprile, 2008)">Snipplr code 2.0: frammenti (snipp) di codice utile</a> (0)</li>
	<li><a href="http://www.undolog.com/2008/10/27/wordpress-scrivere-un-logout-personale/" title="Wordpress: scrivere un logout personale (27 Ottobre, 2008)">Wordpress: scrivere un logout personale</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> (2)</li>
</ul>


<p><a href="http://feeds.feedburner.com/~a/undolog?a=psh1Hw"><img src="http://feeds.feedburner.com/~a/undolog?i=psh1Hw" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/undolog/~4/457949876" height="1" width="1"/>]]></content:encoded><description>Prendendo spunto da Wordpress Hack #2 - Separare le categorie in colonne nella sidebar può tornare utile "spezzare" in due colonne la lista delle categorie di Wordpress. Se la sequenza che vogliamo ottenere è da sinistra a destra, cioè cat1 &amp;#124; cat2 (a capo) cat3 &amp;#124; cat4 (a capo) etc... non è necessario usare un [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.undolog.com/2008/11/19/very-short-snippet-wordpress-separare-le-categorie-in-due-colonne/feed/</wfw:commentRss><feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=undolog&amp;itemurl=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F19%2Fvery-short-snippet-wordpress-separare-le-categorie-in-due-colonne%2F</feedburner:awareness><feedburner:origLink>http://www.undolog.com/2008/11/19/very-short-snippet-wordpress-separare-le-categorie-in-due-colonne/</feedburner:origLink></item><item><title>Adobe AIR e le API di Feedburner: reloaded</title><link>http://feeds.feedburner.com/~r/undolog/~3/457141655/</link><category>AIR</category><category>Actionscript 3.0</category><category>Flash CS3</category><category>Internet</category><category>Sviluppo</category><category>Tutorials</category><category>addEventListener</category><category>Adobe</category><category>Adobe-AIR</category><category>api</category><category>catch</category><category>feed</category><category>Flash</category><category>Flex</category><category>google</category><category>Google Code</category><category>MouseEvent</category><category>package</category><category>REST</category><category>Tecnologia</category><category>try</category><category>Tutorial</category><category>URLLoader</category><category>URLRequest</category><category>URLVariables</category><category>xml</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Giovambattista Fazioli</dc:creator><pubDate>Tue, 18 Nov 2008 06:47:26 -0600</pubDate><guid isPermaLink="false">http://www.undolog.com/?p=968</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![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="lactionscript-4"><a href="#" onclick="javascript:showCodeTxt('actionscript-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-4">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">package <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp;* Class Document for FeedBurner Adobe AIR version</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&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-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp;*</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp;* @author&nbsp; &nbsp; &nbsp; &nbsp; Giovambattista Fazioli</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp;* @email&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;g.fazioli@undolog.com</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp;* @web&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;http://www.undolog.com</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp;*</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp;* CHANGE LOG</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp;*</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp;* ver 0.8</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp;*&nbsp; &nbsp; - First Adobe AIR release</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp;*</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp;*/</span>&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.*;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">text</span>.*;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.*;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #006600;">URLLoader</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #006600;">URLRequestMethod</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #006600;">URLLoaderDataFormat</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #006600;">URLRequest</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #006600;">URLVariables</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> FeedBurner <span style="color: #0066CC;">extends</span> <span style="color: #0066CC;">MovieClip</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> const FEEDBURNER_API&nbsp; &nbsp; &nbsp; &nbsp; :<span style="color: #0066CC;">String</span>&nbsp; &nbsp; &nbsp; &nbsp; = <span style="color: #ff0000;">'http://api.feedburner.com/awareness/1.0/GetFeedData'</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> FeedBurner<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"construtor::FeedBurner"</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addEventListener<span style="color: #66cc66;">&#40;</span> Event.<span style="color: #006600;">ADDED_TO_STAGE</span>, init <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>:Event = <span style="color: #000000; font-weight: bold;">null</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result_txt.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">''</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; feed_url.<span style="color: #0066CC;">text</span>&nbsp; &nbsp; &nbsp;= <span style="color: #ff0000;">'http://www.undolog.com/feed'</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; check_btn.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> MouseEvent.<span style="color: #006600;">CLICK</span>, checkFeedBurnerReaders <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> checkFeedBurnerReaders<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:MouseEvent = <span style="color: #000000; font-weight: bold;">null</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">"FeedBurner::checkFeedBurnerReaders()"</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> loader&nbsp; &nbsp; &nbsp; &nbsp; :URLLoader&nbsp; &nbsp; &nbsp; = <span style="color: #000000; font-weight: bold;">new</span> URLLoader<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> urlreq&nbsp; &nbsp; &nbsp; &nbsp; :URLRequest&nbsp; &nbsp; &nbsp;= <span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> param&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:URLVariables&nbsp; &nbsp;= <span style="color: #000000; font-weight: bold;">new</span> URLVariables<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; param.<span style="color: #006600;">uri</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= feed_url.<span style="color: #0066CC;">text</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; urlreq.<span style="color: #0066CC;">url</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = FEEDBURNER_API;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; urlreq.<span style="color: #006600;">method</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= URLRequestMethod.<span style="color: #0066CC;">GET</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; urlreq.<span style="color: #0066CC;">data</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= param;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//&nbsp; &nbsp; </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loader.<span style="color: #006600;">dataFormat</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= URLLoaderDataFormat.<span style="color: #0066CC;">TEXT</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loader.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>, completeHandler<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">try</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loader.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span>urlreq<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #0066CC;">catch</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">error</span>:<span style="color: #0066CC;">Error</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"Errore nel caricamento dell' URL"</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span> completeHandler<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//&lt;rsp stat=&quot;ok&quot;&gt;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//&nbsp; &lt;feed id=&quot;651641&quot; uri=&quot;undolog&quot;&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; 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;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//&nbsp; &lt;/feed&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//&lt;/rsp&gt;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> x_xml&nbsp; &nbsp; :<span style="color: #0066CC;">XML</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= <span style="color: #0066CC;">XML</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> x_xml.@stat == <span style="color: #ff0000;">'ok'</span> <span style="color: #66cc66;">&#41;</span> result_txt.<span style="color: #0066CC;">text</span> = x_xml.<span style="color: #006600;">feed</span>.<span style="color: #006600;">entry</span>.@circulation.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> result_txt.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">'0'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#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>

	Tags: <a href="http://www.undolog.com/category/sviluppo/flash-cs3/actionscript-30/" title="Actionscript 3.0" rel="tag">Actionscript 3.0</a>, <a href="http://www.undolog.com/tag/addeventlistener/" title="addEventListener" rel="tag">addEventListener</a>, <a href="http://www.undolog.com/tag/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/tag/tutorial/" title="Tutorial" rel="tag">Tutorial</a>, <a href="http://www.undolog.com/category/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/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>
	<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/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>
</ul>


<p><a href="http://feeds.feedburner.com/~a/undolog?a=Qg8o9T"><img src="http://feeds.feedburner.com/~a/undolog?i=Qg8o9T" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/undolog/~4/457141655" height="1" width="1"/>]]></content:encoded><description>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><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.undolog.com/2008/11/18/adobe-air-e-le-api-di-feedburner-reloaded/feed/</wfw:commentRss><feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=undolog&amp;itemurl=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F18%2Fadobe-air-e-le-api-di-feedburner-reloaded%2F</feedburner:awareness><feedburner:origLink>http://www.undolog.com/2008/11/18/adobe-air-e-le-api-di-feedburner-reloaded/</feedburner:origLink></item><item><title>Very short trick: 3 output function in PHP</title><link>http://feeds.feedburner.com/~r/undolog/~3/456491609/</link><category>Internet</category><category>PHP</category><category>Sviluppo</category><category>echo</category><category>tips-&amp;amp;-tricks</category><category>trick</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Giovambattista Fazioli</dc:creator><pubDate>Mon, 17 Nov 2008 16:34:56 -0600</pubDate><guid isPermaLink="false">http://www.undolog.com/?p=962</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>All'interno di una funzione PHP è possibile stampare in tre modi diversi:</p>
<div class="igBar"><span id="lphp-8"><a href="#" onclick="javascript:showCodeTxt('php-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-8">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> miaFunction<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$valore</span> = <span style="color:#FF0000;">'Ciao'</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;ul&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;!-- &lt;li&gt;&lt;?php <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$valore</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span> --&gt;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;li&gt;&lt;?=<span style="color:#0000FF;">$valore</span>?&gt;&lt;/li&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/ul&gt;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Oppure:</p>
<div class="igBar"><span id="lphp-9"><a href="#" onclick="javascript:showCodeTxt('php-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-9">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> miaFunction<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$valore</span> = <span style="color:#FF0000;">'Ciao'</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$o</span> = <span style="color:#FF0000;">'&lt;ul&gt;&lt;li&gt;'</span>.<span style="color:#0000FF;">$valore</span>.<span style="color:#FF0000;">'&lt;/li&gt;&lt;/ul&gt;'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$o</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Oppure:</p>
<div class="igBar"><span id="lphp-10"><a href="#" onclick="javascript:showCodeTxt('php-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-10">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> miaFunction<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$valore</span> = <span style="color:#FF0000;">'Ciao'</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$o</span> = <span style="color:#FF0000;">"&lt;ul&gt;&lt;li&gt;$valore&lt;/li&gt;&lt;/ul&gt;"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$o</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>

	Tags: <a href="http://www.undolog.com/tag/echo/" title="echo" rel="tag">echo</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/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/tag/tips-tricks/" title="tips-&amp;-tricks" rel="tag">tips-&amp;-tricks</a>, <a href="http://www.undolog.com/tag/trick/" title="trick" rel="tag">trick</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<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/22/very-short-trick-valori-undefined-in-javascript/" title="Very short trick: valori undefined in Javascript (22 Ottobre, 2008)">Very short trick: valori undefined in Javascript</a> (0)</li>
	<li><a href="http://www.undolog.com/2007/07/20/flash-loadvars-e-xml-per-inviare-dati-in-post/" title="Flash: LoadVars e XML per inviare dati in POST (20 Luglio, 2007)">Flash: LoadVars e XML per inviare dati in POST</a> (0)</li>
	<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> (1)</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> (5)</li>
</ul>


<p><a href="http://feeds.feedburner.com/~a/undolog?a=r6G6Do"><img src="http://feeds.feedburner.com/~a/undolog?i=r6G6Do" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/undolog/~4/456491609" height="1" width="1"/>]]></content:encoded><description>All'interno di una funzione PHP è possibile stampare in tre modi diversi:
PLAIN TEXT
PHP:




&amp;#60;?php


function miaFunction&amp;#40; $valore = 'Ciao' &amp;#41; &amp;#123;


?&amp;#62;


&amp;#60;ul&amp;#62;


&amp;#160; &amp;#60;!-- &amp;#60;li&amp;#62;&amp;#60;?php echo $valore; ?&amp;#62; --&amp;#62;


&amp;#160; &amp;#60;li&amp;#62;&amp;#60;?=$valore?&amp;#62;&amp;#60;/li&amp;#62;


&amp;#60;/ul&amp;#62;


&amp;#60;?php


&amp;#125;


?&amp;#62; 






Oppure:
PLAIN TEXT
PHP:




function miaFunction&amp;#40; $valore = 'Ciao' &amp;#41; &amp;#123;


&amp;#160; &amp;#160; $o = '&amp;#60;ul&amp;#62;&amp;#60;li&amp;#62;'.$valore.'&amp;#60;/li&amp;#62;&amp;#60;/ul&amp;#62;';


&amp;#160; &amp;#160; echo $o;


&amp;#125; 






Oppure:
PLAIN TEXT
PHP:




function miaFunction&amp;#40; $valore = 'Ciao' &amp;#41; &amp;#123;


&amp;#160; &amp;#160; $o = "&amp;#60;ul&amp;#62;&amp;#60;li&amp;#62;$valore&amp;#60;/li&amp;#62;&amp;#60;/ul&amp;#62;";


&amp;#160; &amp;#160; echo [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.undolog.com/2008/11/18/very-short-trick-3-output-function-in-php/feed/</wfw:commentRss><feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=undolog&amp;itemurl=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F18%2Fvery-short-trick-3-output-function-in-php%2F</feedburner:awareness><feedburner:origLink>http://www.undolog.com/2008/11/18/very-short-trick-3-output-function-in-php/</feedburner:origLink></item><item><title>SWFObject su Google AJAX Libraries API</title><link>http://feeds.feedburner.com/~r/undolog/~3/452794898/</link><category>Flash</category><category>Internet</category><category>Javascript</category><category>Sviluppo</category><category>google</category><category>Google AJAX Libraries API</category><category>HTML</category><category>librerie</category><category>SWFObject</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Giovambattista Fazioli</dc:creator><pubDate>Fri, 14 Nov 2008 04:24:02 -0600</pubDate><guid isPermaLink="false">http://www.undolog.com/?p=955</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p><a target="_blank" href="http://code.google.com/p/swfobject/" title="swfobject 2.0"><img border="0" align="left" alt="swfobject" src="http://www.undolog.com/wp-content/uploads/2008/03/image33.png" style="border-width: 0px; margin: 0px 10px 0px 0px;"/></a><a target="_blank" href="http://code.google.com/apis/ajaxlibs/">Google AJAX Libraries API</a> allarga il suo parco di librerie e framework anche a <a href="http://www.undolog.com/2008/03/25/unobtrusive-swfobject-20/">SWFObject</a>, utilissima per inserire e manipolare filmati Flash sulle nostre pagine Web. <a href="http://www.undolog.com/2008/03/25/unobtrusive-swfobject-20/">SWFObject</a> è anche disponibile come <a href="http://blog.unijimpe.net/wp-swfobject-20/" target="_blank">Plugin per Wordpress</a>; nel momento in cui scrivo, tuttavia, il Plugin non è stato ancora aggiornato per caricare il codice dal "repository" Google. A breve, quindi, immagino verrà rilasciata anche una nuova versione del Plugin... a meno che non vogliate intanto modificarlo da soli...</p>
<h4>Includere SWFObject da Google AJAX Libraries API</h4>
<p>Come per le altre librerie presenti in <a target="_blank" href="http://code.google.com/apis/ajaxlibs/">Google AJAX Libraries API</a> è possibile usare l'URL assoluto o il meotdo <code>google.load()</code>:</p>
<div class="igBar"><span id="lhtml-13"><a href="#" onclick="javascript:showCodeTxt('html-13'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-13">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- URL ASSOLUTO --&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/javascript"</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/javascript"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; swfobject.embedSWF(&quot;main.swf&quot;, &quot;main&quot;, &quot;231&quot;, &quot;132&quot;, &quot;8.0.0&quot;);</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="lhtml-14"><a href="#" onclick="javascript:showCodeTxt('html-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-14">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- google.load() --&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"http://www.google.com/jsapi"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; google.load(&quot;swfobject&quot;, &quot;2.1&quot;);</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; google.setOnLoadCallback(function() {</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; swfobject.embedSWF(&quot;main.swf&quot;, &quot;main&quot;, &quot;231&quot;, &quot;132&quot;, &quot;8.0.0&quot;);</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; });</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>

	Tags: <a href="http://www.undolog.com/category/sviluppo/flash/" title="Flash" rel="tag">Flash</a>, <a href="http://www.undolog.com/tag/flash/" title="Flash" rel="tag">Flash</a>, <a href="http://www.undolog.com/tag/google/" title="google" rel="tag">google</a>, <a href="http://www.undolog.com/tag/google-ajax-libraries-api/" title="Google AJAX Libraries API" rel="tag">Google AJAX Libraries 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/librerie/" title="librerie" rel="tag">librerie</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</a>, <a href="http://www.undolog.com/tag/swfobject/" title="SWFObject" rel="tag">SWFObject</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> (13)</li>
	<li><a href="http://www.undolog.com/2008/06/25/tecniche-di-text-replacement-in-flash/" title="Tecniche di Text Replacement in Flash (25 Giugno, 2008)">Tecniche di Text Replacement in Flash</a> (0)</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/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/03/25/unobtrusive-swfobject-20/" title="Unobtrusive SWFObject 2.0 (25 Marzo, 2008)">Unobtrusive SWFObject 2.0</a> (2)</li>
</ul>


<p><a href="http://feeds.feedburner.com/~a/undolog?a=eXnDFL"><img src="http://feeds.feedburner.com/~a/undolog?i=eXnDFL" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/undolog/~4/452794898" height="1" width="1"/>]]></content:encoded><description>Google AJAX Libraries API allarga il suo parco di librerie e framework anche a SWFObject, utilissima per inserire e manipolare filmati Flash sulle nostre pagine Web. SWFObject è anche disponibile come Plugin per Wordpress; nel momento in cui scrivo, tuttavia, il Plugin non è stato ancora aggiornato per caricare il codice dal "repository" Google. A [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.undolog.com/2008/11/14/swfobject-su-google-ajax-libraries-api/feed/</wfw:commentRss><feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=undolog&amp;itemurl=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F14%2Fswfobject-su-google-ajax-libraries-api%2F</feedburner:awareness><feedburner:origLink>http://www.undolog.com/2008/11/14/swfobject-su-google-ajax-libraries-api/</feedburner:origLink></item><item><title>Adotta un post</title><link>http://feeds.feedburner.com/~r/undolog/~3/449532336/</link><category>Eventi &amp;amp; Iniziative</category><category>advertising</category><category>Google AdSense</category><category>paypal</category><category>pubblicità</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Giovambattista Fazioli</dc:creator><pubDate>Tue, 11 Nov 2008 06:51:06 -0600</pubDate><guid isPermaLink="false">http://www.undolog.com/?p=951</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="128" alt="Adotta un post" src="http://www.undolog.com/wp-content/uploads/2008/11/alert.png" width="128" align="left" border="0">  Ultimamente ho ricevuto varie richieste relative all'inserimento di banner pubblicitari all'interno di undolog.com. Ho deciso, così, di <a title="Advertising" href="/advertising">formalizzare</a> e rioganizzare gli spazi pubblicitari presenti su questo blog, forse i meno invasivi in circolazione. Nei banner pubblicitari (come Google AdSense) e nelle donazioni tramite PayPal non cerco certo un guadagno extra, tuttavia un blog richiede risorse e qualche aiuto è sempre ben gradito.<br />Comunque sia ho sempre cercato di non "tappezzare" il blog di banner sparsi ovunque e di qualunque genere, mantenendo un layout il più pulito possibile e lasciando l'articolo come elemento centrale.</p>
<p>L'idea che mi è venuta in mente, nel tentativo di trovare il giusto equilibrio tra dei banner sparsi e la possibilità di sponsorizzazioni, è quella di <strong>adottare un post</strong>! In pratica potete richiedere per <strong>determinati</strong> post (quelli più visti che trovate nella lista alla fine di questo blog) l'inserimento in testa e/o alla fine del post della vostra pubblicità, possibilmente inerente con il post stesso.</p>
<p>Ad esempio, nel memento in cui scrivo uno dei post più visti rimane <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>, con 17410 visualizzazioni. Se avete servizi o prodotti inerenti a Google Map o, comunque, che riguardano Internet, sviluppo e tecnologia, potete far richiesta per l'inserimento in testa e/o alla fine del post della vostra pubblicità, nel formato massimo 640x80 pixel.</p>

	Tags: <a href="http://www.undolog.com/tag/advertising/" title="advertising" rel="tag">advertising</a>, <a href="http://www.undolog.com/category/eventi-iniziative/" title="Eventi &amp; Iniziative" rel="tag">Eventi &amp; Iniziative</a>, <a href="http://www.undolog.com/tag/google-adsense/" title="Google AdSense" rel="tag">Google AdSense</a>, <a href="http://www.undolog.com/tag/paypal/" title="paypal" rel="tag">paypal</a>, <a href="http://www.undolog.com/tag/pubblicita/" title="pubblicità" rel="tag">pubblicità</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2008/09/08/wp-abs-ver111-su-wordpressorg/" title="WP-ABS: Ver.1.11 su WordPress.org (8 Settembre, 2008)">WP-ABS: Ver.1.11 su WordPress.org</a> (5)</li>
	<li><a href="http://www.undolog.com/2008/08/28/wp-abs-aggiornamento-release-11/" title="WP-ABS: aggiornamento release 1.1 (28 Agosto, 2008)">WP-ABS: aggiornamento release 1.1</a> (3)</li>
	<li><a href="http://www.undolog.com/2007/06/01/net-tv-come-internet-cambier-la-televisione-per-sempre/" title="Net TV: come Internet cambier&agrave; la televisione per sempre (1 Giugno, 2007)">Net TV: come Internet cambier&agrave; la televisione per sempre</a> (1)</li>
	<li><a href="http://www.undolog.com/2007/06/21/3-advertising-e-drm-nella-net-tv-coshanno-in-comune/" title="3. Advertising e DRM nella Net TV: cos&rsquo;hanno in comune? (21 Giugno, 2007)">3. Advertising e DRM nella Net TV: cos&rsquo;hanno in comune?</a> (1)</li>
	<li><a href="http://www.undolog.com/2007/06/12/2-advertising-e-drm-nella-net-tv-coshanno-in-comune/" title="2. Advertising e DRM nella Net TV: cos&#8217;hanno in comune? (12 Giugno, 2007)">2. Advertising e DRM nella Net TV: cos&#8217;hanno in comune?</a> (0)</li>
</ul>


<p><a href="http://feeds.feedburner.com/~a/undolog?a=AOG1md"><img src="http://feeds.feedburner.com/~a/undolog?i=AOG1md" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/undolog/~4/449532336" height="1" width="1"/>]]></content:encoded><description>Ultimamente ho ricevuto varie richieste relative all'inserimento di banner pubblicitari all'interno di undolog.com. Ho deciso, così, di formalizzare e rioganizzare gli spazi pubblicitari presenti su questo blog, forse i meno invasivi in circolazione. Nei banner pubblicitari (come Google AdSense) e nelle donazioni tramite PayPal non cerco certo un guadagno extra, tuttavia un blog [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.undolog.com/2008/11/11/adotta-un-post/feed/</wfw:commentRss><feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=undolog&amp;itemurl=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F11%2Fadotta-un-post%2F</feedburner:awareness><feedburner:origLink>http://www.undolog.com/2008/11/11/adotta-un-post/</feedburner:origLink></item><item><title>Actionscript 3.0 for beginners: lesson #4</title><link>http://feeds.feedburner.com/~r/undolog/~3/449158276/</link><category>Actionscript 3.0</category><category>Flash CS3</category><category>Internet</category><category>Sviluppo</category><category>Tutorials</category><category>class</category><category>Const</category><category>Corso</category><category>costanti</category><category>Lezione</category><category>public</category><category>static</category><category>variabili</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Giovambattista Fazioli</dc:creator><pubDate>Mon, 10 Nov 2008 23:00:41 -0600</pubDate><guid isPermaLink="false">http://www.undolog.com/?p=915</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![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="lactionscript-24"><a href="#" onclick="javascript:showCodeTxt('actionscript-24'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-24">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> myMC:flash.<span style="color: #006600;">display</span>.<span style="color: #0066CC;">MovieClip</span> = <span style="color: #000000; font-weight: bold;">new</span> flash.<span style="color: #006600;">display</span>.<span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</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="lactionscript-25"><a href="#" onclick="javascript:showCodeTxt('actionscript-25'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-25">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #0066CC;">MovieClip</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> myMC:<span style="color: #0066CC;">MovieClip</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</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="lactionscript-26"><a href="#" onclick="javascript:showCodeTxt('actionscript-26'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-26">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.*;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.*;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">text</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="lactionscript-27"><a href="#" onclick="javascript:showCodeTxt('actionscript-27'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-27">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">DisplayObject</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #0066CC;">MovieClip</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #0066CC;">Stage</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">StageAlign</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">StageScaleMode</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="lactionscript-28"><a href="#" onclick="javascript:showCodeTxt('actionscript-28'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-28">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">static</span> <span style="color: #0066CC;">public</span> const <span style="color: #0066CC;">NAME</span>&nbsp; &nbsp; :<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">"TicTacToe"</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">static</span> <span style="color: #0066CC;">public</span> const <span style="color: #0066CC;">VERSION</span> :<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">"1.0"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">static</span> <span style="color: #0066CC;">public</span> const AUTHOR&nbsp; :<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">"Giovambattista Fazioli &lt;g.fazioli@undolog.com&gt;"</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="lactionscript-29"><a href="#" onclick="javascript:showCodeTxt('actionscript-29'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-29">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const <span style="color: #0066CC;">NAME</span>&nbsp; &nbsp; :<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">"TicTacToe"</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const <span style="color: #0066CC;">VERSION</span> :<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">"1.0"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const AUTHOR&nbsp; :<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">"Giovambattista Fazioli &lt;g.fazioli@undolog.com&gt;"</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="lactionscript-30"><a href="#" onclick="javascript:showCodeTxt('actionscript-30'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-30">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> ttt:TicTacToe = <span style="color: #000000; font-weight: bold;">new</span> TicTacToe<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> ttt.<span style="color: #006600;">AUTHOR</span> <span style="color: #66cc66;">&#41;</span>;&nbsp; <span style="color: #808080; 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="lactionscript-31"><a href="#" onclick="javascript:showCodeTxt('actionscript-31'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-31">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> TicTacToe.<span style="color: #006600;">AUTHOR</span> <span style="color: #66cc66;">&#41;</span>;&nbsp; <span style="color: #808080; 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="lactionscript-32"><a href="#" onclick="javascript:showCodeTxt('actionscript-32'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-32">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">class</span> Esempio <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">public</span> const COSTANTE_A:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">public</span> const COSTANTE_B:<span style="color: #0066CC;">int</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// costruttore</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Esempio<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; COSTANTE_B = <span style="color: #cc66cc;color:#800000;">10</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> sample:Esempio&nbsp; = <span style="color: #000000; font-weight: bold;">new</span> Esempio <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> sample.<span style="color: #006600;">COSTANTE_A</span> <span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// 0</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> sample.<span style="color: #006600;">COSTANTE_B</span> <span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; 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>

	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/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> (3)</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> (4)</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>
	<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>
</ul>


<p><a href="http://feeds.feedburner.com/~a/undolog?a=N3NQF4"><img src="http://feeds.feedburner.com/~a/undolog?i=N3NQF4" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/undolog/~4/449158276" height="1" width="1"/>]]></content:encoded><description>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><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.undolog.com/2008/11/11/actionscript-30-for-beginners-lesson-4/feed/</wfw:commentRss><feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=undolog&amp;itemurl=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F11%2Factionscript-30-for-beginners-lesson-4%2F</feedburner:awareness><feedburner:origLink>http://www.undolog.com/2008/11/11/actionscript-30-for-beginners-lesson-4/</feedburner:origLink></item><item><title>Very short trick: versatilità delle classi CSS</title><link>http://feeds.feedburner.com/~r/undolog/~3/448368962/</link><category>CSS</category><category>Internet</category><category>Sviluppo</category><category>class</category><category>HTML</category><category>id</category><category>Stile</category><category>Style-Sheet</category><category>trick</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Giovambattista Fazioli</dc:creator><pubDate>Mon, 10 Nov 2008 06:46:14 -0600</pubDate><guid isPermaLink="false">http://www.undolog.com/?p=917</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>I più esperti lo sapranno già, tuttavia mi viene spesso chiesto che differenza c'è tra <code>class</code> e <code>id</code> nei fogli di stile CSS. Una panoramica su alcune differenze e avvertenze è possibile trovarla in <em><a href="http://www.undolog.com/2006/09/07/classi-e-id-nei-css/">Classi e ID nei CSS</a></em>, tuttavia una caratteristica utile, che distingue <code>class</code> da <code>id</code>, è la possibilità di usare classi multiple. Ad esempio è possibile definire:</p>
<div class="igBar"><span id="lcss-35"><a href="#" onclick="javascript:showCodeTxt('css-35'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-35">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #6666ff;">.bordoNero </span><span style="color: #66cc66;">&#123;</span>border<span style="color: #3333ff;">:2px </span>solid #000<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #6666ff;">.coloreRosso </span><span style="color: #66cc66;">&#123;</span><span style="color: #000000; font-weight: bold;">color</span>:#f00<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #6666ff;">.bordoRosso </span><span style="color: #66cc66;">&#123;</span>border<span style="color: #3333ff;">:2px </span>solid #f00<span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>e scrivire nell'HTML:</p>
<div class="igBar"><span id="lhtml-36"><a href="#" onclick="javascript:showCodeTxt('html-36'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-36">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"bordoNero coloreRosso"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>Bordo nero con caratteri rossi<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"bordoRosso coloreRosso"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>Bordo rosso con caratteri rossi<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><code>class</code>, a differenza di <code>id</code>, può contenere al suo interno più definizioni in qualsiasi sequenza!</p>

	Tags: <a href="http://www.undolog.com/tag/class/" title="class" rel="tag">class</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/tag/id/" title="id" rel="tag">id</a>, <a href="http://www.undolog.com/category/sviluppo/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/stile/" title="Stile" rel="tag">Stile</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/tag/trick/" title="trick" rel="tag">trick</a><br />

	<h4>Post correlati</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.undolog.com/2006/09/07/classi-e-id-nei-css/" title="Classi e ID nei CSS (7 Settembre, 2006)">Classi e ID nei CSS</a> (3)</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/2007/02/12/nascondimi/" title="Nascondimi (12 Febbraio, 2007)">Nascondimi</a> (0)</li>
	<li><a href="http://www.undolog.com/2006/07/27/le-meraviglie-del-css20/" title="Le meraviglie del CSS2.0+ (27 Luglio, 2006)">Le meraviglie del CSS2.0+</a> (0)</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> (0)</li>
</ul>


<p><a href="http://feeds.feedburner.com/~a/undolog?a=cfwAXl"><img src="http://feeds.feedburner.com/~a/undolog?i=cfwAXl" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/undolog/~4/448368962" height="1" width="1"/>]]></content:encoded><description>I più esperti lo sapranno già, tuttavia mi viene spesso chiesto che differenza c'è tra class e id nei fogli di stile CSS. Una panoramica su alcune differenze e avvertenze è possibile trovarla in Classi e ID nei CSS, tuttavia una caratteristica utile, che distingue class da id, è la possibilità di usare classi multiple. [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.undolog.com/2008/11/10/very-short-trick-versatilita-delle-classi-css/feed/</wfw:commentRss><feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=undolog&amp;itemurl=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F10%2Fvery-short-trick-versatilita-delle-classi-css%2F</feedburner:awareness><feedburner:origLink>http://www.undolog.com/2008/11/10/very-short-trick-versatilita-delle-classi-css/</feedburner:origLink></item><item><title>Very short snippet: Wordpress administrator?</title><link>http://feeds.feedburner.com/~r/undolog/~3/440785822/</link><category>Internet</category><category>Sviluppo</category><category>WordPress</category><category>PHP</category><category>Snipp</category><category>Snippets</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Giovambattista Fazioli</dc:creator><pubDate>Mon, 03 Nov 2008 02:00:55 -0600</pubDate><guid isPermaLink="false">http://www.undolog.com/?p=905</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Amministratore o sottoscrittore? Ecco un modo rapido per capirlo:</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">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/global"><span style="color:#000066;">global</span></a> <span style="color:#0000FF;">$user_ID</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$capabilities</span> = get_usermeta<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$user_ID</span>, <span style="color:#FF0000;">'wp_capabilities'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/is_array"><span style="color:#000066;">is_array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$capabilities</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$capabilities</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'Administrator'</span><span style="color:#006600; font-weight:bold;">&#93;</span>==<span style="color:#CC66CC;color:#800000;">1</span> || <span style="color:#0000FF;">$capabilities</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'administrator'</span><span style="color:#006600; font-weight:bold;">&#93;</span>==<span style="color:#CC66CC;color:#800000;">1</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"Sei un amministratore"</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Oppure, in forma "contratta":</p>
<div class="igBar"><span id="lphp-40"><a href="#" onclick="javascript:showCodeTxt('php-40'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-40">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/global"><span style="color:#000066;">global</span></a> <span style="color:#0000FF;">$user_ID</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$capabilities</span> = get_usermeta<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$user_ID</span>, <span style="color:#FF0000;">'wp_capabilities'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// $admin è true se amministratore</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$admin</span> = <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$capabilities</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'Administrator'</span><span style="color:#006600; font-weight:bold;">&#93;</span>==<span style="color:#CC66CC;color:#800000;">1</span> || <span style="color:#0000FF;">$capabilities</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'administrator'</span><span style="color:#006600; font-weight:bold;">&#93;</span>==<span style="color:#CC66CC;color:#800000;">1</span> <span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Si possono ovviamente controllare tutti i livelli messi a disposizione da Wordpress, come subscriber ad esempio.</p>

	Tags: <a href="http://www.undolog.com/category/sviluppo/internet/" title="Internet" rel="tag">Internet</a>, <a href="http://www.undolog.com/tag/php/" title="PHP" rel="tag">PHP</a>, <a href="http://www.undolog.com/tag/snipp/" title="Snipp" rel="tag">Snipp</a>, <a href="http://www.undolog.com/tag/snippets/" title="Snippets" rel="tag">Snippets</a>, <a href="http://www.undolog.com/category/sviluppo/" title="Sviluppo" rel="tag">Sviluppo</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/19/very-short-snippet-wordpress-separare-le-categorie-in-due-colonne/" title="Very short snippet: Wordpress, separare le categorie in due colonne (19 Novembre, 2008)">Very short snippet: Wordpress, separare le categorie in due colonne</a> (1)</li>
	<li><a href="http://www.undolog.com/2008/10/31/very-short-snippet-php-plain-date/" title="Very short snippet: PHP plain date (31 Ottobre, 2008)">Very short snippet: PHP plain date</a> (1)</li>
	<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> (1)</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> (5)</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>
</ul>


<p><a href="http://feeds.feedburner.com/~a/undolog?a=F6nY1j"><img src="http://feeds.feedburner.com/~a/undolog?i=F6nY1j" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/undolog/~4/440785822" height="1" width="1"/>]]></content:encoded><description>Amministratore o sottoscrittore? Ecco un modo rapido per capirlo:
PLAIN TEXT
PHP:




global $user_ID;


//


$capabilities = get_usermeta&amp;#40; $user_ID, 'wp_capabilities'&amp;#41;;


//


if &amp;#40; is_array&amp;#40; $capabilities &amp;#41; &amp;#41; &amp;#123;


&amp;#160; &amp;#160; if&amp;#40; $capabilities&amp;#91;'Administrator'&amp;#93;==1 &amp;#124;&amp;#124; $capabilities&amp;#91;'administrator'&amp;#93;==1 &amp;#41; &amp;#123;


&amp;#160; &amp;#160; &amp;#160; &amp;#160; echo "Sei un amministratore";


&amp;#160; &amp;#160; &amp;#125;


&amp;#125; 






Oppure, in forma "contratta":
PLAIN TEXT
PHP:




global $user_ID;


//


$capabilities = get_usermeta&amp;#40; $user_ID, 'wp_capabilities'&amp;#41;;


// $admin è true se amministratore


$admin = &amp;#40; $capabilities&amp;#91;'Administrator'&amp;#93;==1 [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.undolog.com/2008/11/03/very-short-snippet-wordpress-administrator/feed/</wfw:commentRss><feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=undolog&amp;itemurl=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F03%2Fvery-short-snippet-wordpress-administrator%2F</feedburner:awareness><feedburner:origLink>http://www.undolog.com/2008/11/03/very-short-snippet-wordpress-administrator/</feedburner:origLink></item><item><title>Wordpress: rimuovere i menu dell’amministrazione</title><link>http://feeds.feedburner.com/~r/undolog/~3/439103213/</link><category>Internet</category><category>PHP</category><category>Sviluppo</category><category>Tutorials</category><category>WordPress</category><category>add_action()</category><category>blog</category><category>Menu</category><category>Plugin</category><category>Plugins</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Giovambattista Fazioli</dc:creator><pubDate>Sat, 01 Nov 2008 09:48:48 -0500</pubDate><guid isPermaLink="false">http://www.undolog.com/?p=831</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![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-42"><a href="#" onclick="javascript:showCodeTxt('php-42'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-42">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> remove_menu_item<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/global"><span style="color:#000066;">global</span></a>&nbsp; <span style="color:#0000FF;">$menu</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// tramite label</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$removes</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'Design'</span>, <span style="color:#FF0000;">'Impostazioni'</span>, <span style="color:#FF0000;">'Plugins'</span> <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// tramite link</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// $removes = array( 'themes.php', 'options-general.php', 'plugins.php' );</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$removes</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$todel</span> <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$menu</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$key</span> =&gt; <span style="color:#0000FF;">$sm</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$sm</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span> == <span style="color:#0000FF;">$todel</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <a href="http://www.php.net/unset"><span style="color:#000066;">unset</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$menu</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#616100;">break</span>; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// tramite link</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// foreach($menu as $key =&gt; $sm) if($sm[2] == $todel ) { unset( $menu[$key] ); break; }&nbsp; </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#FF9900;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">add_action<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'admin_menu'</span>, &nbsp; &nbsp;<span style="color:#FF0000;">'remove_menu_item'</span><span style="color:#006600; font-weight:bold;">&#41;</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>

	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> (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> (13)</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>
	<li><a href="http://www.undolog.com/2008/07/16/usare-i-template-wordpress-per-creare-una-sitemap/" title="Usare i Template WordPress per creare una Sitemap (16 Luglio, 2008)">Usare i Template WordPress per creare una Sitemap</a> (1)</li>
</ul>


<p><a href="http://feeds.feedburner.com/~a/undolog?a=wef21j"><img src="http://feeds.feedburner.com/~a/undolog?i=wef21j" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/undolog/~4/439103213" height="1" width="1"/>]]></content:encoded><description>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><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.undolog.com/2008/11/01/wordpress-rimuovere-i-menu-dellamministrazione/feed/</wfw:commentRss><feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=undolog&amp;itemurl=http%3A%2F%2Fwww.undolog.com%2F2008%2F11%2F01%2Fwordpress-rimuovere-i-menu-dellamministrazione%2F</feedburner:awareness><feedburner:origLink>http://www.undolog.com/2008/11/01/wordpress-rimuovere-i-menu-dellamministrazione/</feedburner:origLink></item><item><title>Very short snippet: PHP plain date</title><link>http://feeds.feedburner.com/~r/undolog/~3/437844246/</link><category>Internet</category><category>PHP</category><category>Sviluppo</category><category>explode()</category><category>Format</category><category>preg_replace()</category><category>Snipp</category><category>Snippets</category><category>str_replace()</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Giovambattista Fazioli</dc:creator><pubDate>Fri, 31 Oct 2008 04:00:07 -0500</pubDate><guid isPermaLink="false">http://www.undolog.com/?p=896</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Converte una data dal formato <code>yyyy-mm-dd hh:mm:ss</code> a <code>yyyymmddhhmmss</code>. Utile per poter sfruttare le funzioni di ordinamento; tipo <code>asort()</code>.</p>
<div class="igBar"><span id="lphp-46"><a href="#" onclick="javascript:showCodeTxt('php-46'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-46">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#758DB8;">
<div style="font-family: 'Courier New', Courier, monospace; font-weig