<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Quatrecentquatre &#187; SWFAddress</title>
	<atom:link href="http://blog.quatrecentquatre.com/tag/swfaddress/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.quatrecentquatre.com</link>
	<description>3437 St-Laurent, Montréal, Québec, H2X 2T6, / Téléphone : 514-303-6810</description>
	<lastBuildDate>Mon, 05 Jul 2010 20:59:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Utilisation de SWFAddress à travers le NavigationManager</title>
		<link>http://blog.quatrecentquatre.com/2009/06/08/utilisation-de-swfaddress-a-travers-le-navigation-manager/</link>
		<comments>http://blog.quatrecentquatre.com/2009/06/08/utilisation-de-swfaddress-a-travers-le-navigation-manager/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 22:01:47 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Développement]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Tout et Rien]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[NavigationManager]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Outil]]></category>
		<category><![CDATA[SWFAddress]]></category>
		<category><![CDATA[Tool]]></category>

		<guid isPermaLink="false">http://blog.quatrecentquatre.com/?p=209</guid>
		<description><![CDATA[Le NavigationManager de QuatreCentQuatre est une enveloppe ou un Proxy qui sert à titre d’interface à la classe SWFAddress de Asual afin de mieux contrôler son comportement et d’en étendre les fonctionnalités.
SWFAddress d'Asual
SWFAddress est une combinaison de techniques permettant, à travers des classes Javascript et Actionscript, le deep-linking (la possibilité d’accéder à des sections ou [...]]]></description>
			<content:encoded><![CDATA[<p>Le NavigationManager de QuatreCentQuatre est une enveloppe ou un Proxy qui sert à titre d’interface à la classe SWFAddress de Asual afin de mieux contrôler son comportement et d’en étendre les fonctionnalités.</p>
<p><strong>SWFAddress d'Asual</strong></p>
<p><a href="http://www.asual.com/swfaddress/">SWFAddress</a> est une combinaison de techniques permettant, à travers des classes Javascript et Actionscript, le deep-linking (la possibilité d’accéder à des sections ou des pages directement à partir de la barre d’adresse du fureteur) dans des sites programmés en Flash.  Cette technique, en plus de permettre l’utilisation de signets et des boutons Suivant et Précédent du fureteur, est une des meilleures solutions afin d’optimiser son site pour les moteurs de recherche.</p>
<p><img class="aligncenter size-full wp-image-211" title="SWFAddress" src="http://blog.quatrecentquatre.com/wp-content/uploads/2009/06/caption1.gif" alt="SWFAddress" width="397" height="176" /></p>
<p>Afin d’utiliser <a href="http://www.asual.com/swfaddress/">SWFAddress</a>, il suffit d’intégrer l’outil dans le HTML de la façon suivante :</p>
<pre class="javascript"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;script type=<span style="color: #3366CC;">&quot;text/javascript&quot;</span> src=<span style="color: #3366CC;">&quot;library/swfobject.js&quot;</span>&gt;&lt;/script&gt;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;script type=<span style="color: #3366CC;">&quot;text/javascript&quot;</span> src=<span style="color: #3366CC;">&quot;library/swfaddress.js&quot;</span>&gt;&lt;/script&gt;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;script type=<span style="color: #3366CC;">&quot;text/javascript&quot;</span>&gt;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #003366; font-weight: bold;">var</span> flashvars = <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #003366; font-weight: bold;">var</span> params = <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #003366; font-weight: bold;">var</span> attributes = <span style="color: #66cc66;">&#123;</span>id:<span style="color: #3366CC;">&quot;flashMovie&quot;</span><span style="color: #66cc66;">&#125;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	swfobject.<span style="color: #006600;">embedSWF</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;navigationExample.swf&quot;</span>, <span style="color: #3366CC;">&quot;alternateContent&quot;</span>, <span style="color: #3366CC;">&quot;100%&quot;</span>, <span style="color: #3366CC;">&quot;100%&quot;</span>, <span style="color: #3366CC;">&quot;9.0.124&quot;</span>, <span style="color: #003366; font-weight: bold;">false</span>, flashvars, params, attributes<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/script&gt;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></pre>
<p><strong>UTILISATION DE SWFADDRESS</strong></p>
<p>L’intégration dans Flash s’effectue ensuite comme suit :</p>
<pre class="actionscript"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><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: #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;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	SWFAddress.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>SWFAddressEvent.<span style="color: #006600;">CHANGE</span>, handleChange, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</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;"><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;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #808080; font-style: italic;">//Exemple de changement de page, mais une page ‘’/’’ est reçue par défaut au départ de l’application</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	SWFAddress.<span style="color: #006600;">setValue</span><span style="color: #66cc66;">&#40;</span>‘’page1’’<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><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;"><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;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> handleChange<span style="color: #66cc66;">&#40;</span>evt:SWFAddressEvent<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;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #000000; font-weight: bold;">var</span> laSection:<span style="color: #0066CC;">String</span> = evt.<span style="color: #006600;">value</span>; </div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><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;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #808080; font-style: italic;">//La seule information obtenue est un string, une condition doit donc être programmée</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #b1b100;">switch</span><span style="color: #66cc66;">&#40;</span>laSection<span style="color: #66cc66;">&#41;</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;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #b1b100;">case</span> ‘’X’’ :</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #808080; font-style: italic;">//opération afin de changer de section</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #808080; font-style: italic;">//Changer le titre de la page (défini manuellement)</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #808080; font-style: italic;">//Vérifier si c’est la section demandée n’existe pas, etc…</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><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;"><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;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></pre>
<p><a href="http://www.asual.com/swfaddress/">SWFAddress</a> présente aussi plusieurs outils pour, par exemple :</p>
<ul>
<li>Ouvrir des liens externes</li>
<li>Reculer dans l’historique</li>
<li>Monter de niveau hiérarchique (section1/section1-1 vers section1/)</li>
<li>Changer le titre de la page (dans quel cas SWFAddress doit être déclaré sous la balise  dans le html.</li>
</ul>
<p><strong>Note</strong> : <a href="http://www.asual.com/swfaddress/">SWFAddress</a>, quand il est utilisé adéquatement, remplace et surclasse le moteur d’indexation des fichiers swf des moteurs de recherche populaires tels que Google, c’est pourquoi il est important d’inclure un fichier robots.txt afin d’empêcher ceux-ci d’indexer automatiquement les fichiers gérés par <a href="http://www.asual.com/swfaddress/">SWFAddress</a> ou le NavigationManager.<br />
Exemple de fichier robots.txt :</p>
<pre class="text"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Sitemap: http://www.asual.com/sitemap.xml</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">User-agent: *</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Disallow: /*.swf*</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></pre>
<p> &nbsp;<br />
 &nbsp;<br />
<strong>NAVIGATIONMANGER</strong></p>
<p>Le mandat de <a href="http://www.asual.com/swfaddress/">SWFAddress</a> est de permettre le deep-linking et cet objectif est atteint. Toutefois, des mécanismes personnalisés doivent être mis en place afin d’en régir le fonctionnement ainsi que les cas d’exception.  Que faites-vous si vous voulez que la description des sections soit chargée à l’externe, passer à la section suivante, assigner des descriptions aux sections, obtenir les infos de son parent ou encore que vous désirez savoir à quel niveau hiérarchique se trouve la section courante?  Vous devrez programmer vos propres mécanismes ou utiliser le NavigationManager.</p>
<p>Propriétés et méthodes publiques</p>
<p><div id="attachment_232" class="wp-caption aligncenter" style="width: 722px"><img class="size-full wp-image-232" title="NavigationManager" src="http://blog.quatrecentquatre.com/wp-content/uploads/2009/06/caption2.gif" alt="Structure du NavigationManager de QuatreCentQuatre" width="712" height="606" /><p class="wp-caption-text">Structure du NavigationManager de QuatreCentQuatre</p></div><br />
 &nbsp;<br />
 &nbsp;<br />
Étant donné que le NavigationManager est une enveloppe à SWFAddress, les classes de ce dernier seront requises et l’intégration Javascript s’effectuera de la même façon.<br />
 &nbsp;<br />
 &nbsp;</p>
<pre class="javascript"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><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;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;script type=<span style="color: #3366CC;">&quot;text/javascript&quot;</span> src=<span style="color: #3366CC;">&quot;library/swfobject.js&quot;</span>&gt;&lt;/script&gt;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;script type=<span style="color: #3366CC;">&quot;text/javascript&quot;</span> src=<span style="color: #3366CC;">&quot;library/swfaddress.js&quot;</span>&gt;&lt;/script&gt;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;script type=<span style="color: #3366CC;">&quot;text/javascript&quot;</span>&gt;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #003366; font-weight: bold;">var</span> flashvars = <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #003366; font-weight: bold;">var</span> params = <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #003366; font-weight: bold;">var</span> attributes = <span style="color: #66cc66;">&#123;</span>id:<span style="color: #3366CC;">&quot;flashMovie&quot;</span><span style="color: #66cc66;">&#125;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	swfobject.<span style="color: #006600;">embedSWF</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;navigationExample.swf&quot;</span>, <span style="color: #3366CC;">&quot;alternateContent&quot;</span>, <span style="color: #3366CC;">&quot;100%&quot;</span>, <span style="color: #3366CC;">&quot;100%&quot;</span>, <span style="color: #3366CC;">&quot;9.0.124&quot;</span>, <span style="color: #003366; font-weight: bold;">false</span>, flashvars, params, attributes<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/script&gt;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></pre>
<p>Le NavigationManager fonctionne selon un schéma XML qui peut être défini manuellement ou chargé à l’externe, voici un exemple de la structure du XML requis.</p>
<pre class="xml"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><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;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;response<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;header<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/header<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;body<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;page<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;item</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;default&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;description<span style="font-weight: bold; color: black;">&gt;</span></span></span>Section 1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/description<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;tag<span style="font-weight: bold; color: black;">&gt;</span></span></span>section1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/tag<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ressource<span style="font-weight: bold; color: black;">&gt;</span></span></span>sectionclasses.Section1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/ressource<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;subitems<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">					<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;item</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;normal&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">						<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;description<span style="font-weight: bold; color: black;">&gt;</span></span></span>Ceci est la section 1.1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/description<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">						<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;tag<span style="font-weight: bold; color: black;">&gt;</span></span></span>section1-1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/tag<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">						<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ressource<span style="font-weight: bold; color: black;">&gt;</span></span></span>sectionclasses.Section1_1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/ressource<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">					<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/item<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">					<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;item</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;normal&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">						<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;description<span style="font-weight: bold; color: black;">&gt;</span></span></span>Ceci est la section 1.2<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/description<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">						<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;tag<span style="font-weight: bold; color: black;">&gt;</span></span></span>section1-2<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/tag<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">						<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ressource<span style="font-weight: bold; color: black;">&gt;</span></span></span>sectionclasses.Section1_2<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/ressource<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">					<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/item<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/subitems<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/item<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span> item <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;notfound&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;description<span style="font-weight: bold; color: black;">&gt;</span></span></span>Section  not found<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/description<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;tag<span style="font-weight: bold; color: black;">&gt;</span></span></span>sectionnotfound<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/tag<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">				<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ressource<span style="font-weight: bold; color: black;">&gt;</span></span></span>sectionclasses.Section1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/ressource<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/</span> item<span style="font-weight: bold; color: black;">&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/page<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/body<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/response<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></pre>
<p>Les informations d’une section doivent se retrouver à l’intérieur d’une balise &lt;item&gt;  et doivent se situer à l’intérieur du node &lt;page&gt; qui sert de conteneur aux informations de la navigation.</p>
<p>Les informations à retrouver sont les suivantes :</p>
<ul>
<li>L’attribut type qui peut valoir normal au default. Une valeur default indique que cette section est celle qui sera chargée par défaut lors de l’initialisation du système (au lieu de « / »)</li>
<li>La balise tag, qui sera utilisée comme identifiant dans la barre d’addresse et pour google analytics.</li>
<li>La balise description, qui est une valeur qui peut servir, par exemple, à nommer le bouton qui mènera à la section ou encore au titre de la page si la propriété useDescriptionAsTitle a une valeur de true.</li>
<li>La balise ressource, que vous pourrez utiliser afin de spécifier à quelle ressource (classe, fichier swf ou lien externe) la section est liée.</li>
<li>Une balise subitems optionnelle qui contiendra des nodes items qui seront considérés les enfants de l’item courant.</li>
</ul>
<p>Notez qu’un deuxième node de structure similaire mais d’un type notfound peut être placé à la racine de l’arbre afin de régir la section utilisée lorsqu’une page reçue n’est pas définie dans le XML.  Si ce node facultatif n’est pas défini, la page par défaut sera utilisée.<br />
<br />
<strong>UTILISATION DU NAVIGATION MANAGER</strong></p>
<p>L’intégration dans Flash est simple : </p>
<pre class="actionscript"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><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;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><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: #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;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	NavigationManager.<span style="color: #006600;">instance</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>NavigationManagerEvent.<span style="color: #006600;">SECTION_CHANGED</span>, handleSectionChanged, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</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;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	NavigationManager.<span style="color: #006600;">instance</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>NavigationManagerEvent.<span style="color: #006600;">MENU_XML_LOAD_COMPLETE</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		handleMenuLoadComplete, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</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;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	NavigationManager.<span style="color: #006600;">instance</span>.<span style="color: #006600;">loadMenuXML</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span>‘’<span style="color: #0066CC;">menu</span>.<span style="color: #0066CC;">xml</span>’’<span style="color: #66cc66;">&#41;</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;"><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;"><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;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> handleSectionChanged <span style="color: #66cc66;">&#40;</span>evt: NavigationManagerEvent<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;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #808080; font-style: italic;">//Référence vers la section courante</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #000000; font-weight: bold;">var</span> laSection:SectionData = evt.<span style="color: #006600;">section</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #808080; font-style: italic;">//ou</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #000000; font-weight: bold;">var</span> laSection2:SectionData =NavigationManager.<span style="color: #006600;">instance</span>.<span style="color: #006600;">getCurrentSection</span><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;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #808080; font-style: italic;">//On pourrait créer une section à partir de la ressource :</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #000000; font-weight: bold;">var</span> sectionClass:<span style="color: #000000; font-weight: bold;">Class</span> = getDefinitionByName<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">section</span>.<span style="color: #006600;">ressource</span><span style="color: #66cc66;">&#41;</span> as <span style="color: #000000; font-weight: bold;">Class</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #000000; font-weight: bold;">var</span> currentSection &lt;img src=<span style="color: #ff0000;">'http://blog.quatrecentquatre.com/wp-includes/images/smilies/icon_biggrin.gif'</span> alt=<span style="color: #ff0000;">':D'</span> <span style="color: #000000; font-weight: bold;">class</span>=<span style="color: #ff0000;">'wp-smiley'</span> /&gt; isplayObject = <span style="color: #000000; font-weight: bold;">new</span> sectionClass<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> as SectionObject</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	addChild<span style="color: #66cc66;">&#40;</span>currentSection<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><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;"><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;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> handleMenuLoadComplete <span style="color: #66cc66;">&#40;</span>evt: NavigationManagerEvent<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;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #808080; font-style: italic;">//Effectue les operations afin de créer le menu</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #000000; font-weight: bold;">var</span> iterator:ISubSectionIterator = NavigationManager.<span style="color: #006600;">instance</span>.<span style="color: #006600;">sectionsList</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">length</span>:<span style="color: #0066CC;">int</span> = iterator.<span style="color: #006600;">numSubSections</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>; i &lt; <span style="color: #0066CC;">length</span>; i++<span style="color: #66cc66;">&#41;</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;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #000000; font-weight: bold;">var</span> laSection:SectionData = iterator.<span style="color: #006600;">getSubSectionAt</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><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;"><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;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></pre>
<p>
Comme on peut le constater, il peut être pratique d’écouter sur l’événement MENU_XML_LOAD_COMPLETE  afin de savoir si le XML est chargé alors que l’événement SECTION_CHANGED est utile afin de savoir quand une section a changé. Notez que l’événement SECTION_CHANGED  ne sera jamais diffusé avant que la fin du chargement du XML externe ou avant l’assignation manuelle du XML à travers la fonction NavigationManager.instance. sectionsList. setMenuStructure().<br />
<br/><br />
<strong>PRATIQUES À ADOPTER</strong></p>
<ul>
<li>Dans les items associée à une section (un bouton de menu par exemple) implémentez une propriété qui entreposera une référence vers le SectionData de la section qu’ils représentent afin de faciliter l’utilisation du système. En plus, l’espace mémoire requis sera plus petit qu’une valeur textuelle de son chemin enregistrée dans un String. </li>
<li>Si vous avez plus d’un menu pour la navigation, vous pouvez les englober dans des nodes <item> à la racine du groupe
<page> qui serviront ni plus ni moins de conteneurs aux sous-sections qu’ils contiendront.  Pour y accéder individuellement lors de la création dynamique des menus, vous pouvez utiliser la fonction NavigationManager.instance.sectionsList.getSectionByTag(‘’conteneur X’’) à partir duquel vous pourrez accéder à ses enfants.  De plus, la structure dans Google Analytics n’en sera que plus claire étant donné que la section sera identifée comme suit : conteneurX/sectionY </li>
</ul>
<p> &nbsp;<br />
 &nbsp;<br />
<strong>BIBLIOGRAPHIE</strong><br />
SWFAddress Bad Practices<br />
<a href="http://www.asual.com/blog/swfaddress/2007/05/18/swfaddress-bad-practices.html">http://www.asual.com/blog/swfaddress/2007/05/18/swfaddress-bad-practices.html</a><br />
SWFAddress and robots.txt<br />
<a href="http://www.asual.com/blog/swfaddress/2008/11/25/swfaddress-and-robots-txt.html">http://www.asual.com/blog/swfaddress/2008/11/25/swfaddress-and-robots-txt.html</a></p>
<p>Télécharger la version 1.0 du NavigationManager:<br />
<a href="http://quatrecentquatre.com/clients/public/404/NavigationManager1.0.zip">LIEN</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.quatrecentquatre.com/2009/06/08/utilisation-de-swfaddress-a-travers-le-navigation-manager/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
