<?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>Fri, 18 May 2012 04:56:20 +0200</pubDate>
  <copyright></copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Bug de l'IDE Flash: Bibliothèque, héritage et déclaration automatique</title>
    <link>http://blog.lalex.com/post/2011/11/29/Bug-de-l-IDE-Flash%3A-Biblioth%C3%A8que%2C-h%C3%A9ritage-et-d%C3%A9claration-automatique</link>
    <guid isPermaLink="false">urn:md5:4a3e028be7939aef8a2c2affa400e787</guid>
    <pubDate>Tue, 29 Nov 2011 23:22:00 +0100</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>Divers</category>
            
    <description>&lt;p&gt;J'aimerais aujourd'hui vous exposer un bug de l'IDE Flash, notamment de son
compilo, lorsque l'on combine l'utilisation des symboles de la librairie avec
une classe, et la fonctionnalité de déclaration automatique des instances
(présente dans les paramètres de publication). Cette option est cochée par
défaut, et lorsque l'on travaille sur la timeline, a priori le meilleur process
quand on travaille avec des créas, il est à mon sens important de donner le
moins de contraintes possibles à ces derniers. Il doivent pouvoir donner (ou
pas) des noms aux éléments qu'ils posent sur la timeline, notamment en
prévision de code que viendra brancher un développeur ou pour de simples
raisons d'organisation... d'où l'importance à priori de laisser cochée l'option
&amp;quot;Déclarer automatiquement les instances de la scène&amp;quot;. Avec quelques
instructions, les créas peuvent ainsi créer leurs assets, voire utiliser
directement du code fourni par un framework ou une bibliothèque de code au
moyen des propriétés &amp;quot;Classe&amp;quot; et &amp;quot;Classe de base&amp;quot; pour les éléments de la
bibliothèque.&lt;/p&gt;    &lt;p&gt;Par exemple, comme beaucoup de développeurs je pense, je dispose d'une
classe qui me permet de gérer les rollovers de boutons fait sur la timeline. Il
suffit d'utiliser cette classe comme classe de base d'un élément pour qu'un
créa puisse faire des boutons fonctionnels sans l'aide d'un codeur. Pour mes
exemples, je vous propose une classe &amp;quot;BaseButton&amp;quot;:&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;display&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: #0066CC;&quot;&gt;MovieClip&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;events&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;MouseEvent&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;dynamic&lt;/span&gt; &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; ButtonBase&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;extends&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;
&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; ButtonBase&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: #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; mouseEnabled = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&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; buttonMode = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&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;useHandCursor&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&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; mouseChildren = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&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;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; addEventListener&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;, clickHandler&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; protected &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; clickHandler&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;Base button 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;
&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;Un intégrateur peut alors utiliser les fonctionnalités de cette classe en
créant un élément de la bibliothèque, dans cet exemple RedButton: &lt;img src=&quot;http://blog.lalex.com/public/bugflashide/RedButton.jpg&quot; alt=&quot;RedButton.jpg&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;RedButton.jpg, nov. 2011&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Le contenu de RedButton consiste en un clip représentant un rond rouge, sans
nom d'instance. &lt;img src=&quot;http://blog.lalex.com/public/bugflashide/RedButtonAsset.jpg&quot; alt=&quot;RedButtonAsset.jpg&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;RedButtonAsset.jpg, nov. 2011&quot; /&gt;&lt;/p&gt;
&lt;p&gt;A la compilation, le résultat est celui attendu, à savoir un rond rouge
cliquable, qui affiche une main lorsque l'on passe dessus, et trace &amp;quot;Base
button clicked&amp;quot; lorsqu'on clique dessus.&lt;/p&gt;
&lt;p&gt;Afin de démontrer mes dires, je compile le .fla dans un .swc, que j'ouvre
avec FDT pour voir ce que le compilo génère comme classes. Je fais en sorte que
les classes générées automatiquement par l'IDE Flash fassent partie du package
&amp;quot;com.lalex.flash&amp;quot;. Avec les paramètres précédents appliqués à ce bouton tout
simple, j'obtiens donc logiquement une classe générée qui a la structure
suivante (en passant sur les imports inutiles):&lt;/p&gt;
&lt;code class=&quot;actionscript&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Generated from&amp;nbsp; ButtonBase.swc&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Breakpoints are not supported&lt;/span&gt;&lt;br /&gt;
package com.&lt;span style=&quot;color: #006600;&quot;&gt;lalex&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;flash&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; com.&lt;span style=&quot;color: #006600;&quot;&gt;lalex&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;display&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;ButtonBase&lt;/span&gt;;&lt;br /&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;DisplayObject&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;events&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;EventDispatcher&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;Sprite&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;InteractiveObject&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: #0066CC;&quot;&gt;MovieClip&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;DisplayObjectContainer&lt;/span&gt;;&lt;br /&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;dynamic&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; RedButton &lt;span style=&quot;color: #0066CC;&quot;&gt;extends&lt;/span&gt; ButtonBase &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: #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;Ma classe ButtonBase est évidemment inchangée:&lt;/p&gt;
&lt;code class=&quot;actionscript&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Generated from&amp;nbsp; ButtonBase.swc&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Breakpoints are not supported&lt;/span&gt;&lt;br /&gt;
package com.&lt;span style=&quot;color: #006600;&quot;&gt;lalex&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;display&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;DisplayObject&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;events&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;EventDispatcher&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;Sprite&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;InteractiveObject&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: #0066CC;&quot;&gt;MovieClip&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;events&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;MouseEvent&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;DisplayObjectContainer&lt;/span&gt;;&lt;br /&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;dynamic&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; ButtonBase &lt;span style=&quot;color: #0066CC;&quot;&gt;extends&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; protected &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; clickHandler&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;arg0 : 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;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;Voyons maintenant ce qui se passe lorsque l'on donne un nom d'instance à mon
rond rouge: &lt;img src=&quot;http://blog.lalex.com/public/bugflashide/RedButtonAssetBackground.jpg&quot; alt=&quot;RedButtonAssetBackground.jpg&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;RedButtonAssetBackground.jpg, nov. 2011&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Lors de la compilation, toujours aucun problème, le résultat est exactement
le même. Si on y réfléchit, on pense tout naturellement que cette fameuse
option de déclaration automatique des instances a bien évidemment rajouté une
propriété &amp;quot;background&amp;quot; dans ma classe com.lalex.flash.RedButton, or lorsque
l'on regarde les classes du SWC on y trouve bien autre chose. En effet, ma
classe RedButton est inchangée:&lt;/p&gt;
&lt;code class=&quot;actionscript&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Generated from&amp;nbsp; ButtonBase.swc&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Breakpoints are not supported&lt;/span&gt;&lt;br /&gt;
package com.&lt;span style=&quot;color: #006600;&quot;&gt;lalex&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;flash&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; com.&lt;span style=&quot;color: #006600;&quot;&gt;lalex&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;display&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;ButtonBase&lt;/span&gt;;&lt;br /&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;DisplayObject&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;events&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;EventDispatcher&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;Sprite&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;InteractiveObject&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: #0066CC;&quot;&gt;MovieClip&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;DisplayObjectContainer&lt;/span&gt;;&lt;br /&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;dynamic&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; RedButton &lt;span style=&quot;color: #0066CC;&quot;&gt;extends&lt;/span&gt; ButtonBase &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: #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;Et ma classe BaseButton (donc une classe fournie par mes soins à l'IDE) a
été modifiée:&lt;/p&gt;
&lt;code class=&quot;actionscript&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Generated from&amp;nbsp; ButtonBase.swc&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Breakpoints are not supported&lt;/span&gt;&lt;br /&gt;
package com.&lt;span style=&quot;color: #006600;&quot;&gt;lalex&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;display&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;DisplayObject&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;events&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;EventDispatcher&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;Sprite&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;InteractiveObject&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: #0066CC;&quot;&gt;MovieClip&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;events&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;MouseEvent&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;DisplayObjectContainer&lt;/span&gt;;&lt;br /&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;dynamic&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; ButtonBase &lt;span style=&quot;color: #0066CC;&quot;&gt;extends&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; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// [LAlex] This property has been added by Flash!!!&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: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;background&lt;/span&gt; : &lt;span style=&quot;color: #0066CC;&quot;&gt;MovieClip&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; protected &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; clickHandler&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;arg0 : 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;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;Comment se fait-il donc que l'IDE se &amp;quot;permette&amp;quot; de modifier une classe qui
lui a été donnée?!? Cela risque en effet de modifier son comportement,
notamment lorsque cette classe est aussi destinée à être étendue. C'est
pourquoi cette propriété &amp;quot;background&amp;quot; aurait clairement du être ajoutée à la
classe com.lalex.flash.RedButton...&lt;/p&gt;
&lt;p&gt;Par exemple, je veux maintenant créer une classe GreenButton qui va étendre
ButtonBase. Cette classe aura une propriété &amp;quot;background&amp;quot; qui peut être un
Bitmap. Quid de l'héritage?&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;test&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;geom&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;ColorTransform&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;geom&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;Transform&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; com.&lt;span style=&quot;color: #006600;&quot;&gt;lalex&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;display&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;ButtonBase&lt;/span&gt;;&lt;br /&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;Sprite&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; GreenButton&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;extends&lt;/span&gt; ButtonBase &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;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;var&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;background&lt;/span&gt;:Bitmap;&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; GreenButton&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: #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: #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;/code&gt;
&lt;p&gt;Au vu de la manière dont Flash a géré/modifié les classes, on obtient
logiquement un conflit entre la déclaration de la propriété &amp;quot;background&amp;quot; dans
la version modifiée de ButtonBase, et la déclaration de la propriété
&amp;quot;background&amp;quot; dans la classe GreenButton.&lt;/p&gt;
&lt;pre&gt;
/****/com/lalex/test/GreenButton.as, Line 14 | 1152: A conflict exists with inherited definition com.lalex.display:ButtonBase.background in namespace public.
&lt;/pre&gt;
&lt;p&gt;Evidemment, il est toujours possible d'imposer aux créas des process un peu
plus stricts sur le nommage de leurs objets sur la scène, l'idéal étant de
pouvoir désactiver l'option &amp;quot;Déclarer automatiquement les instances de la
scène&amp;quot;. Mais dans la pratique, on sait bien que cela n'est pas toujours évident
et que l'absence de déclaration automatique, plus propre, ne convient qu'aux
codeurs qui travaillent en toute fin du production, sans parallélisation des
taches dev/créa, ou sans intervention d'un créa après le développement. Et il
faut le dire, ce mode de travail est bien rare sur des projets courts et/ou
urgents dont les acteurs se télescopent souvent...&lt;/p&gt;
&lt;p&gt;De toutes façons, le problème vient surtout que l'IDE Flash, qui est censé
générer des classes via les éléments de la bibliothèque, se permet à ce moment
là de modifier des classes qui lui sont fournies au format .as, ce qui est tout
à fait anormal. Cela va à l'encontre du principe d'héritage en POO: une base
commune et plusieurs sous-classes qui héritent de celle-ci sans la
modifier...&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.lalex.com/post/2011/11/29/Bug-de-l-IDE-Flash%3A-Biblioth%C3%A8que%2C-h%C3%A9ritage-et-d%C3%A9claration-automatique#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2011/11/29/Bug-de-l-IDE-Flash%3A-Biblioth%C3%A8que%2C-h%C3%A9ritage-et-d%C3%A9claration-automatique#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/atom/comments/979</wfw:commentRss>
      </item>
    
  <item>
    <title>Livraison d'une application Flash</title>
    <link>http://blog.lalex.com/post/2011/03/07/Livraison-d-une-application-Flash</link>
    <guid isPermaLink="false">urn:md5:e24574e0c64e66669739960c0df914ec</guid>
    <pubDate>Mon, 07 Mar 2011 23:00:00 +0100</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>Articles</category>
            
    <description>&lt;p&gt;Une fois n'est pas coutume, ce blog reprend un petit poil de la bête pour un
