<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://blog.lalex.com/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
  <title>LAlex devblog v6</title>
  <link>http://blog.lalex.com/</link>
  <atom:link href="http://blog.lalex.com/feed/rss2" rel="self" type="application/rss+xml"/>
  <description></description>
  <language>fr</language>
  <pubDate>Thu, 04 Sep 2008 18:23:47 +0200</pubDate>
  <copyright></copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Pratiques Flex (1/?) : les bindings</title>
    <link>http://blog.lalex.com/post/2008/09/03/Pratiques-Flex-les-bindings</link>
    <guid isPermaLink="false">urn:md5:0ba17b839c02a82e01179dc02fa803e9</guid>
    <pubDate>Wed, 03 Sep 2008 15:41:00 +0200</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>AS3 / Flex2</category>
            
    <description>&lt;p&gt;Les bindings sont un aspect de Flex bien séduisants car il permettent de
refléter automatiquement la modification du contenu d'une variable vers une
autre. Seulement, lorsqu'ils sont utilisés intensément, ils peuvent également
devenir un goulot d'étranglement en terme de performances.&lt;/p&gt;
&lt;p&gt;Pour éviter cela, la solution est plutôt simple, et nécessite de savoir
comment fonctionne la balise [Bindable] et comment elle est utilisée par le
framework Flex...&lt;/p&gt;    &lt;p&gt;Les bindings fonctionnent grâce à des meta-balises qui sont interprétés par
le compilateur Flex (ou plutôt le traducteur MXML/AS3). Cette meta-balise va
servir à dire quel évenement va signaler le changement de la valeur d'une
propriété.&lt;/p&gt;
&lt;p&gt;En prenant un exemple simple:&lt;/p&gt;
&lt;pre&gt;
&amp;lt;mx:Button id=&amp;quot;enableButton&amp;quot; toggle=&amp;quot;true&amp;quot; /&amp;gt;
&amp;lt;mx:TextInput id=&amp;quot;textInput&amp;quot; enabled=&amp;quot;{enableButton.selected}&amp;quot; /&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Dans cet exemple, si le bouton est enfoncé (&lt;em&gt;selected&lt;/em&gt;=true), la zone
de saisie sera activée, et si le bouton est relevé (&lt;em&gt;selected&lt;/em&gt;=false),
la zone de saisie sera désactivée. Cela se fait grâce a un binding, qui met a
jour la propriété &lt;em&gt;enabled&lt;/em&gt; du champ de saisie lorsqu'un événement
signale que la propriété &lt;em&gt;selected&lt;/em&gt; du bouton à été modifiée. Tout cela
est géré automatiquement par Flex car la propriété &lt;em&gt;selected&lt;/em&gt; de la
classe Button est déclarée comme étant &lt;strong&gt;[Bindable]&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Il est possible de créer ses propres propriétés [Bindable], de manière plus
ou moins assistée par Flex:&lt;/p&gt;
&lt;h3&gt;[Bindable]&lt;/h3&gt;
&lt;p&gt;Le traducteur MXML/AS3 (même si la meta-balise est dans une classe AS3 et
non pas un MXML) va créer à la place un getter/setter qui va dispatcher un
événement standard pour signaler le changement de valeur. Cet événement sera un
PropertyChangeEvent de type PropertyChangeEvent.PROPERTY_CHANGE. Vous verrez
ci-aprés un exemple de code AS3 avant (avec son [Bindable]) et aprés.&lt;/p&gt;
&lt;p&gt;Avant&lt;/p&gt;
&lt;code class=&quot;actionscript&quot;&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;Bindable&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;br /&gt;
protected &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; mc:MessageController;&lt;/code&gt;
&lt;p&gt;Aprés&lt;/p&gt;
&lt;code class=&quot;actionscript&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;br /&gt;
&amp;nbsp;* generated bindable wrapper for property mc (protected)&lt;br /&gt;
&amp;nbsp;* - generated setter&lt;br /&gt;
&amp;nbsp;* - generated getter&lt;br /&gt;
&amp;nbsp;* - original protected var 'mc' moved to '_3478mc'&lt;br /&gt;
&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;Bindable&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;event=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;propertyChange&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;br /&gt;
protected &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;get&lt;/span&gt; mc&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;:MessageController&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;this&lt;/span&gt;._3478mc;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
protected &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;set&lt;/span&gt; mc&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;value:MessageController&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;span style=&quot;color: #0066CC;&quot;&gt;void&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; oldValue:&lt;span style=&quot;color: #0066CC;&quot;&gt;Object&lt;/span&gt; = &lt;span style=&quot;color: #0066CC;&quot;&gt;this&lt;/span&gt;._3478mc;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;oldValue !== value&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;this&lt;/span&gt;._3478mc = value;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;dispatchEvent&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;mx.&lt;span style=&quot;color: #006600;&quot;&gt;events&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;PropertyChangeEvent&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;createUpdateEvent&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0066CC;&quot;&gt;this&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;mc&amp;quot;&lt;/span&gt;, oldValue, value&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/code&gt;
&lt;h3&gt;[Bindable(event=&amp;quot;eventName&amp;quot;)]&lt;/h3&gt;
&lt;p&gt;Lorsque l'on précise dans la méta-balise le nom de l'événement qui sera
diffusé lors d'un changement de valeur de la variable, le traducteur MXML/AS3
n'interviendra pas sur le code: le framework se contentera d'écouter
l'événement précisé pour mettre à jour les variables de destination. C'est donc
au développeur de diffuser lui-même l'événement dans son code, que ce soit dans
le setter de la propriété, ou n'importe quel méthode qui va affecter la
propriété. On voit d'ailleurs dans l'évenement précédent qu'un [Bindable] est
transformé en [Bindable(event=&amp;quot;propertyChange&amp;quot;].&lt;/p&gt;
&lt;p&gt;Étant donné qu'il n'est pas possible d'utiliser de variable dans les
meta-balises, j'ai également pris l'habitude d'utiliser systématiquement des
chaînes de caractères pour le type de mes événements: étant donné qu'à priori
on n'utilise nulle part ailleurs dans le code l'écoute de cet événement, ça
permet de différencier le dispatch d'un événement destiné à être écouté et
celui d'un événement destiné au binding... J'ai également pris l'habitude de
créer pour chaque binding &amp;quot;à la main&amp;quot; une méthode notify&lt;em&gt;MonBinding&lt;/em&gt; qui
dispatche l'évenement qui va bien.&lt;/p&gt;
&lt;h3&gt;Les performances&lt;/h3&gt;
&lt;p&gt;Voyons maintenant comment Flex se sert des bindings: un BindingManager
(classe non documentée) va écouter les différents événements spécifiés dans les
balises [Bindable] et lorsqu'elle en reçoit ce fameux événement, elle va relire
la propriété concernée et l'appliquer à tous les endroits où elle est utilisée
en tant que source.&lt;/p&gt;
&lt;p&gt;On peut voir facilement ce qu'il se passe si on utilise partout uniquement
la balise [Bindable] simple.&lt;br /&gt;
Imaginons une classe disposant de 10 propriétés [Bindable] (sans event
spécifié). Imaginons également que ces dix propriétés sont utilisées deux fois
chacune en tant que source via la binding. Lorsqu'une propriété va changer, un
événement &lt;em&gt;PropertyChangeEvent.PROPERTY_CHANGE&lt;/em&gt; va être diffusé pour
signaler ce changement. Hors, chaque propriété étant liée au même événement
(propertyChange, le type d'évenement généré par défaut), Flex va faire appel
aux getter de chaque propriété, et appliquer les modifications (qui en
l'occurrence n'ont pas eu lieu sur 9 d'entre elles) sur la totalité des 20
bindings, avec toute la procédure qui s'ensuit, soit le calcul du layout et le
dessin des différents éléments affectés. &lt;em&gt;Pour ne pas être alarmiste non
plus, la plupart des setters bien fait évitent de provoquer une action si la
nouvelle valeur qu'on lui affecte est la même que l'ancienne valeur, et le
processus d'invalidation permet de ne redessiner qu'une fois un composant dont
on change plusieurs propriétés.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;C'est pourquoi pour soulager l'application, il est très important de:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;définir ses propriétés de binding sous la forme
&lt;strong&gt;[Bindable(event=&amp;quot;&lt;em&gt;eventName&lt;/em&gt;&amp;quot;)]&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;définir &lt;strong&gt;un événement de binding différent par propriété&lt;/strong&gt;
(ou par groupes de propriétés analogues)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Les bindings sont pratiques et sexys: par une simple affectation dans un
fichier XML (ou création d'un binding avec BindingUtils), on arrive a faire
interagir deux entités Flex facilement. Mais attention à ne pas provoquer une
cascade d'instructions lourdes à l'exécution sur une action bénigne! C'est pour
cela qu'il est important de savoir le fonctionnement du binding et ses
conséquences.&lt;br /&gt;
&lt;strong&gt;Parfois, s'en tenir au schéma EventDispatcher.addEventListener est
largement suffisant&lt;/strong&gt; &lt;img src=&quot;http://common.lalex.com/themes/devblog/smilies/icon_wink.gif&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.lalex.com/post/2008/09/03/Pratiques-Flex-les-bindings#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2008/09/03/Pratiques-Flex-les-bindings#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/rss2/comments/799</wfw:commentRss>
      </item>
    
  <item>
    <title>Flex et/ou les frameworks: pas tout le temps, pas n'importe comment</title>
    <link>http://blog.lalex.com/post/2008/08/29/Flex-et-les-frameworks-pas-tout-le-temps-pas-n-importe-comment</link>
    <guid isPermaLink="false">urn:md5:ebffe874cb9fc5b30cdf98c9dc9fdd27</guid>
    <pubDate>Fri, 29 Aug 2008 13:07:00 +0200</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>Divers</category>
            
    <description>&lt;p&gt;La demande est forte en ce moment sur le développement Flex.&lt;/p&gt;
&lt;p&gt;Flex a cet espèce d'aura de &amp;quot;vrai outil pour les pros&amp;quot;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;de ceux qu'on confie à des SSII, blindées d'ingénieurs qu'il font du code
sérieux vous comprenez....&lt;/li&gt;
&lt;li&gt;de ceux que les freelances proposent pour faire plus expert, parce qu'ils
ont déjà affiché un item qui change quand on sélectionne une entrée dans un
Combo Box, et qu'ils n'ont pas envie de recoder un bouton dans un site liquide
redimensionnable...&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Si j'écris ce billet, c'est parce que je me retrouve tout à tour devant ces
deux situations.&lt;/p&gt;    &lt;p&gt;Seulement voilà, ce type de développement Flex, lorsqu'il a besoin d'être
repris par un développeur autre que le développeur d'origine, peut poser des
problèmes différents selon celle des deux situations citées plus haut qui se
présente - la troisième, qui a priori ne pose aucun problème, étant le
développement de l'application par un codeur Flex expérimenté pas trop attaché
aux usines a gaz &lt;img src=&quot;http://common.lalex.com/themes/devblog/smilies/icon_wink.gif&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Le développement par une SSII&lt;/h3&gt;
&lt;p&gt;La plupart des ingénieurs en développement sont formés sur des langages type
Java ou .NET. Quand je me parle à moi-même (et oui, ca m'arrive), j'appelle ca
des langages &amp;quot;non-visuels&amp;quot;. Ces langages disposent d'un framework extrêmement
développé, sans compter le nombre de frameworks annexes(type Spring, MINA,
etc..), utilisés par tellement de monde que c'est comme s'ils étaient natifs au
système et disposent d'un support énorme par la communauté.&lt;/p&gt;
&lt;p&gt;Ces développeurs reproduisent naturellement les mêmes mécanismes quand ils
se retrouvent dans un environnement Flex et utilisent le premier framework qui
passe et qui ressemble à ce dont ils pensent avoir besoin. Je dis bien ils
pensent, car l'utilisation de ces frameworks revient souvent à compliquer une
architecture qui n'en a pas besoin. Cela permet la plupart du temps au
développeur de retrouver un environnement de développement qui lui est familier
concernant le MVC, ou l'utilisation de connecteurs plus &amp;quot;standards&amp;quot; (j'entends
par là standard à leur langage de prédilection) pour la récupération de données
(WebService la plupart du temps).&lt;br /&gt;
La formation ou le transfert de compétence étant le plus souvent effectuée par
la première personne qui a initié le projet, cela ne semble poser de problème à
personne. Sauf si l'on pense au fait qu'une fois le produit livré, ça laisse
difficilement la possibilité au client final de confier la maintenance ou
l'évolution du produit à un autre prestataire, a moins que le doc soit vraiment
extrêmement complète - ce qui, avouons le, est très rare: une bonne doc (ASDoc
+ doc rédigé) prenant beaucoup de temps, ce que peuvent rarement se permettre
les prestataires s'ils veulent respecter leur délais sans facturer la partie
documentation.&lt;/p&gt;
&lt;p&gt;Le problème là n'est pas lié à Flex, mais bien à la philosophie SSII (la
plus répandue en tout cas): des ingénieurs parlent aux ingénieurs. Et étant
donné que Flex commence à être vu, comme je le disais, comme un outil
&amp;quot;serieux&amp;quot;, les SSII sont de plus en plus sollicitées sur cette technologie,
mais pour des clients &amp;quot;web&amp;quot;, dont la politique n'est pas de se retrouver pieds
et mains liées à cause de choix technologiques du prestataire.&lt;/p&gt;
&lt;h3&gt;Les prestataires peu expérimentés&lt;/h3&gt;
&lt;p&gt;Suite à un &lt;a href=&quot;http://blog.lalex.com/post/2004/06/30/Marre-des-codeurs-la-petite-semaine&quot;&gt;assez vieux post&lt;/a&gt;,
j'ai été considérés par certain comme un élitiste casseur de débutants, alors
que le message que je désire faire passer est qu'il faut seulement essayer de
faire ce que l'on sait, et apprendre ce que l'on ne sait pas.&lt;br /&gt;
En tant que codeur AS2, mon passage à l'AS3 s'est fait via Flex2, avant que ne
sorte Flash CS3. J'ai eu l'immense chance à ce moment là de faire partie d'une
entreprise pour laquelle le projet que je devais réaliser avait un besoin
impératif d'une conception propre, quitte à passer beaucoup de temps à étudier
le framework Flex avant de commencer à coder l'application. J'ai donc passé
beaucoup de temps en R&amp;amp;D avant de passer en production, ce qui m'a permis
d'apprendre beaucoup de mes tests et erreurs.&lt;/p&gt;
&lt;p&gt;Flex a ce côté séduisant du fait que pas mal de choses peuvent sembler se
faire toutes seules: positionnement, binding, navigation, composants... Mais il
faut malgré tout en connaître le fonctionnement précis pour, par
exemple:&lt;br /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ne pas utiliser une gestion des states avec manipulation de la display list
là où une ViewStack est plus indiquée...&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;ne pas utiliser un binding là ou un simple événement suffit...&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;ne pas utiliser un (Binding) là où un (Binding(event=&amp;quot;..&amp;quot;)) sera bien plus
performant... &lt;em&gt;(les crochets passent mal sur Dotclear)&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;C'est pourquoi le seul conseil que je peux donner ici est de ne pas se
lancer dans un projet qui est au delà de ses compétences
&lt;strong&gt;actuelles&lt;/strong&gt;. L'auto formation est une excellente chose et je ne
jure que par elle, mais pour un freelance, c'est selon moi un manque de respect
au client que de vendre une prestation qui a 9 chances sur 10 d'être plus ou
moins bancale (par exemple, je préviens systématiquement mes clients si je n'ai
pas la compétence/expérience sur une techno précise, quitte a refuser le
contrat).&lt;br /&gt;
Cela en plus complique la tache d'un éventuel autre prestataire qui aurait
besoin d'assurer la maintenance ou l'évolution du produit: c'est donc aussi pas
très cool pour les collègues...&lt;br /&gt;
Je parle bien ici précisément de Flex: rien a voir avec le fait d'accepter de
coder un diaporama sans en avoir jamais fait: il s'agit bien là d'un framework
complet et de toute la philosophie de développement qui lui est attaché, ainsi
que de ses outils.&lt;/p&gt;
&lt;h3&gt;Les frameworks en général&lt;/h3&gt;
&lt;p&gt;Beaucoup de développeurs de haut-niveau se sont essayés, souvent avec
succès, au développement d'un framework open-source... Rappelons d'ailleurs que
Flex n'est &amp;quot;qu'un&amp;quot; framework AS3, auquel est associé un &amp;quot;traducteur&amp;quot;
MXML-&amp;gt;AS3. Ces frameworks permettent de faire plus de choses, ou
d'encapsuler un certain nombre de comportements communs. Que ce soit une
implémentation du MVC, une couche d'accès aux données ou tout autre
fonctionnalité, ces frameworks disposent pour chacun d'une philosophie de
développement propre à son concepteur ou à ceux qui ont adhéré au
framework.&lt;/p&gt;
&lt;p&gt;Ce qui veut dire également que ceux qui n'ont pas adhéré au framework se
voient affronter un mode de développement complètement différent de la
technologie qu'ils pratiquent, pour laquelle ils se sont déjà formés. Alors
s'il s'agit d'un &lt;a href=&quot;http://projects.simb.net/easyMVC/&quot; hreflang=&quot;en&quot;&gt;easyMVC&lt;/a&gt; (7 classes) ou d'un &lt;a href=&quot;http://opensource.adobe.com/wiki/display/cairngorm/About&quot; hreflang=&quot;en&quot;&gt;cairngorm&lt;/a&gt;(22 classes), ca peut encore aller. Mais s'il s'agit d'un
&lt;a href=&quot;http://www.servebox.com/foundry/doku.php&quot; hreflang=&quot;en&quot;&gt;servebox
foundry&lt;/a&gt; (121 classes en comptant commons+foudry+toolbox), d'un &lt;a href=&quot;http://vegas.googlecode.com/&quot; hreflang=&quot;en&quot;&gt;VEGAS&lt;/a&gt; (171 classes) ou autre
&lt;a href=&quot;http://osflash.org/projects/lowra&quot; hreflang=&quot;en&quot;&gt;lowRIA&lt;/a&gt; (265
classes), ça commence a faire usine à gaz...&lt;br /&gt;
Et quels que soit les avantages et inconvénients de chacun de ces frameworks,
il est à chaque fois obligatoire de se conformer à la philosophie de
développement de chacun sous peine de perdre tout l'intérêt des les
utiliser.&lt;/p&gt;
&lt;p&gt;Bref, je dirais que l'utilisation d'un framework &amp;quot;propriétaire&amp;quot; dans le
cadre d'un framework agence ou de projets perso peut être une excellente chose:
il peut correspondre ainsi à un goût pour tel ou tel mode de travail, ou
devenir une politique d'entreprise dans le cas des agences. Mais pour un
prestataire qui sait que ce projet va lui échapper, je pense que ce n'est
certainement pas une bonne idée: non pas pour son propre travail, mais pour
ceux qui peuvent être amenés ensuite à intervenir sur le projet.&lt;/p&gt;
&lt;p&gt;Et moi en tant que prestataire aujourd'hui, faudrait-il que je maîtrise
l'ensemble des frameworks les plus courants pour pouvoir accepter les missions
que l'on veut me confier? Ce serait l'idéal, mais travail+R&amp;amp;D+sommeil sont
rarement tous les 3 compatibles! &lt;img src=&quot;http://common.lalex.com/themes/devblog/smilies/icon_razz.gif&quot; alt=&quot;:P&quot; class=&quot;smiley&quot; /&gt;&lt;br /&gt;
Et faire de la R&amp;amp;D pour maîtriser un framework qui ne me permet pas de
faire plus de choses que ce que j'aurais fait sans, je dois avouer que ça me
rebute un peu...&lt;/p&gt;
&lt;p&gt;Et puis quand je livre un client, je fais systématiquement en sorte qu'il ne
soit pas &amp;quot;verrouillé&amp;quot;. C'est avec j'avoue un peu de fierté que je dis en
général à mes clients qu'ils peuvent faire appel a n'importe quel prestataire
compétent dans la technologie (Flash ou Flex) pour prendre la suite, sans
requis supplémentaires. C'est bien plus pratique pour tout le monde: le client
ne se sent pas prisonnier d'un prestataire, et je ne culpabilise pas de ne pas
pouvoir assurer la maintenance si mon emploi du temps ne me le permets pas car
je sais qu'un autre prestataire pourra le faire facilement.&lt;/p&gt;
&lt;p&gt;Pour finir, je rappelle que les Design Patterns sont une solution générique
pour un problème précis, généralement pour des problèmes que l'on rencontre
souvent dans du développement Objet. Cela veut aussi dire qu'il ne sert à rien
de les utiliser si le problème ne se pose pas! Un MVC avec une seule vue et un
seul contrôleur est par exemple totalement inutile, et pourtant j'en vois si
souvent... Car évidemment, quelqu'un qui utilise un framework qu'il aime
pratiquer en vient à l'utiliser systématiquement, même quand il n'est pas
nécessaire...&lt;/p&gt;
&lt;p&gt;--&lt;/p&gt;
&lt;p&gt;Si j'ai le temps et la foi suffisante, j'essaierai de faire un ticket sur un
ensemble de pratiques &lt;strong&gt;personnelles&lt;/strong&gt; en Flex, qui se sont
avérées être efficaces et productives &lt;strong&gt;sur le terrain&lt;/strong&gt;, qui
grâce aux commentaires pourraient être débattues et enrichies.&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.lalex.com/post/2008/08/29/Flex-et-les-frameworks-pas-tout-le-temps-pas-n-importe-comment#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2008/08/29/Flex-et-les-frameworks-pas-tout-le-temps-pas-n-importe-comment#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/rss2/comments/796</wfw:commentRss>
      </item>
    
  <item>
    <title>Tips: Angles et géométrie</title>
    <link>http://blog.lalex.com/post/2008/06/20/Angles-et-geometrie</link>
    <guid isPermaLink="false">urn:md5:9e2b41c46d1474bd55e197acaf4e2d1b</guid>
    <pubDate>Fri, 20 Jun 2008 13:45:00 +0200</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>AS3 / Flex2</category>
            
    <description>    &lt;p&gt;Je suis actuellement en train de me bruler les neurones sur un éditeur,
permettant entre autres de modifier un visuel à la souris. De quoi devoir
replonger dans nos bonnes vieilles notions de trigo.&lt;br /&gt;
J'en profite donc pour donner ici 2-3 astuces&lt;/p&gt;
&lt;h4&gt;Rotation d'un point&lt;/h4&gt;
&lt;p&gt;Pour passer d'un point (x, y) à un autre (x', y') en lui appliquant une
rotation d'angle a, l'équation est la suivante:&lt;br /&gt;&lt;/p&gt;
&lt;pre&gt;
        x' = x*cos(a) - y*sin(a)
        y' = x*sin(a) + y*cos(a)
&lt;/pre&gt;
&lt;p&gt;Ce qui nous donne un petite méthode AS3:&lt;/p&gt;
&lt;code class=&quot;actionscript&quot;&gt;&lt;span style=&quot;color: #0066CC;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; rotatePoint&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;point : Point, angle : &lt;span style=&quot;color: #0066CC;&quot;&gt;Number&lt;/span&gt;, isRadian : &lt;span style=&quot;color: #0066CC;&quot;&gt;Boolean&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; : Point &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;ang == &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; point.&lt;span style=&quot;color: #006600;&quot;&gt;clone&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; radAngle : &lt;span style=&quot;color: #0066CC;&quot;&gt;Number&lt;/span&gt; = isRadian ? angle : angle * &lt;span style=&quot;color: #0066CC;&quot;&gt;Math&lt;/span&gt;.&lt;span style=&quot;color: #0066CC;&quot;&gt;PI&lt;/span&gt; / &lt;span style=&quot;color: #cc66cc;&quot;&gt;180&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; angleCos : &lt;span style=&quot;color: #0066CC;&quot;&gt;Number&lt;/span&gt; = &lt;span style=&quot;color: #0066CC;&quot;&gt;Math&lt;/span&gt;.&lt;span style=&quot;color: #0066CC;&quot;&gt;cos&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;radAngle&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; angleSin : &lt;span style=&quot;color: #0066CC;&quot;&gt;Number&lt;/span&gt; = &lt;span style=&quot;color: #0066CC;&quot;&gt;Math&lt;/span&gt;.&lt;span style=&quot;color: #0066CC;&quot;&gt;sin&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;radAngle&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Point&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;point.&lt;span style=&quot;color: #006600;&quot;&gt;x&lt;/span&gt; * angleCos - point.&lt;span style=&quot;color: #006600;&quot;&gt;y&lt;/span&gt; * angleSin, point.&lt;span style=&quot;color: #006600;&quot;&gt;x&lt;/span&gt; * angleSin + point.&lt;span style=&quot;color: #006600;&quot;&gt;y&lt;/span&gt; * angleCos&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/code&gt;
&lt;p&gt;Notez que l'on peut passer cette méthode un angle en degré (par défaut) ou
en radians.&lt;/p&gt;
&lt;h4&gt;Angle fait par un vecteur&lt;/h4&gt;
&lt;p&gt;L'AS3 nous fournit une méthode toute prête: &lt;em&gt;Math.atan2&lt;/em&gt;. Elle prend
en paramètre les coordonnées du vecteur (j'utilise un point dans l'exemple) et
retourne un angle en radian (d'où le flag &lt;em&gt;isRadian&lt;/em&gt; de la méthode
précédente).&lt;br /&gt;
&lt;ins&gt;Notez bien que la coordonnée &lt;em&gt;'y&lt;/em&gt;' est le premier argument&lt;/ins&gt;
(chez moi, FDT m'affiche 'x' en premier, je me suis fait avoir au début)&lt;/p&gt;
&lt;code class=&quot;actionscript&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; vector : Point = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Point&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;mouseX, mouseY&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; angRadian : &lt;span style=&quot;color: #0066CC;&quot;&gt;Number&lt;/span&gt; = &lt;span style=&quot;color: #0066CC;&quot;&gt;Math&lt;/span&gt;.&lt;span style=&quot;color: #0066CC;&quot;&gt;atan2&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;vector.&lt;span style=&quot;color: #006600;&quot;&gt;y&lt;/span&gt;, vector.&lt;span style=&quot;color: #006600;&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/code&gt;
&lt;h4&gt;Normaliser un angle&lt;/h4&gt;
&lt;p&gt;Selon les besoins, il peut être nécessaire d'utiliser systématiquement un
angle entre 0 et 360, ou entre -180 et 180. Avec les modulos, cela peut se
faire facilement:&lt;/p&gt;
&lt;code class=&quot;actionscript&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Get a random number between -1500 and 1500&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; angle : &lt;span style=&quot;color: #0066CC;&quot;&gt;Number&lt;/span&gt; = &lt;span style=&quot;color: #0066CC;&quot;&gt;Math&lt;/span&gt;.&lt;span style=&quot;color: #0066CC;&quot;&gt;random&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; * &lt;span style=&quot;color: #cc66cc;&quot;&gt;3000&lt;/span&gt; - &lt;span style=&quot;color: #cc66cc;&quot;&gt;1500&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Normalize angle between 0 and 360&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; angleIn360 : &lt;span style=&quot;color: #0066CC;&quot;&gt;Number&lt;/span&gt; = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;angle % &lt;span style=&quot;color: #cc66cc;&quot;&gt;360&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; + &lt;span style=&quot;color: #cc66cc;&quot;&gt;360&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; % &lt;span style=&quot;color: #cc66cc;&quot;&gt;360&lt;/span&gt;;&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Normalize angle between -180 and 180&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; angleIn180 : &lt;span style=&quot;color: #0066CC;&quot;&gt;Number&lt;/span&gt; = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;angle % &lt;span style=&quot;color: #cc66cc;&quot;&gt;360&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; + &lt;span style=&quot;color: #cc66cc;&quot;&gt;540&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; % &lt;span style=&quot;color: #cc66cc;&quot;&gt;360&lt;/span&gt; - &lt;span style=&quot;color: #cc66cc;&quot;&gt;180&lt;/span&gt;;&lt;/code&gt;
&lt;p&gt;---&lt;/p&gt;
&lt;p&gt;Voilà pour les ch'tites astuces de l'oncle LAlex &lt;img src=&quot;http://common.lalex.com/themes/devblog/smilies/icon_razz.gif&quot; alt=&quot;:P&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.lalex.com/post/2008/06/20/Angles-et-geometrie#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2008/06/20/Angles-et-geometrie#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/rss2/comments/792</wfw:commentRss>
      </item>
    
  <item>
    <title>Do you speak english? Yes, I speak dummies english...</title>
    <link>http://blog.lalex.com/post/2008/05/26/Do-you-speak-english-Yes-I-speak-dummies-english</link>
    <guid isPermaLink="false">urn:md5:685bc1c8bb281cb264f8ab937f07b3bf</guid>
    <pubDate>Mon, 26 May 2008 20:03:00 +0200</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>Liens</category>
            
    <description>&lt;p&gt;Dans la famille &amp;quot;J'me la pête international&amp;quot;, je doit être le fiston!&lt;br /&gt;
Eh oui, je cède finalement aux sirènes de la langue de Shakespeare (enfin, il
doit se retourner dans sa tombe un peu, quand-même) et ouvre mon ch'tit blog en
Anglais : &lt;a href=&quot;http://www.applicationdomain.net/&quot; hreflang=&quot;en&quot;&gt;ApplicationDomain.net&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;    &lt;p&gt;Le but est de pouvoir échanger facilement avec plus de monde, et de la jouer
moins &amp;quot;nombril&amp;quot;, parce qu'il faut bien le dire, au vu de la fréquence et du
contenu de mes dernières contributions: je baisse!&lt;br /&gt;
Donc, en terme de contenu, je prévois &lt;strong&gt;de l'AS3 uniquement&lt;/strong&gt;: des
articles sur certains modes de programmation, des outils (IDE, Workflow,
etc...), du code bien sûr mais a priori plus complet que de simples tips, du
Flex, du AIR, etc...&lt;br /&gt;
J'espère arriver à me limiter à du plus abouti que ces derniers temps: en gros,
j'évite les liens vers les articles que tout le monde a lu 10 fois, les news
qu'on a lu 100 fois, la demi-ligne de code que j'ai pondu la veille,
etc...&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Un seul petit article est là pour l'instant, sur l'installation de FDT pour
le Flash Player 10.&lt;br /&gt;
Je n'ai trouvé qu'un seul article en Russe traduit via Google translations, et
qui en plus utilise le playerglobal.swc d'une ancienne beta de Flash CS4 au
lieu de celui, évidemment plus récent, des nightly builds de Flex 4...&lt;/p&gt;
&lt;p&gt;Pour ce qui est du contenu restant sur ce blog (ne fuyez pas tout de suite),
je continuerai a proposer les astuces de code (dont je suis moi-même friand
chez les autres), le PHP, les coups de gueule voire eventuellement des liens
vers les sites qui m'ont plu (mais ca &lt;a href=&quot;http://www.hebiflux.com/blog/&quot; hreflang=&quot;fr&quot;&gt;HebiFlux&lt;/a&gt; le fait quand-même mieux que personne), et bien sur
des liens vers les articles super top de &lt;a href=&quot;http://www.applicationdomain.net/&quot; hreflang=&quot;en&quot;&gt;ApplicationDomain&lt;/a&gt;...
:p&lt;/p&gt;
&lt;p&gt;Et pour ceux qui vont me sortir que le theme ressemble vachement a celui de
l'ami &lt;a href=&quot;http://www.tweenpix.net/&quot; hreflang=&quot;fr&quot;&gt;Francis BOURRE&lt;/a&gt;, je
répondrai: oui!&lt;br /&gt;
J'avais fini la modification de ce thème 2 jours avant qu'il ne relance
tweenpix, et je n'ai pas eu la foi suffisante pour chercher autre chose...&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.lalex.com/post/2008/05/26/Do-you-speak-english-Yes-I-speak-dummies-english#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2008/05/26/Do-you-speak-english-Yes-I-speak-dummies-english#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/rss2/comments/438</wfw:commentRss>
      </item>
    
  <item>
    <title>Flash Player Security Update</title>
    <link>http://blog.lalex.com/post/2008/04/10/Flash-Player-Security-Update</link>
    <guid isPermaLink="false">urn:md5:52dd0bf81e5b8f7a0a7bcce2ed3d2046</guid>
    <pubDate>Thu, 10 Apr 2008 16:39:00 +0200</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>Liens</category>
            
    <description>    &lt;p&gt;Pour info, la nouvelle version du Flash Player, orientée sécurité, est
maintenant disponible. Estampillée &lt;a href=&quot;http://www.macromedia.com/go/getflash&quot;&gt;Flash Player 9.0.124&lt;/a&gt;, elle fixe pas
moins de 7 failles, dont celle qui avait permis à un pirate de prendre
possession d'un système OSX.&lt;/p&gt;
&lt;p&gt;Dnas la même lignée, &lt;a href=&quot;http://get.adobe.com/air/&quot;&gt;Adobe AIR
1.0.1&lt;/a&gt;, qui intégre ces même corrections, est également disponible.&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.lalex.com/post/2008/04/10/Flash-Player-Security-Update#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2008/04/10/Flash-Player-Security-Update#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/rss2/comments/434</wfw:commentRss>
      </item>
    
  <item>
    <title>JSFL mon amour...</title>
    <link>http://blog.lalex.com/post/2007/12/30/JSFL-mon-amour</link>
    <guid isPermaLink="false">urn:md5:72b970ff0990f128311388e8d334dbf0</guid>
    <pubDate>Mon, 31 Mar 2008 17:30:00 +0200</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>AS3 / Flex2</category>
            
    <description>&lt;p&gt;&lt;a href=&quot;http://www.envrac.org/index.php/2006/03/25/62-le-jsfl-c-est-bon-mangez-en&quot; hreflang=&quot;fr&quot;&gt;L'équipe d'envrac avait prévenu&lt;/a&gt;, mais je suis en train de
doucement glisser vers la dépendance au JSFL...&lt;/p&gt;
&lt;p&gt;Un p'tit langage qui permet de scripter l'IDE et ainsi de raccourcir
drastiquement les taches répétitives, c'est quand-même du pain béni pour peu
qu'on prenne le temps de s'y pencher. Pas encore interessé aux panneaux
&amp;quot;custom&amp;quot;, j'ai pondu quelques petites déclinaisons d'un script inspiré par une
ancienne collègue - si tu te reconnais, un paquet de Carambars &lt;img src=&quot;http://common.lalex.com/themes/devblog/smilies/icon_wink.gif&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt; - et qui
facilite grandement l'intégration timeline/code (un petit article prévu la
dessus dés que je lève un peu la tête des mes projets et que je me défénéantise
en ce qui concerne ce blog).&lt;/p&gt;
&lt;p&gt;Bref, ceci est un ensemble de 4 scripts JSFL qui font le tour des instances
nommées dans un clip, et affiche dans le panneau de sortie les déclarations AS3
de celles-ci : je ne parlerais pas ici de la quasi obligation morale qui
nous incombe à tous de décocher la case &amp;quot;Déclarer automatiquement les instances
etc...&amp;quot; si vous êtes pas des trouillards... :p&lt;/p&gt;    &lt;p&gt;Plusieurs déclinaisons donc:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;quot;&lt;ins&gt;Lazy Timeline Variables&lt;/ins&gt;&amp;quot;: affiche les déclarations sour forme
&lt;em&gt;public var monClip:MonClip;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&amp;quot;&lt;ins&gt;Lazy Timeline GetSet&lt;/ins&gt;&amp;quot;: même chose, mais déclare les variables
en mode &lt;em&gt;private&lt;/em&gt; préfixées avec un underscore, ainsi que les
getter/setter publics corrspondant (pratique si vous voulez détecter l'ajout
d'un clip à la timeline, sans attendre un Event.ADDED puis un
Event.RENDER)...&lt;/li&gt;
&lt;li&gt;&amp;quot;&lt;ins&gt;Lazy Selected Variables&lt;/ins&gt;&amp;quot;/&amp;quot;&lt;ins&gt;Lazy Selected GetSet&lt;/ins&gt;&amp;quot;:
même chose que les deux précédents, mais uniquement pour les instances
sélectionnées dans l'IDE: pratique quand on a déjà utilisés les précédents,
mais qu'on a rajouté une instance entre temps...&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A savoir que chacun de ces scripts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Utilise les classes renseignées dans l'IDE: en gros, si les éléments ne
sont pas exportés pour AS dans la bibliothèque, c'est MovieClip ou SimpleButton
qui seront utilisés, sinon, c'est soit la BaseClass, soit la classe elle-même
qui seront utilisées.&lt;/li&gt;
&lt;li&gt;Copie ces déclarations dans le clipboard, pour qu'il n'y ai plus qu'un
&amp;quot;coller&amp;quot; à faire dans le vrai environnement de développement que vous utilisez
certainement! &lt;img src=&quot;http://common.lalex.com/themes/devblog/smilies/icon_wink.gif&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Ces scripts se décompressent dans le répertoire &lt;em&gt;~/Library/Application
Support/Adobe/Flash CS3/en/Configuration/Commands&lt;/em&gt; (sur Mac, vous trouverez
l'équivalent sur Windows), et deviennent accessibles depuis Flash dans le menu
&amp;quot;Commandes&amp;quot;...&lt;/p&gt;
&lt;p&gt;Pour le petit exemple de &lt;em&gt;&amp;quot;Lazy Timeline GetSet&amp;quot;&lt;/em&gt; pour 2 boutons:&lt;/p&gt;
&lt;code class=&quot;actionscript&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/* JSFL Example*/&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Private timeline properties&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; _upButton:MinimalButton;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; _downButton:MinimalButton;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Public timeline getters/setters&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;set&lt;/span&gt; upButton&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;displayObject: MinimalButton&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; : &lt;span style=&quot;color: #0066CC;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _upButton = displayObject;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Rajouté a posteriori&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _upButton.&lt;span style=&quot;color: #006600;&quot;&gt;addEventListener&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;MouseEvent.&lt;span style=&quot;color: #006600;&quot;&gt;CLICK&lt;/span&gt;, upButtonClickHandler&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; upButtonClickHandler&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;event : MouseEvent&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; : &lt;span style=&quot;color: #0066CC;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;trace&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Up clicked&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;get&lt;/span&gt; upButton&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; : &lt;span style=&quot;color: #0066CC;&quot;&gt;MovieClip&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; _upButton;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;set&lt;/span&gt; downButton&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;displayObject: MinimalButton&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; : &lt;span style=&quot;color: #0066CC;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _downButton = displayObject;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Rajouté a posteriori&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _downButton.&lt;span style=&quot;color: #006600;&quot;&gt;addEventListener&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;MouseEvent.&lt;span style=&quot;color: #006600;&quot;&gt;CLICK&lt;/span&gt;, downButtonClickHandler&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; downButtonClickHandler&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;event : MouseEvent&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; : &lt;span style=&quot;color: #0066CC;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;trace&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Down clicked&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;get&lt;/span&gt; downButton&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; : &lt;span style=&quot;color: #0066CC;&quot;&gt;MovieClip&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; _downButton;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/code&gt;
&lt;p&gt;Tous ces zoulis scripts sont téléchargeables: &lt;a href=&quot;http://download.lalex.com/devblog/LazyScripts.zip&quot; hreflang=&quot;fr&quot;&gt;LazyScripts.zip&lt;/a&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.lalex.com/post/2007/12/30/JSFL-mon-amour#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2007/12/30/JSFL-mon-amour#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/rss2/comments/433</wfw:commentRss>
      </item>
    
  <item>
    <title>Les composants, c'est pour les graphistes!</title>
    <link>http://blog.lalex.com/post/2008/03/18/Les-composants-cest-pour-les-graphistes</link>
    <guid isPermaLink="false">urn:md5:ed4cdef0ef0ef5d080f19448f7a19891</guid>
    <pubDate>Tue, 18 Mar 2008 20:09:00 +0100</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>AS3 / Flex2</category>
            
    <description>    &lt;p&gt;... qu'y disent! Eh ben, non madame, c'est bien pour les codeurs aussi!&lt;/p&gt;
&lt;p&gt;Prenons totalement au hasard un exemple de petite classe utilitaire de debug
pour afficher le framerate et la mémoire utilisée: et bien c'est quand-même
bien plus pratique de déposer un petit composant sur sa scène plutôt que de se
frapper un 'new FramerateViewer()' dans une DocumentClass quand-même... Et ca
se fait tout aussi vite!&lt;br /&gt;
Et que même si on veut mettre une icone et tout et tout, ca prend bien 2mn de
plus! &lt;img src=&quot;http://common.lalex.com/themes/devblog/smilies/icon_razz.gif&quot; alt=&quot;:P&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Allez, l'exemple en pratique: &lt;a href=&quot;http://download.lalex.com/devblog/Framerate.swc&quot; hreflang=&quot;en&quot;&gt;Framerate.swc&lt;/a&gt; &lt;img src=&quot;http://common.lalex.com/themes/devblog/smilies/icon_wink.gif&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;
&lt;p&gt;PS: Merci &lt;a href=&quot;http://www.famfamfam.com/&quot; hreflang=&quot;en&quot;&gt;famfamfam&lt;/a&gt;
pour l'icone&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.lalex.com/post/2008/03/18/Les-composants-cest-pour-les-graphistes#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2008/03/18/Les-composants-cest-pour-les-graphistes#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/rss2/comments/432</wfw:commentRss>
      </item>
    
  <item>
    <title>Des fois, on s'demande....</title>
    <link>http://blog.lalex.com/post/2008/03/17/Des-fois-on-sdemande</link>
    <guid isPermaLink="false">urn:md5:9d89bcbf44196524059750d0461f0891</guid>
    <pubDate>Mon, 17 Mar 2008 17:28:00 +0100</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>Divers</category>
            
    <description>    &lt;blockquote&gt;
&lt;p&gt;1046: Type was not found or was not a compile-time constant: MovieClip.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;No comment...&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.lalex.com/post/2008/03/17/Des-fois-on-sdemande#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2008/03/17/Des-fois-on-sdemande#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/rss2/comments/431</wfw:commentRss>
      </item>
    
  <item>
    <title>Flex 3, AIR 1.0, etc...</title>
    <link>http://blog.lalex.com/post/2008/02/25/Flex-3-AIR-10-etc</link>
    <guid isPermaLink="false">urn:md5:30e0d7a72d093b23fa39bf7417b30e4a</guid>
    <pubDate>Mon, 25 Feb 2008 12:58:00 +0100</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>AS3 / Flex2</category>
            
    <description>    &lt;p&gt;Ca y est! Les blougs du monde entier l'ont déjà dit, le &lt;a href=&quot;http://www.adobe.com/products/flex/&quot; hreflang=&quot;fr&quot;&gt;Flex 3 SDK&lt;/a&gt;, première
release OpenSource de Flex et &lt;a href=&quot;http://www.adobe.com/products/air/&quot; hreflang=&quot;fr&quot;&gt;Adobe AIR&lt;/a&gt;, la saint graal gratuit des développeurs de RDA
(Rich Desktop Applications, bande d'inclutes), sont sortis!&lt;/p&gt;
&lt;p&gt;Tout ca semble extremement prometteur.&lt;br /&gt;
Je ne vais pas faire la liste des features, mais juste mettre le doigt sur un
enorme point positif de cette release: la disponibilité des sources de &lt;a href=&quot;http://opensource.adobe.com/svn/opensource/flex/sdk/branches/3.0.x/frameworks/projects/rpc/src/mx/rpc/soap/&quot; hreflang=&quot;fr&quot;&gt;la classe WebService de Flex&lt;/a&gt;! Le passage a l'AS3 avait tout
simplement zappé cette classe dans Flash CS3.&lt;/p&gt;
&lt;p&gt;Maintenant, reste à voir s'il est possible de se servir de celle-ci sans se
trimbaler la moitié du framework Flex...&lt;br /&gt;
Si je trouve le temps de faire des tests, j'en donnerai le resultat ici...
&lt;img src=&quot;http://common.lalex.com/themes/devblog/smilies/icon_wink.gif&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.lalex.com/post/2008/02/25/Flex-3-AIR-10-etc#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2008/02/25/Flex-3-AIR-10-etc#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/rss2/comments/430</wfw:commentRss>
      </item>
    
  <item>
    <title>Pathfinding A-star sur bitmap</title>
    <link>http://blog.lalex.com/post/2008/02/21/Pathfinding-A-star-sur-Bitmap</link>
    <guid isPermaLink="false">urn:md5:f7b21ba36192528f51d92952c746b63a</guid>
    <pubDate>Thu, 21 Feb 2008 20:02:00 +0100</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>AS3 / Flex2</category>
            
    <description>&lt;p&gt;L'algorithme A* (A-star) connait de nombreuses implémentations. La plupart
utilisent une grille (tableau à deux dimensions) en tant que carte. Etant à la
base des jeux &amp;quot;tile-based&amp;quot;, celles-ci suffisent la plupart du temps à la grande
majorité des jeux. Seulement cela impose un certain nombre de contraintes,
notamment en terme de dimensions des &amp;quot;obstacles&amp;quot;, mais aussi en terme de
performances: l'algorythme se basant sur des noeux (nodes), une grille de 40/40
offre 1600 cases (maximum, l'A* n'étant pas exhaustif), ce qui est déjà bien
important...&lt;/p&gt;
&lt;p&gt;J'ai voulu essayer de me baser plutôt sur un bitmap, simple (pour
l'instant), une couleur étant celle du sol, l'autre celle des
obstacles :&lt;/p&gt;    &lt;div style=&quot;text-align:center;&quot;&gt;&lt;object type=&quot;application/x-shockwave-flash&quot; data=&quot;http://blog.lalex.com/public/bmpastar.swf&quot; width=&quot;600&quot; height=&quot;600&quot; id=&quot;BitmapAStar&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://blog.lalex.com/public/bmpastar.swf&quot; /&gt;
Ma jolie video&lt;/object&gt;&lt;/div&gt;
&lt;p&gt;En gros, l'appel de méthode utilisé ici est&lt;/p&gt;
&lt;code class=&quot;actionscript&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; bmp:BitmapData = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; BitmapData&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;400&lt;/span&gt;, &lt;span style=&quot;color: #cc66cc;&quot;&gt;400&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Génération d'un bitmap aléatoire: fillRect aléatoires, etc...&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; finder:BitmapAStar = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; BitmapAStar;&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; path: &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/*Point*/&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;Array&lt;/span&gt; = finder.&lt;span style=&quot;color: #006600;&quot;&gt;findPath&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;bmp, &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Point&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;5&lt;/span&gt;, &lt;span style=&quot;color: #cc66cc;&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;, &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Point&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;395&lt;/span&gt;, &lt;span style=&quot;color: #cc66cc;&quot;&gt;395&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/code&gt;
&lt;p&gt;L'A* n'a évidemment pas été le plus compliqué à mettre en oeuvre, mais c'est
bien l'analyse et le découpage de ce bitmap qui ont été difficiles à mettre en
place. Beaucoup de choses restent à faire malgré cette démo fonctionnelle,
notamment l'optimisation du placement des &amp;quot;portes&amp;quot; (ronds blancs sur
l'affichage &amp;quot;debug&amp;quot;), et des trajectoires (je pense notamment faire un lissage
du chemin à parcourir). D'autres fonctionnalités peuvent être envisagées, comme
la gestion des altitudes (terrain en pente, ou les falaises qui seraient des
portes à sens unique - qu'on peut sauter mais pas grimper) ou des types de
terrain (un malus associé à chaque couleur par exemple).&lt;/p&gt;
&lt;p&gt;Dans le plus ardu, on peut aussi imaginer un découpage des formes non
rectangulaires (polygones ou courbes).&lt;/p&gt;
&lt;p&gt;Une fois cleanées (l'API notamment) et optimisées, je mettrai les sources à
disposition sur ce blog... &lt;img src=&quot;http://common.lalex.com/themes/devblog/smilies/icon_wink.gif&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.lalex.com/post/2008/02/21/Pathfinding-A-star-sur-Bitmap#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2008/02/21/Pathfinding-A-star-sur-Bitmap#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/rss2/comments/429</wfw:commentRss>
      </item>
    
  <item>
    <title>Options d'une méthode &quot;Array-like&quot;</title>
    <link>http://blog.lalex.com/post/2008/02/20/Options-dune-methode-Array-like</link>
    <guid isPermaLink="false">urn:md5:37d5c1ba3ca6b3b0fe166584d7b7a9b9</guid>
    <pubDate>Wed, 20 Feb 2008 19:57:00 +0100</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>AS3 / Flex2</category>
            
    <description>&lt;p&gt;Un appel à une méthode paut parfois avoir besoin d'un certains nombre
&amp;quot;d'options&amp;quot;, comme c'est le cas pour la méthode &lt;em&gt;Array.sort&lt;/em&gt; par
exemple.&lt;/p&gt;
&lt;p&gt;Il existe alors plusieurs possibilités, la plus simple étant de proposer un
certain nombre de paramètres booléens facultatifs, avec des valeurs par défaut.
Le problème est tout d'abord que cela alourdit considérablement le code, mais
aussi que rajouter une option supplémentaire modifie la signature de la
méthode: si on travaille avec des interfaces, bonjour la galère).&lt;/p&gt;
&lt;p&gt;Bref, il existe aussi la possibilité de passer un seul entier, qui sera la
somme de puissances de 2. En gros, cela permet d'avoir, en binaire, une suite
de 0 et de 1, chacun correspondant à l'activation (ou pas) d'une option.&lt;br /&gt;
Voyons comment cela fonctionne concrètement avec l'exemple de
&lt;em&gt;Array.sort&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;Les différentes options de cette méthode ont toutes une valeur numérique
puissance de 2:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Array.CASEINSENSITIVE: valeur 1 (2 puissance 0)&lt;/li&gt;
&lt;li&gt;Array.DESCENDING : valeur 2 (2 puissance 1)&lt;/li&gt;
&lt;li&gt;Array.UNIQUESORT : valeur 4 (2 puissance 2)&lt;/li&gt;
&lt;li&gt;etc...&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Pour les utiliser, on se sert de l'opérateur OU binaire | (pipe simple) de
la manière suivante:&lt;/p&gt;
&lt;code class=&quot;actionscript&quot;&gt;myArray.&lt;span style=&quot;color: #0066CC;&quot;&gt;sort&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0066CC;&quot;&gt;Array&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;DESCENDING&lt;/span&gt; | &lt;span style=&quot;color: #0066CC;&quot;&gt;Array&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;UNIQUESORT&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/code&gt;
&lt;p&gt;&lt;br /&gt;
Pour utiliser ce système dans d'autres situations, j'ai développé une ch'tite
classe toute simple qui génère des options propres à chaque classe, et permet
de tester si une option donnée est donnée dont voici l'utilisation:&lt;/p&gt;
&lt;code class=&quot;actionscript&quot;&gt;package com.&lt;span style=&quot;color: #006600;&quot;&gt;lalex&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;utils&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;import&lt;/span&gt; flash.&lt;span style=&quot;color: #006600;&quot;&gt;display&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;BitmapData&lt;/span&gt;;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;import&lt;/span&gt; com.&lt;span style=&quot;color: #006600;&quot;&gt;lalex&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;utils&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;Options&lt;/span&gt;; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* @author LAlex&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; LAlexDemo &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Create options on the fly&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;static&lt;/span&gt; const SHOW_DEBUG : &lt;span style=&quot;color: #0066CC;&quot;&gt;int&lt;/span&gt; = Options.&lt;span style=&quot;color: #006600;&quot;&gt;create&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;LAlexDemo&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;static&lt;/span&gt; const SHOW_BORDER : &lt;span style=&quot;color: #0066CC;&quot;&gt;int&lt;/span&gt; = Options.&lt;span style=&quot;color: #006600;&quot;&gt;create&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;LAlexDemo&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;static&lt;/span&gt; const HIDE_FILL : &lt;span style=&quot;color: #0066CC;&quot;&gt;int&lt;/span&gt; = Options.&lt;span style=&quot;color: #006600;&quot;&gt;create&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;LAlexDemo&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; drawShape&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;bdt : BitmapData, options:&lt;span style=&quot;color: #0066CC;&quot;&gt;int&lt;/span&gt; = &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; : &lt;span style=&quot;color: #0066CC;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;Options.&lt;span style=&quot;color: #006600;&quot;&gt;hasOption&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;options, SHOW_DEBUG&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;trace&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;We will show debug infos&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;Options.&lt;span style=&quot;color: #006600;&quot;&gt;hasOption&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;options, SHOW_BORDER&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;trace&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;We will show shape's border&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;Options.&lt;span style=&quot;color: #006600;&quot;&gt;hasOption&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;options, HIDE_FILL&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;trace&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;We will hide shape's fill color&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Utilisation&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; demo:LAlexDemo = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; LAlexDemo;&lt;br /&gt;
demo.&lt;span style=&quot;color: #006600;&quot;&gt;drawShape&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;myBitmapData, LAlexDemo.&lt;span style=&quot;color: #006600;&quot;&gt;SHOW_DEBUG&lt;/span&gt; | LAlexDemo.&lt;span style=&quot;color: #006600;&quot;&gt;HIDE_FILL&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/code&gt;
&lt;p&gt;Voila, un p'tit clic pour télécharger &lt;a href=&quot;http://download.lalex.com/devblog/Options_class.zip&quot; hreflang=&quot;fr&quot;&gt;com.lalex.utils.Options&lt;/a&gt; &lt;img src=&quot;http://common.lalex.com/themes/devblog/smilies/icon_wink.gif&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.lalex.com/post/2008/02/20/Options-dune-methode-Array-like#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2008/02/20/Options-dune-methode-Array-like#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/rss2/comments/427</wfw:commentRss>
      </item>
    
  <item>
    <title>Freelance</title>
    <link>http://blog.lalex.com/post/2008/02/20/Freelance</link>
    <guid isPermaLink="false">urn:md5:387657e3d965a665162812ffb710c90d</guid>
    <pubDate>Wed, 20 Feb 2008 19:23:00 +0100</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>Liens</category>
            
    <description>    &lt;p&gt;A compter du 3 Mars, je démarre une activité de développeur indépendant,
spécialisé dans l'Actionscript 3 pour Flash, et pourquoi pas Flex 2/3 (que j'ai
pratiqué intensemment dans mon précédent poste sur la Côte) et Adobe AIR.&lt;br /&gt;
Une nouvelle page (simplissime certes, mais tirée au cordeau en XHTML/CSS) orne
donc maintenant le site &lt;a href=&quot;http://www.lalex.com/&quot; hreflang=&quot;fr&quot;&gt;LAlex.com&lt;/a&gt; pour rendre compte de cette nouvelle direction dans ma vie!
&lt;img src=&quot;http://common.lalex.com/themes/devblog/smilies/icon_wink.gif&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Si vous avez donc besoin d'un prestataire sérieux, n'hésitez pas à me
contacter pour connaitre mes disponibilités! &lt;img src=&quot;http://common.lalex.com/themes/devblog/smilies/icon_smile.gif&quot; alt=&quot;:)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Voilà, c'était le billet &amp;quot;nombril&amp;quot; du jour&lt;/em&gt; &lt;img src=&quot;http://common.lalex.com/themes/devblog/smilies/icon_razz.gif&quot; alt=&quot;:P&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.lalex.com/post/2008/02/20/Freelance#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2008/02/20/Freelance#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/rss2/comments/426</wfw:commentRss>
      </item>
    
  <item>
    <title>Actionscript 3 pour GeSHi</title>
    <link>http://blog.lalex.com/post/2008/02/11/Actionscript-3-pour-GeSHi</link>
    <guid isPermaLink="false">urn:md5:143c9b7157134ed0eeb5cd381a76d1f7</guid>
    <pubDate>Mon, 11 Feb 2008 12:43:00 +0100</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>Liens</category>
            
    <description>    &lt;p&gt;Eh oui, un gentil belge a fait le fichier de &lt;a href=&quot;http://seld.be/notes/actionscript-3-language-file-for-geshi&quot; hreflang=&quot;en&quot;&gt;colorisation Actionscript 3 pour GeSHi&lt;/a&gt;, disponible sur son blog.&lt;/p&gt;
&lt;p&gt;Merci à lui! &lt;img src=&quot;http://common.lalex.com/themes/devblog/smilies/icon_smile.gif&quot; alt=&quot;:)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.lalex.com/post/2008/02/11/Actionscript-3-pour-GeSHi#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2008/02/11/Actionscript-3-pour-GeSHi#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/rss2/comments/424</wfw:commentRss>
      </item>
    
  <item>
    <title>TextField, htmlText et retours à la ligne</title>
    <link>http://blog.lalex.com/post/2008/01/07/TextField-htmlText-et-retours-a-la-ligne</link>
    <guid isPermaLink="false">urn:md5:298e1621d0e4a05040b094fee0cd5f03</guid>
    <pubDate>Mon, 07 Jan 2008 19:37:00 +0100</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>AS3 / Flex2</category>
            
    <description>&lt;p&gt;Le nouvelle gestion des TextField avec AS3 est assez géniale je dirais: plus
de propriété &lt;em&gt;html&lt;/em&gt;, et une gestion commune entre le texte &amp;quot;classique&amp;quot;
associé aux &lt;em&gt;TextFormat&lt;/em&gt; et le texte HTML. Du coup, on peut manipuler
indifféremment le HTML ou les &lt;em&gt;TextFormat&lt;/em&gt;, la modification de l'un sera
reportée sur l'autre, comme on peut le voir via le code suivant:&lt;/p&gt;
&lt;code class=&quot;actionscript&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Crée le champ texte&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; tField:&lt;span style=&quot;color: #0066CC;&quot;&gt;TextField&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;TextField&lt;/span&gt;;&lt;br /&gt;
tField.&lt;span style=&quot;color: #0066CC;&quot;&gt;text&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;LAlex&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Crée le format (couleur rouge)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; tFormat:&lt;span style=&quot;color: #0066CC;&quot;&gt;TextFormat&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;TextFormat&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
tFormat.&lt;span style=&quot;color: #0066CC;&quot;&gt;color&lt;/span&gt; = 0xFF0000;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Applique sur les deux premiers caractères&lt;/span&gt;&lt;br /&gt;
tField.&lt;span style=&quot;color: #0066CC;&quot;&gt;setTextFormat&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;tFormat, &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Affiche le resultat HTML de tout ca&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0066CC;&quot;&gt;trace&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;tField.&lt;span style=&quot;color: #0066CC;&quot;&gt;htmlText&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/code&gt;
&lt;pre&gt;
&amp;lt;P ALIGN=&amp;quot;LEFT&amp;quot;&amp;gt;&amp;lt;FONT FACE=&amp;quot;Times Roman&amp;quot; SIZE=&amp;quot;12&amp;quot; COLOR=&amp;quot;#FF0000&amp;quot; LETTERSPACING=&amp;quot;0&amp;quot; KERNING=&amp;quot;0&amp;quot;&amp;gt;LA&amp;lt;FONT COLOR=&amp;quot;#000000&amp;quot;&amp;gt;lex&amp;lt;/FONT&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;/P&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Bon, aprés on va pas chipoter sur la cohérence du formatage HTML, évidemment
il y a mieux, mais le tout est d'avoir notre correspondance
&lt;em&gt;TextFormat&lt;/em&gt;/HTML...&lt;/p&gt;
&lt;p&gt;Bref, tout ceci étant fait, si on veut obtenir le copie conforme d'un texte
dans un autre, il suffit alors de copier le &lt;em&gt;htmlText&lt;/em&gt; du premier sur le
second, sans se préoccuper des &lt;em&gt;TextFormat&lt;/em&gt;? Eh bien pas
forcément...&lt;/p&gt;    &lt;p&gt;En effet, un petit bug (a mon avis, car j'ai du mal à expliquer la logique
derrière ca) s'est glissé dans la gestion du HTML par les &lt;em&gt;TextField&lt;/em&gt;.
En effet, quelle que soit la valeur de la propriété &lt;em&gt;condenseWhite&lt;/em&gt;
(sensée faire le même travail qu'un navigateur HTML, à savoir ne pas afficher
les espaces blancs consécutifs), un &lt;em&gt;TextField&lt;/em&gt; va systématiquement
zapper les paragraphes vides, alors que c'est ce qu'il utilise en interne pour
faire des retours à la ligne! Bref, tous les retours à la ligne vont sauter
quand on copie le &lt;em&gt;htmlText&lt;/em&gt;... Par exemple, si j'ai mis trois retours à
la ligne et un texte dans un TextField, les retours à la ligne seront en fait
des paragraphes vides &amp;lt;p&amp;gt;:&lt;/p&gt;
&lt;code class=&quot;actionscript&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; tField:&lt;span style=&quot;color: #0066CC;&quot;&gt;TextField&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;TextField&lt;/span&gt;;&lt;br /&gt;
tField.&lt;span style=&quot;color: #0066CC;&quot;&gt;text&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;LAlex&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #0066CC;&quot;&gt;trace&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;tField.&lt;span style=&quot;color: #0066CC;&quot;&gt;htmlText&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/code&gt;
&lt;pre&gt;
&amp;lt;P ALIGN=&amp;quot;LEFT&amp;quot;&amp;gt;&amp;lt;FONT FACE=&amp;quot;Times Roman&amp;quot; SIZE=&amp;quot;12&amp;quot; COLOR=&amp;quot;#000000&amp;quot; LETTERSPACING=&amp;quot;0&amp;quot; KERNING=&amp;quot;0&amp;quot;&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;/P&amp;gt;&amp;lt;P ALIGN=&amp;quot;LEFT&amp;quot;&amp;gt;&amp;lt;FONT FACE=&amp;quot;Times Roman&amp;quot; SIZE=&amp;quot;12&amp;quot; COLOR=&amp;quot;#000000&amp;quot; LETTERSPACING=&amp;quot;0&amp;quot; KERNING=&amp;quot;0&amp;quot;&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;/P&amp;gt;&amp;lt;P ALIGN=&amp;quot;LEFT&amp;quot;&amp;gt;&amp;lt;FONT FACE=&amp;quot;Times Roman&amp;quot; SIZE=&amp;quot;12&amp;quot; COLOR=&amp;quot;#000000&amp;quot; LETTERSPACING=&amp;quot;0&amp;quot; KERNING=&amp;quot;0&amp;quot;&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;/P&amp;gt;&amp;lt;P ALIGN=&amp;quot;LEFT&amp;quot;&amp;gt;&amp;lt;FONT FACE=&amp;quot;Times Roman&amp;quot; SIZE=&amp;quot;12&amp;quot; COLOR=&amp;quot;#000000&amp;quot; LETTERSPACING=&amp;quot;0&amp;quot; KERNING=&amp;quot;0&amp;quot;&amp;gt;LAlex&amp;lt;/FONT&amp;gt;&amp;lt;/P&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Bon, OK. Et si maintenant on réaffecte cette valeur à htmlText et qu'on la
relit? Voilà ce que ca donne:&lt;/p&gt;
&lt;code class=&quot;actionscript&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; tField:&lt;span style=&quot;color: #0066CC;&quot;&gt;TextField&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;TextField&lt;/span&gt;;&lt;br /&gt;
tField.&lt;span style=&quot;color: #0066CC;&quot;&gt;text&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;LAlex&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; myHtmlText:&lt;span style=&quot;color: #0066CC;&quot;&gt;String&lt;/span&gt; = tField.&lt;span style=&quot;color: #0066CC;&quot;&gt;htmlText&lt;/span&gt;;&lt;br /&gt;
tField.&lt;span style=&quot;color: #0066CC;&quot;&gt;text&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;;&lt;br /&gt;
tField.&lt;span style=&quot;color: #0066CC;&quot;&gt;htmlText&lt;/span&gt; = myHtmlText;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #0066CC;&quot;&gt;trace&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;tField.&lt;span style=&quot;color: #0066CC;&quot;&gt;htmlText&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/code&gt;
&lt;pre&gt;
&amp;lt;P ALIGN=&amp;quot;LEFT&amp;quot;&amp;gt;&amp;lt;FONT FACE=&amp;quot;Times Roman&amp;quot; SIZE=&amp;quot;12&amp;quot; COLOR=&amp;quot;#000000&amp;quot; LETTERSPACING=&amp;quot;0&amp;quot; KERNING=&amp;quot;0&amp;quot;&amp;gt;LAlex&amp;lt;/FONT&amp;gt;&amp;lt;/P&amp;gt;
&lt;/pre&gt;
&lt;p&gt;(a noter que je remet le texte à zéro avant de le réattribuer, car sinon il
ne fait aucun traitement: il doit exister en interne un traitement du type
&lt;em&gt;if (_odlHtmlText != _newHtmlText) {...}&lt;/em&gt;).&lt;/p&gt;
&lt;p&gt;Comment parer ce problème? J'ai constaté qu'un &amp;quot;vrai&amp;quot; retour à la ligne
entre deux paragraphes restaure le retour à la ligne dans le champ texte. Il
suffit donc de rajouter un &lt;strong&gt;\n&lt;/strong&gt; entre la fin d'un paragraphe et
le suivant. Du coup, une petite regexp fait l'affaire:&lt;/p&gt;
&lt;code class=&quot;actionscript&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; tField:&lt;span style=&quot;color: #0066CC;&quot;&gt;TextField&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;TextField&lt;/span&gt;;&lt;br /&gt;
tField.&lt;span style=&quot;color: #0066CC;&quot;&gt;text&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;LAlex&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; myHtmlText:&lt;span style=&quot;color: #0066CC;&quot;&gt;String&lt;/span&gt; = tField.&lt;span style=&quot;color: #0066CC;&quot;&gt;htmlText&lt;/span&gt;;&lt;br /&gt;
tField.&lt;span style=&quot;color: #0066CC;&quot;&gt;text&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; reg : RegExp = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; RegExp&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;lt;/([Pp])&amp;gt;&amp;lt;&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;g&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
tField.&lt;span style=&quot;color: #0066CC;&quot;&gt;htmlText&lt;/span&gt; = myHtmlText.&lt;span style=&quot;color: #006600;&quot;&gt;replace&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;reg, &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;lt;/$1&amp;gt;&amp;lt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #0066CC;&quot;&gt;trace&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;tField.&lt;span style=&quot;color: #0066CC;&quot;&gt;htmlText&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/code&gt;
&lt;pre&gt;
&amp;lt;P ALIGN=&amp;quot;LEFT&amp;quot;&amp;gt;&amp;lt;FONT FACE=&amp;quot;Times Roman&amp;quot; SIZE=&amp;quot;12&amp;quot; COLOR=&amp;quot;#000000&amp;quot; LETTERSPACING=&amp;quot;0&amp;quot; KERNING=&amp;quot;0&amp;quot;&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;/P&amp;gt;&amp;lt;P ALIGN=&amp;quot;LEFT&amp;quot;&amp;gt;&amp;lt;FONT FACE=&amp;quot;Times Roman&amp;quot; SIZE=&amp;quot;12&amp;quot; COLOR=&amp;quot;#000000&amp;quot; LETTERSPACING=&amp;quot;0&amp;quot; KERNING=&amp;quot;0&amp;quot;&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;/P&amp;gt;&amp;lt;P ALIGN=&amp;quot;LEFT&amp;quot;&amp;gt;&amp;lt;FONT FACE=&amp;quot;Times Roman&amp;quot; SIZE=&amp;quot;12&amp;quot; COLOR=&amp;quot;#000000&amp;quot; LETTERSPACING=&amp;quot;0&amp;quot; KERNING=&amp;quot;0&amp;quot;&amp;gt;&amp;lt;/FONT&amp;gt;&amp;lt;/P&amp;gt;&amp;lt;P ALIGN=&amp;quot;LEFT&amp;quot;&amp;gt;&amp;lt;FONT FACE=&amp;quot;Times Roman&amp;quot; SIZE=&amp;quot;12&amp;quot; COLOR=&amp;quot;#000000&amp;quot; LETTERSPACING=&amp;quot;0&amp;quot; KERNING=&amp;quot;0&amp;quot;&amp;gt;LAlex&amp;lt;/FONT&amp;gt;&amp;lt;/P&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Et voilà! &lt;img src=&quot;http://common.lalex.com/themes/devblog/smilies/icon_cool.gif&quot; alt=&quot;8-)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.lalex.com/post/2008/01/07/TextField-htmlText-et-retours-a-la-ligne#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2008/01/07/TextField-htmlText-et-retours-a-la-ligne#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/rss2/comments/384</wfw:commentRss>
      </item>
    
  <item>
    <title>Interfaces et classes internal</title>
    <link>http://blog.lalex.com/post/2007/12/17/Interfaces-et-classes-internal</link>
    <guid isPermaLink="false">urn:md5:61c0beb04f69d8988cd51e0fc462837f</guid>
    <pubDate>Mon, 17 Dec 2007 13:04:00 +0100</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>AS3 / Flex2</category>
            
    <description>&lt;p&gt;L'AS3 nous a amené les classes internes (mot-clé &lt;em&gt;internal&lt;/em&gt;) qui nous
permettent d'encapsuler un certain nombre de fonctionnalités dans une classe
disponible uniquement à la classe publique qui l'utilise. Bien pratique, cela
évite les classes trop longues, et grâce à l'héritage (une classe interne peut
en étendre une autre), cela peut aussi éviter l'utilisation d'un trop grand
nombre de &lt;em&gt;if&lt;/em&gt;, et donc abaisser la complexité du code.&lt;/p&gt;
&lt;p&gt;Cela peut aussi permettre de disposer d'une classe qui n'est pas
instanciable depuis l'extérieur. Seulement, il peut parfois être utile
d'accéder à une instance de ces classes, et là, la solution c'est tout
simplement les interfaces...&lt;/p&gt;    &lt;p&gt;Prenons l'exemple d'une liste de contacts (VoIP un jour, VoIP toujours!),
dans laquelle on peut sélectionner un contact. Le XML sera utilisé pour remplir
cette liste, et un certain nombre d'actions peuvent être effectuées sur les
contacts, mais la liste reste le seul moyen d'avoir des contacts: en gros, il
est impossible de créer un contact via un constructeur de type &lt;em&gt;new
Contact(...)&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;L'utilisation conjointe des classes internes et des interfaces nous donnerai
ceci: Une interface contact&lt;/p&gt;
&lt;code class=&quot;actionscript&quot;&gt;package &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* Contact public interface&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* @author LAlex&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;interface&lt;/span&gt; Contact &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; sendMail&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0066CC;&quot;&gt;text&lt;/span&gt;:&lt;span style=&quot;color: #0066CC;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; : &lt;span style=&quot;color: #0066CC;&quot;&gt;void&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;get&lt;/span&gt; firstName&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; : &lt;span style=&quot;color: #0066CC;&quot;&gt;String&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;get&lt;/span&gt; lastName&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; : &lt;span style=&quot;color: #0066CC;&quot;&gt;String&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/code&gt;
&lt;p&gt;Une classe ContactList et son implémentation de l'interface en tant que
classe interne&lt;/p&gt;
&lt;code class=&quot;actionscript&quot;&gt;package &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* @author LAlex&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; ContactList &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; _contacts:&lt;span style=&quot;color: #0066CC;&quot;&gt;Array&lt;/span&gt; = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; _selectedContactPosition : &lt;span style=&quot;color: #0066CC;&quot;&gt;int&lt;/span&gt; = &lt;span style=&quot;color: #cc66cc;&quot;&gt;-1&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; ContactList&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;dP:&lt;span style=&quot;color: #0066CC;&quot;&gt;XML&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;dP != &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setDataProvider&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;dP&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Methods&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; setDataProvider&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;x : &lt;span style=&quot;color: #0066CC;&quot;&gt;XML&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; : &lt;span style=&quot;color: #0066CC;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;for&lt;/span&gt; each &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; contactNode:&lt;span style=&quot;color: #0066CC;&quot;&gt;XML&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;in&lt;/span&gt; x.&lt;span style=&quot;color: #006600;&quot;&gt;contacts&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;contact&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _contacts.&lt;span style=&quot;color: #0066CC;&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; ContactImpl&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;contactNode&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; selectContactAt&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;ind : &lt;span style=&quot;color: #0066CC;&quot;&gt;int&lt;/span&gt; = &lt;span style=&quot;color: #cc66cc;&quot;&gt;-1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; : &lt;span style=&quot;color: #0066CC;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;ind &amp;lt; _contacts.&lt;span style=&quot;color: #0066CC;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _selectedContactPosition = ind;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;get&lt;/span&gt; selectedContact&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; : Contact &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;_selectedContactPosition != &lt;span style=&quot;color: #cc66cc;&quot;&gt;-1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; _contacts&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;_selectedContactPosition&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; as Contact;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Contact interface implementation&lt;/span&gt;&lt;br /&gt;
internal &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; ContactImpl&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;implements&lt;/span&gt; Contact &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; _firstName:&lt;span style=&quot;color: #0066CC;&quot;&gt;String&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; _lastName:&lt;span style=&quot;color: #0066CC;&quot;&gt;String&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; ContactImpl&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;x : &lt;span style=&quot;color: #0066CC;&quot;&gt;XML&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _firstName = x.@first;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _lastName = x.@last;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Other initiation&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; sendMail&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0066CC;&quot;&gt;text&lt;/span&gt; : &lt;span style=&quot;color: #0066CC;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; : &lt;span style=&quot;color: #0066CC;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Mail sending implementation&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;get&lt;/span&gt; firstName&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; : &lt;span style=&quot;color: #0066CC;&quot;&gt;String&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; _firstName;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0066CC;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;get&lt;/span&gt; lastName&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; : &lt;span style=&quot;color: #0066CC;&quot;&gt;String&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; _lastName;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/code&gt;
&lt;p&gt;L'utilisation de cette classe donnerait:&lt;/p&gt;
&lt;code class=&quot;actionscript&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;list&lt;/span&gt; : ContactList = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; ContactList&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&amp;lt;dataprovider&amp;gt;&amp;lt;contacts&amp;gt;&amp;lt;contact first=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Alexandre&amp;quot;&lt;/span&gt; last=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;LEGOUT&amp;quot;&lt;/span&gt; /&amp;gt;&amp;lt;contact first=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Gérard&amp;quot;&lt;/span&gt; last=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;DUPONT&amp;quot;&lt;/span&gt; /&amp;gt;&amp;lt;/contacts&amp;gt;&amp;lt;/dataprovider&amp;gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span style=&quot;color: #0066CC;&quot;&gt;list&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;selectContactAt&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; selected : Contact = &lt;span style=&quot;color: #0066CC;&quot;&gt;list&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;selectedContact&lt;/span&gt;;&lt;br /&gt;
&lt;span style=&quot;color: #0066CC;&quot;&gt;trace&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;selected.&lt;span style=&quot;color: #006600;&quot;&gt;firstName&lt;/span&gt; + &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt; + selected.&lt;span style=&quot;color: #006600;&quot;&gt;lastName&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/code&gt;
&lt;p&gt;Et voilà, on a accès depuis l'extérieur de la classe à tous les
comportements &amp;quot;publics&amp;quot; d'un contact, sans avoir accés à son implémentation!
&lt;img src=&quot;http://common.lalex.com/themes/devblog/smilies/icon_cool.gif&quot; alt=&quot;8-)&quot; class=&quot;smiley&quot; /&gt;&lt;br /&gt;
Alors je sais que c'est justement le but des interfaces, mais j'ai trouvé cette
utilisation intéressante, et assez représentative de l'utilité des interfaces,
au cas où vous ne seriez pas encore convaincus... &lt;img src=&quot;http://common.lalex.com/themes/devblog/smilies/icon_wink.gif&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.lalex.com/post/2007/12/17/Interfaces-et-classes-internal#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2007/12/17/Interfaces-et-classes-internal#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/rss2/comments/380</wfw:commentRss>
      </item>
    
  <item>
    <title>Tweens: frame-based vs. time-based</title>
    <link>http://blog.lalex.com/post/2007/12/03/Tweens%3A-frame-based-vs-time-based</link>
    <guid isPermaLink="false">urn:md5:f8cfe57b664ab8734309702ef6bbd693</guid>
    <pubDate>Mon, 03 Dec 2007 15:55:00 +0100</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>AS3 / Flex2</category>
            
    <description>&lt;p&gt;Actuellement en train de travailler sur un séquenceur de différents types
d'action, incluant notamment les interpolations, j'en viens à re-développer une
classe de Tween, incluant les améliorations standards des TweenEngine en
circulation sur la toile (tween de plusieurs propriétés par exemple).&lt;/p&gt;
&lt;p&gt;Tout d'abord, il faut savoir qu'un tween a un principe tout simple: je veux
qu'une propriété numérique d'un objet (le plus souvent un objet visuel, comme
un Sprite par exemple) évolue entre une valeur de départ et une valeur
d'arrivée sur une durée précise. Une équation est utilisée afin de déterminer
l'évolution de cette valeur, la plus simple étant une équation linéaire (on
partage la distance en intervalles réguliers).&lt;/p&gt;
&lt;p&gt;Pour cela, il existe trois méthodes:&lt;/p&gt;    &lt;h2&gt;Le frame-based&lt;/h2&gt;
&lt;p&gt;&lt;ins&gt;Caractéristiques&lt;/ins&gt;: La durée du tween est donnée en nombre de
frames, et le calcul de chaque position se fait à chaque frame (typiquement, en
écoutant l'évènement &lt;em&gt;Event.ENTER_FRAME&lt;/em&gt;)&lt;br /&gt;
&lt;ins&gt;Concept&lt;/ins&gt;: à chaque calcul, on regarde le nombre de frames écoulé
depuis le départ par rapport à la durée en nombre de frames.&lt;br /&gt;
&lt;ins&gt;Avantages&lt;/ins&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;On travaille avec des nombres entiers et invariants concernant la position
courante dans le temps (nombre de frames écoulé) et la durée. Il devient donc
possible de cacher une interpolation et donc de réduire les temps de calcul
pour les interpolations suivantes utilisant le même couple équation/durée. En
effet, une équation donnée sur une durée donnée se comportera toujours de la
même manière. En gros, elle sera toujours à x% de son trajet à la n-ième frame,
et c'est donc possible de le mettre en cache.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;ins&gt;Inconvénient&lt;/ins&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;L'intervalle de temps entre deux frames n'est pas fixe: si lors de
l'exécution d'une frame un code oblige à ralentir le framerate, le player flash
le fera automatiquement. Cela est probablement du à son mode d'exécution
mono-threadé. Donc, sur une animation à 30fps, un tween d'une durée de 30 peut
prendre plus d'une seconde... L'autre inconvénient, qui peut aussi être un
comportement voulu, est que modifier le FPS global de l'animation revient à
modifier la vitesse d'interpolation.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Le time-based&lt;/h2&gt;
&lt;p&gt;&lt;ins&gt;Caractéristiques&lt;/ins&gt;: La durée du tween est donnée en seconde, et le
calcul de chaque position est faite à un intervalle de temps donné (typiquement
avec &lt;em&gt;setInterval&lt;/em&gt;, ou plus &amp;quot;clean&amp;quot; avec la classe
&lt;em&gt;Timer&lt;/em&gt;).&lt;br /&gt;
&lt;ins&gt;Concept&lt;/ins&gt;: un Timer lance le calcul de la nouvelle position toutes les
&lt;em&gt;x&lt;/em&gt; millisecondes. La base de calcul est le nombre de millisecondes
écoulées sur la durée en nombre de millisecondes. Un
TimerEvent.updateAfterEvent s'occupe de rafraichir l'affichage indépendamment
du framerate.&lt;br /&gt;
&lt;ins&gt;Avantages&lt;/ins&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;L'interpolation se fait sur une notion de temps. Bien que le Timer ne soit
pas forcément extrêmement précis, c'est ce qu'on peut obtenir de plus proche.
Ainsi, le taux de rafraichissement du tween peut même être configurable
dynamiquement. Par exemple, on pourrait avoir un tween fluide sur une animation
pourtant compilée à 2FPS.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;ins&gt;Inconvénients&lt;/ins&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Justement, on ne contrôle pas la synchronisation anim/temps. Du coup, on
surcharge beaucoup le moteur d'affichage du Flash Player, qui doit rafraichir
l'affichage à chaque frame &lt;strong&gt;mais aussi&lt;/strong&gt; à chaque calcul du
tween. Il est également trés dur de synchroniser deux tweens: en effet, deux
&lt;em&gt;Timer&lt;/em&gt; de même durée peuvent dispatcher à plusieurs millisecondes
d'intervalle, décalant d'autant les traitements.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Le &amp;quot;frame/time-based&amp;quot;&lt;/h2&gt;
&lt;p&gt;&lt;ins&gt;Caractéristiques&lt;/ins&gt;: Mix entre le time-based et le frame-based: la
durée du tween est donnée en secondes, et le calcul de chaque position se fait
à chaque frame.&lt;br /&gt;
&lt;ins&gt;Concept&lt;/ins&gt;: A chaque frame, on calcule le temps écoulé en millisecondes
depuis le départ sur la durée totale en millisecondes&lt;br /&gt;
&lt;ins&gt;Avantage&lt;/ins&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;On obtient les avantages combinés du frame-based (économie du moteur
d'affichage) et du time-based (durée constante, indépendante du
framerate).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;ins&gt;Inconvénient&lt;/ins&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;La fluidité de l'anim nécessitera un FPS élevé, comme pour le frame-based:
fini les anims fluides à 2FPS! &lt;img src=&quot;http://common.lalex.com/themes/devblog/smilies/icon_wink.gif&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/li&gt;
&lt;li&gt;Comme pour le time-based, il est difficile de synchroniser les tweens entre
eux, ou alors ils peuvent être synchronisés alors qu'ils ne devraient pas. En
effet, admettons qu'une frame s'affiche toutes les 100ms
&lt;strong&gt;exactement&lt;/strong&gt; (je sais, un monde parfait n'existe pas, mais
faites comme si). Le framerate est volontairement bas (10FPS) pour l'exemple.
Deux tweens commencant exactement au même moment, et ayant des durées
respectives de 820 et 880ms finiront en même temps, sur la frame 9. En effet,
sur la frame 8, 800ms se sont écoulées, et le prochain calcul, qui déterminera
la fin des deux tweens, se fera à la frame suivante, soit à 900ms.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Quel mode pour quel usage?&lt;/h2&gt;
&lt;p&gt;Le mode à utiliser est extrêmement propre à l'usage auquel il est destiné.
Les moteurs existants utilisent souvent par défault la troisième option
(frame/time-based), et proposent assez souvent la première (frame-based). Le
deuxième reste la plus marginale, mais est tout de même proposée dans quelques
moteurs/classes. Globalement, je suggèrerais:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;ins&gt;frame-based&lt;/ins&gt;: si vous avez le &lt;strong&gt;contrôle de votre
environnement de déploiement&lt;/strong&gt; ou un &lt;strong&gt;framerate connu et
fixe&lt;/strong&gt;, ce mode ci devrait être le plus performant car travaillant sur
des petits nombres et &amp;quot;cachables&amp;quot; (sauf aprés calcul dans l'équation).
Egalement bien utile quand on a un besoin de &lt;strong&gt;synchronisation très
précise&lt;/strong&gt; (sauf avec les classes de Tween d'Adobe, voire poste
précédent) entre différents tweens, ou quand on travaille avec beaucoup
d'éléments &lt;strong&gt;issus de la timeline&lt;/strong&gt; (trés fréquent quand on
travaille avec un graphiste/animateur flash) avec lesquels vous devez vous
caler.&lt;/li&gt;
&lt;li&gt;&lt;ins&gt;time-based&lt;/ins&gt;: a priori le moins utilisé (y compris par les
TweenEngine). Il est le moins performant car il rajoute du travail au moteur
d'affichage du Flash Player. A utiliser si vous avez besoin d'une
&lt;strong&gt;fluidité constante&lt;/strong&gt; quel que soit le framerate. S'il vous faut
uniquement des interpolations dont la vitesse est indépendante, voir le
&amp;quot;frame/time-based&amp;quot;.&lt;/li&gt;
&lt;li&gt;&lt;ins&gt;frame/time-based&lt;/ins&gt;: utile pour avoir une durée a peu prés
constante &lt;strong&gt;indépendamment du framerate&lt;/strong&gt;. Très utilisé
&lt;strong&gt;avec les vidéos ou les sons&lt;/strong&gt; par exemple, il se positionne
systématiquement au bon endroit selon le temps &amp;quot;réel&amp;quot; écoulé, quel que soit le
nombre de calculs déjà effectués. En bref, même si l'appli &amp;quot;rame&amp;quot;, votre tween
sera plus ou moins synchro. Interessant aussi &lt;strong&gt;quand on ignore le
framerate&lt;/strong&gt; qui sera utilisé par l'application et qu'on désire conserver
la vitesse des interpolations, si votre anim est &lt;strong&gt;chargée par un
Loader&lt;/strong&gt; par exemple (dans un site portail, un CMS, etc...).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Perso, quand je sais que mon SWF va tourner &amp;quot;tout seul&amp;quot;, j'utilise beaucoup
de frame-based, avec un &amp;quot;stabilisateur&amp;quot; de framerate (type &lt;a href=&quot;http://blog.andre-michelle.com/2006/stable-fps-test/&quot; hreflang=&quot;en&quot;&gt;celui
d'André Michelle&lt;/a&gt;) pour être sur qu'il sera vu de la même manière par tout
le monde...&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.lalex.com/post/2007/12/03/Tweens%3A-frame-based-vs-time-based#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2007/12/03/Tweens%3A-frame-based-vs-time-based#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/rss2/comments/375</wfw:commentRss>
      </item>
    
  <item>
    <title>Tweens Flash CS3</title>
    <link>http://blog.lalex.com/post/2007/10/30/Tweens-Flash-CS3</link>
    <guid isPermaLink="false">urn:md5:22dd7ecebd2aea324cca853e507f1230</guid>
    <pubDate>Tue, 30 Oct 2007 16:50:00 +0100</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>AS3 / Flex2</category>
            
    <description>    &lt;p&gt;Je me rend compte carrément tard par rapport au temps depuis lequel
j'utilise les Tweens, mais aviez-vous remarqué que la classe fournie par Adobe
dans Flash CS3 (&lt;em&gt;fl.transitions.Tween&lt;/em&gt;) émettait l'évènement de fin
(&lt;em&gt;TweenEvent.MOTION_FINISH&lt;/em&gt;) une frame trop tard? La raison est simple,
le test effectué pour détecter la fin est strict:&lt;/p&gt;
&lt;code class=&quot;actionscript&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;t &amp;gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #0066CC;&quot;&gt;duration&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/code&gt;
&lt;p&gt;Il suffirait d'un '&amp;gt;=' à la place pour modifier cela, mais à ce moment là
la fonctionnalité de boucle zapperais une frame avant de boucler...&lt;/p&gt;
&lt;p&gt;Les Tweens de Flex et des &amp;quot;tween engines&amp;quot; que j'ai vu en AS3 (&lt;a href=&quot;http://blog.greensock.com/tweenliteas3&quot; hreflang=&quot;en&quot;&gt;TweenLite&lt;/a&gt; et
&lt;a href=&quot;http://code.google.com/p/tweener/&quot; hreflang=&quot;en&quot;&gt;Tweener&lt;/a&gt;) n'ont
pas ce défaut par contre...&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.lalex.com/post/2007/10/30/Tweens-Flash-CS3#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2007/10/30/Tweens-Flash-CS3#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/rss2/comments/371</wfw:commentRss>
      </item>
    
  <item>
    <title>Composants Flash CS3 : le meilleur set sera gratuit?</title>
    <link>http://blog.lalex.com/post/2007/10/26/Composants-Flash-CS3-%3A-le-meilleur-set-sera-gratuit</link>
    <guid isPermaLink="false">urn:md5:1e3ad2566885fc531c8c88ac4c4db46d</guid>
    <pubDate>Fri, 26 Oct 2007 12:15:00 +0200</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>Liens</category>
            
    <description>&lt;p&gt;Trouver un set de composants de base pour Flash CS3, à part celui développé
par Grant Skinner dont tout le monde se plaint, c'est pas facile. Trouver un
set de composants faciles à personnaliser, c'est encore moins facile.&lt;/p&gt;
&lt;p&gt;Alors quand un &amp;quot;frenchy&amp;quot; s'apprête à proposer les &lt;a href=&quot;http://www.bytearray.org/?p=109&quot; hreflang=&quot;fr&quot;&gt;Liquid Components&lt;/a&gt;, un set
de composants de base qui répond à tous les besoins des graphistes (et des
autres utilisateurs de Flash CS3) en terme de personnalisation, et qu'en plus
on sait qu'il les mettra à disposition gratuitement, obligé d'en parler!&lt;/p&gt;    &lt;p&gt;Les &lt;a href=&quot;http://www.bytearray.org/?p=109&quot; hreflang=&quot;fr&quot;&gt;Liquid
Components&lt;/a&gt; partent d'un principe de base: comment un graphiste qui crée des
RIAs simples peut-il intégrer des composants à un visuel fin et travaillé sans
que ca jure, et sans demander de connaissances de codeur? En utilisant un
systême de &lt;strong&gt;skins Bitmap&lt;/strong&gt;. Pensé par &lt;a href=&quot;http://www.foxaweb.com/&quot; hreflang=&quot;fr&quot;&gt;Didier Brun (Foxy)&lt;/a&gt; depuis
maintenant bien 5 ans, l'AS3 et l'arrivée de BitmapData lui ont enfin permi de
mettre au point un système analogue au 9-slices grid, mais dédié au bitmap,
dotant les &lt;a href=&quot;http://www.bytearray.org/?p=109&quot; hreflang=&quot;fr&quot;&gt;Liquid
Components&lt;/a&gt; d'un système de skining révolutionnaire pour Flash: &lt;strong&gt;un
composant = un bitmap&lt;/strong&gt;. En gros, c'est la première fois qu'on peut
faire du &lt;strong&gt;vrai skinning&lt;/strong&gt; sur des composants (optimisé de
surcroit grace à l'utilisation des bitmaps), à opposer au &lt;em&gt;styling&lt;/em&gt;
(système de personnalisation des couleurs, polices et autres paramètres
prédéfinis).&lt;/p&gt;
&lt;p&gt;Et comme si ça ne suffisait pas, les &lt;a href=&quot;http://www.bytearray.org/?p=109&quot; hreflang=&quot;fr&quot;&gt;Liquid Components&lt;/a&gt; proposent
également:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;du &lt;em&gt;&lt;strong&gt;live skinning&lt;/strong&gt;&lt;/em&gt;: chargement de skins bitmap à la
volée (runtime).&lt;/li&gt;
&lt;li&gt;un inspecteur de composant propriétaire, qui change la vie (fini les
tableaux de 20 éléments sur une seule ligne, ou le parcours de la bibliothèque
pour retrouver un identifiant de liaison)&lt;/li&gt;
&lt;li&gt;un composant de base pour faire du 9-slices grid sur des images
bitmaps&lt;/li&gt;
&lt;li&gt;la gestion du livepreview concernant les tailles, polices, etc...&lt;/li&gt;
&lt;li&gt;la possibilité d'associer une icone bitmap à n'importe quel texte, et donc
d'avoir des icônes pour un label, un élément de liste, un élément de combobox,
etc...&lt;/li&gt;
&lt;li&gt;pour les codeurs, un accés facile à tous les éléments d'un composant grâce
à la composition.&lt;/li&gt;
&lt;li&gt;des possibilités de styling à double entrée:
&lt;ins&gt;myComponent.setStyle(&amp;quot;font&amp;quot;, &amp;quot;Arial&amp;quot;)&lt;/ins&gt; pour l'utilisation dynamique
(styling via XML par exemple) / &lt;ins&gt;myComponent.font = &amp;quot;Arial&amp;quot;&lt;/ins&gt; pour un
accés typé aux propriétés de styling&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Bon, et histoire de faire le beau un peu, je précise juste que j'ai suivi le
projet de prés: j'avais même implémenté la première version de la grille
servant au skinning (AS2 à l'époque), que Didier brillamment amélioré et porté
en AS3. Je suis content de voir que mes conseils et avis ont aidé le projet à
avancer, et espère bien continuer à y contribuer.&lt;/p&gt;
&lt;p&gt;En fait, pour toutes les infos, il suffit d'aller sur &lt;a href=&quot;http://www.bytearray.org/?p=109&quot; hreflang=&quot;fr&quot;&gt;la page officielle&lt;/a&gt; de
&lt;a href=&quot;http://www.bytearray.org/&quot; hreflang=&quot;fr&quot;&gt;ByteArray.org&lt;/a&gt;. &lt;img src=&quot;http://common.lalex.com/themes/devblog/smilies/icon_wink.gif&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.lalex.com/post/2007/10/26/Composants-Flash-CS3-%3A-le-meilleur-set-sera-gratuit#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2007/10/26/Composants-Flash-CS3-%3A-le-meilleur-set-sera-gratuit#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/rss2/comments/370</wfw:commentRss>
      </item>
    
  <item>
    <title>Nouveau job! Nouveau collègue?</title>
    <link>http://blog.lalex.com/post/2007/09/10/Nouveau-job-Nouveau-collegue</link>
    <guid isPermaLink="false">urn:md5:0a656d74372a83464225ba30a163670e</guid>
    <pubDate>Mon, 10 Sep 2007 20:16:00 +0200</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>Divers</category>
            
    <description>    &lt;p&gt;Le niçois que j'étais viens de se perdre à Paris pour s'y installer, et
autant dire que le choc thermique a été important! &lt;img src=&quot;http://common.lalex.com/themes/devblog/smilies/icon_razz.gif&quot; alt=&quot;:P&quot; class=&quot;smiley&quot; /&gt; J'ai pris depuis mes
fonctions en tant que Lead Dev Flash au sein du &lt;a href=&quot;http://www.ddb.fr/&quot; hreflang=&quot;fr&quot;&gt;groupe D