article même pas fait (que) pour les techos... mais plutôt pour les chefs de
projets.&lt;/p&gt;
&lt;p&gt;Lorsqu'un développeur code une application ou un site, il est victime
systématiquement de l'effet &amp;quot;anguille&amp;quot;. Cette pure invention de ma part
signifie juste qu'il va tester généralement les cas qu'il a lui-même prévu lors
de son développement et se faufiler naturellement entre les bugs qui pourraient
intervenir lors d'une utilisation &amp;quot;normale&amp;quot; par un utilisateur &amp;quot;classique&amp;quot;.
C'est là qu'intervient la recette, généralement effectuée par le chef de
projet, ou par un autre développeur, ou dans les structures les plus
importantes par le service qualité. La recette est ensuite effectuée par le
client final pour une dernière vérification.&lt;br /&gt;
La recette effectuée &amp;quot;en interne&amp;quot; est donc très importante, d'abord parce que
moins il y a de bugs à la livraison finale plus on est crédible, ensuite parce
que le client final n'a pas à sa disposition la même compétence, ni les même
outils pour assurer une recette efficace.&lt;/p&gt;
&lt;p&gt;Vous trouverez donc dans cet article un ensemble de conseils et d'outils
pour une livraison en douceur d'un projet Flash.&lt;br /&gt;
Je précise que je travaille sur MacOSX, mais les pratiques citées ci-dessous
sont tout aussi valables dans le monde PC.&lt;/p&gt;    &lt;h3&gt;I. &lt;ins&gt;Le serveur de livraison&lt;/ins&gt;&lt;/h3&gt;
&lt;p&gt;Afin de s'assurer d'avoir le moins de surprises possible lors du déploiement
en production, il est important pour le client livré de fournir un
environnement de livraison ayant les mêmes caractéristiques que l'endroit ou
sera déployé l'application finale. Il s'agit du serveur de pré-production, dit
&amp;quot;préprod&amp;quot;.&lt;br /&gt;
La livraison s'effectue le plus souvent par FTP sur un serveur qui
idéalement:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;tourner sur le même OS que la prod, donc pas de Linux pour une prod Windows
et vice-versa&lt;/li&gt;
&lt;li&gt;fournir les mêmes autorisations sur les dossiers/fichiers (les scripts de
manipulation de fichiers doivent pouvoir accéder aux mêmes choses qu'en
prod)&lt;/li&gt;
&lt;li&gt;faire tourner les mêmes versions mineures des logiciels utilisés (PHP,
MySQL, Apache ou IIS, AMFPHP, etc...)&lt;/li&gt;
&lt;li&gt;donner les mêmes possibilités d'administration des URLs (redirections,
.htaccess, erreurs 404, etc...)&lt;/li&gt;
&lt;li&gt;donner l'accès aux même conditions d'URL (ne pas tester dans un
sous-répertoire d'un nom de domaine un site qui tournera à la racine d'un
domaine). Par exemple, tester un projet qui tournera sur
&lt;ins&gt;http://www.monprojet.com&lt;/ins&gt; sur une préprod qui serait
&lt;ins&gt;http://preprod.monclient.com/monprojet&lt;/ins&gt; peut donner des surprises au
déploiement.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;!NOTE AUX DÉVELOPPEURS!&lt;/strong&gt; Comme ce dernier point n'est pas
toujours possible, il est important dans ses développements de privilégier les
chemins d'accès relatifs (../xml/config.xml) aux chemins d'accès absolus
(/xml/config.xml). De la même manière, je conseille de toujours partir sur la
base d'un seul fichier de configuration, commun à tous les codes de
l'application (PHP, Flash, JS, sur front-office comme sur back-office), qui
sera le seul nécessitant une modification lors du déploiement sur
l'environnement de production. Ca simplifiera la vie à tout le monde! &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;II. &lt;ins&gt;Configurer son ordi pour une recette&lt;/ins&gt;&lt;/h3&gt;
&lt;h4&gt;1. &lt;ins&gt;Un ordinateur stable&lt;/ins&gt;&lt;/h4&gt;
&lt;p&gt;Ca peut paraître bête à dire, mais si on utilise un ordinateur qui plante
tout le temps (je serais mesquin, je dirais &amp;quot;un PC par exemple&amp;quot; :-P), on ne
saura jamais si c'est l'application ou l'environnement qui plante. Avoir un
système propre et stable est donc la première étape d'une recette.&lt;/p&gt;
&lt;h4&gt;2. &lt;ins&gt;Un navigateur configuré pour &amp;quot;recetter&amp;quot;&lt;/ins&gt;&lt;/h4&gt;
&lt;p&gt;Personnellement, j'utilise Chrome au quotidien, selon moi plus adapté au
surf de tous les jours car rapide et léger. Je n'ai pas besoin d'une quelconque
extension tant mes besoin ne sont vraiment pas exceptionnels en matière de
surf. De plus, la mise à jour est transparente, autant pour le browser lui-même
que pour le player Flash, et je suis donc sûr d'être sur la dernière version
disponible en permanence. De plus, le Flash player est interne à Chrome, ce qui
me permet d'installer une version différente pour mes autres navigateurs.&lt;/p&gt;
&lt;p&gt;Pour le travail, notamment sur Flash, j'utilise par contre Firefox, pour ses
nombreuses extensions dédiées au développement, que nous verrons plus loin. Il
peut-être bien pratique d'installer un navigateur uniquement pour le débugage:
si vous utilisez Firefox en tant que navigateur principal, je crois qu'il est
possible d'en installer plusieurs instances.&lt;br /&gt;
Un navigateur destiné à la recette doit être configuré pour ne pas utiliser de
cache: on n'imagine même pas le nombre d'heures passées en discussions stériles
entre développeurs et testeurs uniquement parce que ce n'était pas la même
version qui était testée... Les navigateurs sont parfois capricieux à vider
leur cache, qui se répand dans les méandres du disque dur. Alors pour vous
épargner ce temps en étant sûr de ne pas avoir affaire au cache, vous pouvez
utiliser un plug-in qui va le désactiver. Pour ma part, il s'agit de la
&lt;a href=&quot;http://chrispederick.com/work/web-developer/&quot;&gt;Web Developer
Toolbar&lt;/a&gt; de Firefox.&lt;/p&gt;
&lt;h4&gt;3. &lt;ins&gt;Le player DEBUG&lt;/ins&gt;&lt;/h4&gt;
&lt;p&gt;Une erreur Flash ne remonte pas lorsque le player classique est utilisé. Il
est donc important d'avoir installé le player DEBUG afin de les retourner au
développeur lorsque l'on rapporte un bug. Etant donné que ces même erreurs
interrompent complètement l'exécution du code, il donnera au développeur une
précieuse information, bien plus utile que &lt;em&gt;&amp;quot;ca ne fait plus rien&amp;quot;&lt;/em&gt;...
Les versions debug des players sont disponibles à l'addresse: &lt;a href=&quot;http://www.adobe.com/support/flashplayer/downloads.html&quot; title=&quot;http://www.adobe.com/support/flashplayer/downloads.html&quot;&gt;http://www.adobe.com/support/flashp...&lt;/a&gt;&lt;br /&gt;

Si vous utilisez le même navigateur pour la recette et votre usage quotidien,
s'il s'agit de Firefox, vous pouvez installer la bien pratique extensions
&lt;a href=&quot;http://blog.sephiroth.it/2008/04/23/flash-switcher-for-windows-osx-and-linux/&quot;&gt;
Flash Switcher&lt;/a&gt;. Vous pouvez ainsi utiliser une version debug pour une
recette, et une version &amp;quot;normale&amp;quot; pour le reste...&lt;/p&gt;
&lt;h4&gt;4. &lt;ins&gt;Un proxy&lt;/ins&gt;&lt;/h4&gt;
&lt;p&gt;Pour les applications communiquant avec un serveur, il peut être bien utile
pour le développeur de savoir si un message réseau est parti, s'il est revenu,
et quel est le contenu de ce retour. Fournir cette information lors de la
déclaration du bug est un gain de temps évident pour sa résolution.&lt;br /&gt;
Pour ma part, j'utilise &lt;a href=&quot;http://www.charlesproxy.com/&quot;&gt;Charles&lt;/a&gt;: pas
cher, entièrement en Java donc dispo pour toutes plateformes, il installe
également un plug-in Firefox qui active/désactive le proxy facilement... Il
existe aussi des extensions Firefox qui font cela, ainsi que d'autres logiciels
standalone.&lt;br /&gt;
Un proxy permet également de voir si des ressources (images, fichiers XML ou
autres...) on été demandées par le Flash, mais pas trouvées sur le serveur
(erreurs 404 ou 500).&lt;/p&gt;
&lt;h4&gt;5. &lt;ins&gt;Une console de traces&lt;/ins&gt;&lt;/h4&gt;
&lt;p&gt;Les développeurs insèrent souvent des messages de trace, ne serait-ce que
pour vérifier que le code passe bien par là où il doit passer. Afin de lire ces
messages, en plus du player DEBUG, il faut vous munir d'une console où les
afficher. Elles ne manquent pas, que ce soit sous forme d'extension pour
navigateur ou en standalone. Pour ma part, j'utilise &lt;a href=&quot;http://www.sos.powerflasher.com/&quot;&gt;SOS&lt;/a&gt;, développé par les excellents
PowerFlasher (je suis un fan absolu de FDT).&lt;br /&gt;
Le testeur ne sais pas toujours à quoi correspondent les différentes traces,
mais cela permet à un développeur de demander si tel ou tel message s'est
affiché dans la console, cela permettant de clarifier et accélérer les échanges
qui mèneront à la résolution du bug. Evidemment un message du type &amp;quot;EH MERDE,
CA MARCHE PAS&amp;quot; qui apparait dans la console peut être pertinent à remonter au
développeur!&lt;/p&gt;
&lt;h3&gt;III. &lt;ins&gt;Echanger avec le développeur&lt;/ins&gt;&lt;/h3&gt;
&lt;h4&gt;1. &lt;ins&gt;Avoir un outil de suivi de bugs&lt;/ins&gt;&lt;/h4&gt;
&lt;p&gt;Il peut prendre plusieurs formes. La plus fréquente est un BugTracker. En ce
qui me concerne, lorsque mes clients n'en ont pas, je leur propose &lt;a href=&quot;http://www.mantisbt.org/&quot;&gt;Mantis&lt;/a&gt;. En PHP, simple d'accès et de
configuration, il est pour moi un des meilleurs compromis
efficacité/simplicité. De grosses structures utilisent souvent &lt;a href=&quot;http://www.atlassian.com/software/jira/&quot;&gt;JIRA&lt;/a&gt;, pour ma part, je le trouve
un peu nébuleux, mais il s'avère efficace lorsqu'il est bien configuré, et que
le projet l'est également. J'ai également entendu dire beaucoup de bien d'un
tracker en mode hébergé, nommé &lt;a href=&quot;http://www.sifterapp.com/&quot;&gt;SifterApp&lt;/a&gt;.&lt;br /&gt;
Un BugTracker permet non seulement de remonter un bug au développeur, mais
également de suivre toute son évolution: qui l'a reporté, les compléments
d'information nécessaires, les captures d'écran, la résolution (ou non) de
celui-ci, etc...&lt;br /&gt;
Lorsqu'aucun BugTracker n'est disponible, les remontées de bugs se font trop
souvent sur un document Excel ou PowerPoint. Autant le dire tout de suite:
&lt;strong&gt;C'EST LA PIRE RECETTE POSSIBLE&lt;/strong&gt;!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;sur Excel, aucune capture d'écran n'est possible, et à moins d'écrire une
tartine difficilement lisible dans une case, il est compliqué de donner des
infos détaillées sur le bug&lt;/li&gt;
&lt;li&gt;sur PowerPoint, le bug est souvent une grosse capture d'écran, avec une
flèche pointant vers le bug quand on a de la chance, suivie d'une phrase trop
courte par manque de place&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Dans les deux cas, il est surtout impossible ou extrêmement laborieux
d'échanger avec le développeur. Cela se fait souvent par mail ou IM, avec pour
référence &amp;quot;Le document du 17 Février, page 14&amp;quot;, sachant que 2 documents
similaires ont pu être échangés depuis, avec ou sans répétition des
précédents.&lt;br /&gt;
Si ce support devait absolument être utilisé, certaines règles sont
essentielles à respecter afin de limiter les dégats:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;donner un numéro unique à chaque bug, et organiser le document de reporting
par ordre de numéro de bug (facilite la recherche dans le document)&lt;/li&gt;
&lt;li&gt;pour chaque document échangé, le dernier en date fait foi. Cela veut dire
qu'il doit contenir tous les bugs restant à résoudre, ou qui nécessitent
l'attention du dev.&lt;/li&gt;
&lt;li&gt;chaque bug doit faire l'objet d'une description détaillée (voir
ci-dessous), avec copie d'écran annotée si nécessaire.&lt;/li&gt;
&lt;li&gt;mettre la date du document dans le nom du fichier, au format
&amp;lt;année&amp;gt;_&amp;lt;mois&amp;gt;_&amp;lt;jour&amp;gt;: cela permet un classement alphabétique
cohérent quand on affiche une liste de fichiers sur son ordi.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;En l'absence de tracker, une option a été trouvée avec un de mes clients et
elle s'avère limiter les dégats sous la forme d'une feuille de calcul sur
&lt;a href=&quot;http://docs.google.com/&quot;&gt;GoogleDocs&lt;/a&gt; (ou tout autre outil de
collaboration en ligne). Sans atteindre le confort, la puissance et donc
l'efficacité d'un tracker, cela permet malgré tout une réactivité améliorée par
rapport à un échange de mails, si le document est bien organisé et comporte
toutes les infos nécessaire (voir ci-dessous).&lt;/p&gt;
&lt;h4&gt;2. &lt;ins&gt;Déclarer un bug&lt;/ins&gt;&lt;/h4&gt;
&lt;p&gt;Il s'agit là de la partie la plus anodine, et en même temps la plus
importante d'une recette. Afin d'optimiser la durée et le nombre d'échanges, un
bug doit être déclaré de la manière la plus complète. Souvent, un BugTracker
demande un certain nombres des informations utiles dans des zones de saisie
dédiées, facilitant ainsi la clarté du bug. Dans tous les cas, il est
nécessaire d'avoir pour chaque bug:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;un &lt;ins&gt;numéro&lt;/ins&gt;, trés important pour les échanges, il identifie de
manière commune le bug, pour le testeur comme pour le dev. Il permet d'éviter
les noms du genre &amp;quot;Le bug du bouton rouge qui cliquait pas comme il faut&amp;quot;&lt;/li&gt;
&lt;li&gt;un &lt;ins&gt;titre&lt;/ins&gt; clair et concis. Voire ci-dessus un exemple de nom à
éviter! &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;une &lt;ins&gt;catégorie&lt;/ins&gt;. Souvent, elle est liée à l'endroit ou à l'écran
sur lequel se situe le bug. Quand ce champ n'est pas prévu, il peut apparaître
sous forme de &amp;quot;tag&amp;quot; avant le nom du bug, par exemple: (Editeur de niveau)
Bouton SAVE inopérant.&lt;/li&gt;
&lt;li&gt;une &lt;ins&gt;description &lt;strong&gt;détaillée&lt;/strong&gt;&lt;/ins&gt;. Elle doit contenir
les effets du bug: un bouton qui ne fait rien, un graphique qui ne s'affiche
pas ou part en sucette, une couleur qui n'est pas la bonne, bref la différence
entre le comportement attendu et le comportement effectif.&lt;/li&gt;
&lt;li&gt;une &lt;ins&gt;priorité&lt;/ins&gt;. Pour un développeur, un bug est un bug. Selon la
méthode de travail qu'il utilise ou le mode de raisonnement qu'il suit, ses
priorités peuvent être différentes des vôtres. Si vous avez besoin que certains
soient résolus avant d'autres, faites le savoir.&lt;/li&gt;
&lt;li&gt;une &lt;ins&gt;sévérité&lt;/ins&gt;. Ca peut être &amp;quot;Bloquant&amp;quot;, &amp;quot;Majeur&amp;quot;, &amp;quot;Mineur&amp;quot;,
&amp;quot;Anecdotique&amp;quot;, &amp;quot;Amélioration&amp;quot;, etc...&lt;/li&gt;
&lt;li&gt;un &lt;ins&gt;scénario&lt;/ins&gt;. Une des parties les plus importantes. Le
développeur doit savoir comment reproduire le bug avant de pouvoir le résoudre.
Le testeur doit donc bien reconstituer l'ensemble des manipulations effectuées
pour arriver à ce bug, quitte à reprendre le parcours depuis le lancement de
l'application. A noter cette phrase tellement vraie: &amp;quot;Quand un chef de projet
reproduit un bug, il est déçu car cela veut dire qu'il reste un bug. Quand un
développeur reproduit un bug, il est content car cela veut dire qu'il va
pouvoir le résoudre&amp;quot;.&lt;/li&gt;
&lt;li&gt;une &lt;ins&gt;reproductibilité&lt;/ins&gt;. C'est la facilité que l'on a à reproduire
le bug. Un testeur ne doit pas remonter un bug tant qu'il ne s'est pas battu
bec et ongles pour le reproduire. La reproductibilité sera de type &amp;quot;Toujours&amp;quot;,
&amp;quot;Fréquent&amp;quot; ou &amp;quot;Non reproduit&amp;quot;... Les bugs relevant de cette dernière
possibilité étant bien évidemment les plus difficiles et donc les plus longs à
résoudre. Souvent d'ailleurs, si on arrive pas à le reproduire au bout d'un
certain nombre d'essais, on le considère comme inexistant par la force des
choses.&lt;/li&gt;
&lt;li&gt;une &lt;ins&gt;cause probable&lt;/ins&gt;. C'est là qu'interviennent les outils cités
plus haut qui permettent au testeur de faciliter et donc d'accélérer le travail
du codeur. Il peut s'agir d'un message réseau qui n'a pas eu de réponse, ou
dont la réponse contient une erreur (message d'erreur PHP par exemple), d'une
ressource non trouvée (image, fichier XML, etc...), d'un message d'erreur
remonté par Flash (player DEBUG), ou simplement remonté par le codeur dans ses
traces (console de trace).&lt;/li&gt;
&lt;li&gt;un &lt;ins&gt;statut&lt;/ins&gt; (voire ci-dessous).&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;3. &lt;ins&gt;Suivi d'un bug&lt;/ins&gt;&lt;/h4&gt;
&lt;p&gt;Afin que tout le monde parle le même langage durant la recette, pouvoir
suivre les bugs est important, ne serait-ce que pour éviter des échanges
informatifs superflus. Le suivi donnera non-seulement un état des lieux de la
recette, mais évitera aussi, par exemple, de redéclarer un bug que l'on pensait
résolu, alors que le développeur n'a même pas commencé à le regarder, ou qu'il
l'a résolu et pas livré... Ce suivi se fait généralement par deux moyens:&lt;/p&gt;
&lt;h5&gt;a. &lt;ins&gt;Un statut pour le bug&lt;/ins&gt;&lt;/h5&gt;
&lt;p&gt;Il permet de savoir quel est l'état de traitement de celui-ci. Les états
courants, dans l'ordre classique, sont les suivant:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;ins&gt;déclaré&lt;/ins&gt;. Le bug vient d'être déclaré par le testeur.&lt;/li&gt;
&lt;li&gt;&lt;ins&gt;accepté / refusé / incomplet&lt;/ins&gt;. Le développeur a lu le bug. Il le
prend en charge, le refuse en expliquant la raison (ça peut aller de &amp;quot;Mauvaise
interprétation du CDC&amp;quot; - les testeurs ne sont pas toujours les
demandeurs/concepteurs - jusqu'à &amp;quot;Hors de périmètre de la mission&amp;quot; - dans le
cadre d'une amélioration par exemple - ou une impossibilité de reproduire, ou
qu'il s'agit d'un doublon avec le bug N°__), ou bien il demande plus
d'informations pour pouvoir ensuite accepter / refuser le bug.&lt;/li&gt;
&lt;li&gt;&lt;ins&gt;en cours&lt;/ins&gt;. Dans certain process, le développeur notifie le
testeur quand il commence à travailler sur le bug. Très honnêtement, il est
rare qu'un dev utilise ce statut, ne serait-ce que parce qu'il oublie de le
faire... &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;&lt;ins&gt;résolu&lt;/ins&gt;. Le développeur notifie le testeur qu'il a résolu le bug,
mais que ce fix n'est pas encore deployé sur la plateforme de test.&lt;/li&gt;
&lt;li&gt;&lt;ins&gt;deployé&lt;/ins&gt;. La résolution du bug est disponible sur l'environnement
de test.&lt;/li&gt;
&lt;li&gt;&lt;ins&gt;retourné&lt;/ins&gt;. Le bug a été testé, mais pas considéré comme résolu.
Le testeur retourne alors ce bug au développeur, avec les informations
détaillées qui lui font dire qu'il n'est pas encore fixé.&lt;/li&gt;
&lt;li&gt;&lt;ins&gt;fermé&lt;/ins&gt;. La résolution du bug est validée par le testeur.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;L'état d'un bug peut-être notifié par un code couleur, facilitant ainsi la
vue d'ensemble d'une recette par ses différents intervenants. Cela est encore
plus utile dans le cadre d'un document de reporting qui n'est pas un
tracker.&lt;br /&gt;
Le processus de travail est principalement centré sur ce statut, car il permet
à chaque partie de savoir où il doit intervenir pour faire avancer la situation
du bug: les testeurs doivent intervenir sur les statuts &amp;quot;incomplet&amp;quot; (pour le
complèter) et &amp;quot;deployé&amp;quot; (pour le tester), les devs sur &amp;quot;déclaré&amp;quot; (pour
l'accepter), &amp;quot;accepté&amp;quot; (pour le traiter), &amp;quot;résolu&amp;quot; (pour le déployer) et
&amp;quot;retourné&amp;quot; (pour l'accepter).&lt;/p&gt;
&lt;h5&gt;b. &lt;ins&gt;Des commentaires&lt;/ins&gt;&lt;/h5&gt;
&lt;p&gt;Cela constitue la colonne vertébrale du bug et représente la partie
&amp;quot;échanges&amp;quot; du bug. Dans le cadre d'un BugTracker, les commentaires de chaque
intervenant permettent de retracer la vie du bug, et donc de savoir ce qui a
mené à son état actuel. En dehors d'un tracker, il s'agit le plus souvent de
mails, et ce qui pose problème alors et qu'on aborde souvent plusieurs bugs
dans un même mail. Si les échanges par mails étaient le seul moyen, essayez de
ne faire qu'un mail par bug, et de spécifier dans le titre de celui-ci le
numéro du bug (par exemple (BUG #__) Demande d'infos), permettant ainsi le
regroupement de plusieurs mail parlant du même bug, pour ainsi reconstituer
cette colonne vertébrale.&lt;/p&gt;
&lt;h3&gt;IV. &lt;ins&gt;Conclusion&lt;/ins&gt;&lt;/h3&gt;
&lt;p&gt;Donner la touche finale à un projet n'est pas évident.&lt;br /&gt;
La livraison peut se révéler parfois un véritable parcours du combattant avant
un déploiement en production, et les conseils ci-dessus peuvent aider à la
rendre bien plus douce, et surtout rendre l'échange testeur/développeur bien
plus qualitatif, ce qui permet de préserver les nerfs, le temps et donc
l'argent de tout le monde, pensez-y! &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/2011/03/07/Livraison-d-une-application-Flash#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2011/03/07/Livraison-d-une-application-Flash#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/atom/comments/973</wfw:commentRss>
      </item>
    
  <item>
    <title>Déformation de vidéo</title>
    <link>http://blog.lalex.com/post/2009/09/14/Deformation-de-video</link>
    <guid isPermaLink="false">urn:md5:44ac3ac83a93d2c3269faaf5d561de2d</guid>
    <pubDate>Mon, 14 Sep 2009 02:37:00 +0200</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>AS3 / Flex2</category>
            
    <description>&lt;p&gt;J'ai découvert récemment le clip de la chanson &amp;quot;Unintended&amp;quot; de Muse.&lt;br /&gt;
Hormis la beauté de la chanson, j'ai beaucoup accroché sur l'effet donné à la
vidéo dans le clip.&lt;/p&gt;
&lt;div style=&quot;text-align:center;&quot;&gt;&lt;object width=&quot;425&quot; height=&quot;344&quot; type=&quot;application/x-shockwave-flash&quot; data=&quot;http://www.youtube.com/v/XYJEKh9OqEY&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/XYJEKh9OqEY&quot; /&gt;
&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot; /&gt;
&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot; /&gt;
&lt;/object&gt;&lt;/div&gt;
&lt;p&gt;Bon, ben il ne restait plus qu'à le reproduire dans Flash...&lt;/p&gt;    &lt;p&gt;Bon alors déjà, le principe.&lt;br /&gt;
En observant un peu, c'est assez simple: plus on descend vers le bas de
l'image, plus les pixels sont anciens...&lt;br /&gt;
En gros, l'image se renouvelle par le haut, ligne par ligne, au fur et à
mesure. Il suffit donc de garder en mémoire les anciennes images, et d'afficher
pour la première ligne, la première ligne de l'image actuelle, sur la deuxième,
la deuxième ligne de l'image à t-1, etc...&lt;/p&gt;
&lt;p&gt;Ensuite, s'agissait de trouver une vidéo sur laquelle l'effet rendait bien.
En gros, il faut une partie d'image fixe, et une partie qui bouge lentement
sinon c'est moche.&lt;br /&gt;
Et donc au final, j'ai fait une vidéo rapide de porte qui s'ouvre depuis ma
petite maison de campagne, et voilà! (cliquez sur l'image pour voir tout
çà)&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/unintended_flv.swf&quot; width=&quot;700&quot; height=&quot;280&quot; id=&quot;BitmapAStar&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://blog.lalex.com/public/unintended_flv.swf&quot; /&gt;&lt;/object&gt;&lt;/div&gt;
&lt;p&gt;Et comme je sais que vous êtes joueurs, je vous ai même fait une version ou
qu'on peut le faire avec la webcam!&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/unintended_cam.swf&quot; width=&quot;380&quot; height=&quot;160&quot; id=&quot;BitmapAStar&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://blog.lalex.com/public/unintended_cam.swf&quot; /&gt;&lt;/object&gt;&lt;/div&gt;
&lt;p&gt;Et bien sûr la classe, qui hérite de Bitmap pour être plus pratique! &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;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;unin&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;Bitmap&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;;&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;events&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;Event&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;geom&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;Point&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;geom&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;Rectangle&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;media&lt;/span&gt;.&lt;span style=&quot;color: #0066CC;&quot;&gt;Video&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; UnintendedVideo&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;extends&lt;/span&gt; Bitmap &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;// Targeted video&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;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;video&lt;/span&gt; : &lt;span style=&quot;color: #0066CC;&quot;&gt;Video&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;// Time after capture has been stopped&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;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; &lt;span style=&quot;color: #0066CC;&quot;&gt;time&lt;/span&gt;:&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;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;// Bitmap datas&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;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; datas : &lt;span style=&quot;color: #0066CC;&quot;&gt;Array&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; UnintendedVideo&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;vdo : &lt;span style=&quot;color: #0066CC;&quot;&gt;Video&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: #0066CC;&quot;&gt;video&lt;/span&gt; = vdo;&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;start&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: #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; 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: #0066CC;&quot;&gt;video&lt;/span&gt;.&lt;span style=&quot;color: #0066CC;&quot;&gt;width&lt;/span&gt;, &lt;span style=&quot;color: #0066CC;&quot;&gt;video&lt;/span&gt;.&lt;span style=&quot;color: #0066CC;&quot;&gt;height&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; bitmapData.&lt;span style=&quot;color: #006600;&quot;&gt;draw&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0066CC;&quot;&gt;video&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;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;time&lt;/span&gt; = &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&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; datas = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;bitmapData.&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;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&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; refresh&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; addEventListener&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;Event.&lt;span style=&quot;color: #006600;&quot;&gt;ENTER_FRAME&lt;/span&gt;, samplingEnterFrameHandler&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;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;stop&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: #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; removeEventListener&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;Event.&lt;span style=&quot;color: #006600;&quot;&gt;ENTER_FRAME&lt;/span&gt;, samplingEnterFrameHandler&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; addEventListener&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;Event.&lt;span style=&quot;color: #006600;&quot;&gt;ENTER_FRAME&lt;/span&gt;, endingEnterFramehandler&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; endingEnterFramehandler&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;event : Event&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: #808080; font-style: italic;&quot;&gt;//If still ending, duplicate the previous image&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;&lt;span style=&quot;color: #0066CC;&quot;&gt;time&lt;/span&gt;++ &amp;lt; bitmapData.&lt;span style=&quot;color: #0066CC;&quot;&gt;height&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; datas.&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;datas&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;datas.&lt;span style=&quot;color: #006600;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;-1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; refresh&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; &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//If last image is fully displayed, stop handling enter frame event&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;span style=&quot;color: #b1b100;&quot;&gt;else&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; removeEventListener&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;Event.&lt;span style=&quot;color: #006600;&quot;&gt;ENTER_FRAME&lt;/span&gt;, endingEnterFramehandler&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;
&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; samplingEnterFrameHandler&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;event : Event&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: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; newBitmapData: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: #0066CC;&quot;&gt;video&lt;/span&gt;.&lt;span style=&quot;color: #0066CC;&quot;&gt;width&lt;/span&gt;, &lt;span style=&quot;color: #0066CC;&quot;&gt;video&lt;/span&gt;.&lt;span style=&quot;color: #0066CC;&quot;&gt;height&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; newBitmapData.&lt;span style=&quot;color: #006600;&quot;&gt;draw&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0066CC;&quot;&gt;video&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; datas.&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;newBitmapData&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; refresh&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; &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;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; refresh&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;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: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; curY:&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; maxY:&lt;span style=&quot;color: #0066CC;&quot;&gt;int&lt;/span&gt; = bitmapData.&lt;span style=&quot;color: #0066CC;&quot;&gt;height&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;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: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; curDatas:&lt;span style=&quot;color: #0066CC;&quot;&gt;Array&lt;/span&gt; = datas.&lt;span style=&quot;color: #0066CC;&quot;&gt;concat&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; &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; rect:Rectangle = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Rectangle&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;, bitmapData.&lt;span style=&quot;color: #0066CC;&quot;&gt;width&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;
&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: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; pnt: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;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&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;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; bitmapData.&lt;span style=&quot;color: #006600;&quot;&gt;lock&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; &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; &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;while&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;++curY &amp;lt; maxY&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: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; last:&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;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: #000000; font-weight: bold;&quot;&gt;var&lt;/span&gt; curData:BitmapData = curDatas.&lt;span style=&quot;color: #0066CC;&quot;&gt;pop&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rect.&lt;span style=&quot;color: #006600;&quot;&gt;y&lt;/span&gt; = curY;&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;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: #808080; font-style: italic;&quot;&gt;//If there's not enough history, let's draw to the bottom&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;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;curDatas.&lt;span style=&quot;color: #0066CC;&quot;&gt;length&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: #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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rect.&lt;span style=&quot;color: #0066CC;&quot;&gt;height&lt;/span&gt; = maxY - curY;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; last = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&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: #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; &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pnt.&lt;span style=&quot;color: #006600;&quot;&gt;y&lt;/span&gt; = rect.&lt;span style=&quot;color: #006600;&quot;&gt;y&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; bitmapData.&lt;span style=&quot;color: #006600;&quot;&gt;copyPixels&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;curData, rect, pnt&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; &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;last&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;break&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; &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; &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bitmapData.&lt;span style=&quot;color: #006600;&quot;&gt;unlock&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; &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Keeping more history than height is useless and cost memory&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; datas = datas.&lt;span style=&quot;color: #0066CC;&quot;&gt;slice&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;-bitmapData.&lt;span style=&quot;color: #0066CC;&quot;&gt;height&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;
&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;Oui bon, pour un retour aprés autant de silence, j'aurais pu faire plus
pointu je vous l'accorde...&lt;br /&gt;
Mais j'ai du bon thème a développer, reste à trouver le temps, et la motivation
(quand on passe son temps la tête dans le code, pas évident d'y passer son
temps libre non plus...)&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.lalex.com/post/2009/09/14/Deformation-de-video#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2009/09/14/Deformation-de-video#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/atom/comments/906</wfw:commentRss>
      </item>
    
  <item>
    <title>MonBeauSapin.org</title>
    <link>http://blog.lalex.com/post/2008/11/17/MonBeauSapin.org</link>
    <guid isPermaLink="false">urn:md5:e71a59a1e90fbc830d451163cb26127a</guid>
    <pubDate>Mon, 17 Nov 2008 16:35:00 +0100</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>Divers</category>
            
    <description>    &lt;p&gt;Ne parlons pas toujours de code... et pensons aux autres.&lt;/p&gt;
&lt;p&gt;Etant fan de BD, et donc accrocs aux blogs BDs depuis un certain nombre
d'années maintenant, j'ai eu part de cette délicieuse initiative de Pénélope
Jolicoeur: &lt;strong&gt;&lt;a href=&quot;http://www.monbeausapin.org/&quot; hreflang=&quot;fr&quot;&gt;monbeausapin.org&lt;/a&gt;&lt;/strong&gt;. Elle a ainsi rameuté de nombreux et
talentueux dessineux pour créer un blog donc l'audience se transformera en dons
à la croix rouge, qui s'en servira pour acheter des cadeaux de Noël aux enfants
qui ne peuvent pas en avoir faute de moyens.&lt;/p&gt;
&lt;p&gt;J'aime l'idée, donc si je peux m'y associer en vous la faisant découvrir
tant mieux! &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/11/17/MonBeauSapin.org#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2008/11/17/MonBeauSapin.org#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/atom/comments/854</wfw:commentRss>
      </item>
    
  <item>
    <title>Adobe CS4, ou le vol fait au vieux continent (MAJ)</title>
    <link>http://blog.lalex.com/post/2008/06/23/Adobe-CS4-ou-le-vol-fait-au-vieux-continent</link>
    <guid isPermaLink="false">urn:md5:68c8b037fe8451050ee794cf9f3e38df</guid>
    <pubDate>Tue, 23 Sep 2008 12:24:00 +0200</pubDate>
    <dc:creator>-Alexandre LEGOUT aka LAlex-</dc:creator>
        <category>Divers</category>
            
    <description>    &lt;p&gt;Ça y est, les suites Adobe CS4 sont annoncées, pour fin-Octobre en Anglais
et mi-Décembre.&lt;br /&gt;
Plein de nouveautés qu'elles sont bien, mais je ne vais pas faire duplicata du
&lt;a href=&quot;http://www.adobe.fr/&quot; hreflang=&quot;fr&quot;&gt;site Adobe&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Par contre, la Production Premium (exemple pas au hasard, c'est celle que je
vais acheter) se voit passer de 1699dollars (soit aujourd'hui 1156euros) à
1899eurosHT pour la traversée de l'Atlantique. Au final, les européens paient
60% de plus (sans compter la TVA): autant dire que c'est carrément du
&lt;strong&gt;&lt;ins&gt;vol qualifié&lt;/ins&gt;&lt;/strong&gt;!&lt;/p&gt;
&lt;p&gt;Je cherche donc s'il existe une astuce &lt;strong&gt;légale&lt;/strong&gt; pour
l'acheter aux états-unis...&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;MAJ&lt;/strong&gt;: Il semblerait qu'il ne soit absolument pas illégal
d'acheter les produits Adobe aux États-Unis, dixit &lt;a href=&quot;http://tapaninaho.com/blog/2007/04/more-on-creative-suite-3-pricing/&quot; hreflang=&quot;en&quot;&gt;le service client Adobe lui-même&lt;/a&gt; (concernant la suite CS3 en
tout cas, déjà honteusement chère en Europe à l'époque). Cela empêche seulement
de disposer du support pour l'Europe.&lt;br /&gt;
Toujours selon ce même service client, la différence de prix est due aux
garanties complémentaires accordées à l'Europe, et aux frais de traduction
(j'ai bien fait la comparaison plus haut des &lt;strong&gt;versions
anglaises&lt;/strong&gt;, donc aucune traduction).&lt;/p&gt;
&lt;p&gt;Reste à voir si c'est toujours valable pour la suite CS4.&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.lalex.com/post/2008/06/23/Adobe-CS4-ou-le-vol-fait-au-vieux-continent#comment-form</comments>
      <wfw:comment>http://blog.lalex.com/post/2008/06/23/Adobe-CS4-ou-le-vol-fait-au-vieux-continent#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.lalex.com/feed/atom/comments/851</wfw:commentRss>
      </item>
    
  <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/atom/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/atom/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/atom/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/atom/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/atom/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/atom/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/atom/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/atom/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/atom/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/atom/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/atom/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/atom/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/atom/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/atom/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/atom/comments/380</wfw:commentRss>
      </item>
    
</channel>
</rss>
