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

<channel>
	<title>zedia flash blogue</title>
	<atom:link href="http://www.zedia.net/fr/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zedia.net/fr</link>
	<description>Flash, ActionScript, référencement et probablement un peu plus</description>
	<pubDate>Tue, 20 May 2008 00:54:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Convertir une couleur RGB et un Alpha en une couleur ARGB en ActionScript 3</title>
		<link>http://www.zedia.net/fr/2008/convertir-une-couleur-rgb-et-un-alpha-en-une-couleur-argb-en-actionscript-3/</link>
		<comments>http://www.zedia.net/fr/2008/convertir-une-couleur-rgb-et-un-alpha-en-une-couleur-argb-en-actionscript-3/#comments</comments>
		<pubDate>Tue, 20 May 2008 00:54:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[ActionScript 3]]></category>

		<category><![CDATA[ARGB]]></category>

		<category><![CDATA[bit shift]]></category>

		<category><![CDATA[RGB]]></category>

		<guid isPermaLink="false">http://www.zedia.net/fr/?p=6</guid>
		<description><![CDATA[Alors que je travaillais avec le color picker component (je vais éventuellement trouver les équivalence en Français) qui vient avec Flash CS3, je me suis rendu compte que celui-ci nous retournait, par l&#8217;entremise du ColorPickerEvent.CHANGE, une couleur en format RGB. Si vous vouliez , par exemple, utiliser la méthode setPixel32 de la classe BitmapData pour [...]]]></description>
			<content:encoded><![CDATA[<p>Alors que je travaillais avec le color picker component (je vais éventuellement trouver les équivalence en Français) qui vient avec Flash CS3, je me suis rendu compte que celui-ci nous retournait, par l&#8217;entremise du ColorPickerEvent.CHANGE, une couleur en format RGB. Si vous vouliez , par exemple, utiliser la méthode setPixel32 de la classe BitmapData pour créer des Bitmap avec transparence, vous seriez obligés de tranformer la couleur retourner par le color picker en format ARGB. Voici un fonction simple qui vous permet de le faire:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript"><span style="color: #000000; font-weight: bold;">function</span> returnARGB<span style="color: #66cc66;">&#40;</span>rgb:uint, newAlpha:uint<span style="color: #66cc66;">&#41;</span>:uint<span style="color: #66cc66;">&#123;</span>
  <span style="color: #808080; font-style: italic;">//newAlpha has to be in the 0 to 255 range</span>
  <span style="color: #000000; font-weight: bold;">var</span> argb:uint = <span style="color: #cc66cc;">0</span>;
  argb += <span style="color: #66cc66;">&#40;</span>newAlpha<span style="color: #66cc66;">&lt;&lt;</span><span style="color: #cc66cc;">24</span><span style="color: #66cc66;">&#41;</span>;
  argb += <span style="color: #66cc66;">&#40;</span>rgb<span style="color: #66cc66;">&#41;</span>;
  <span style="color: #b1b100;">return</span> argb;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Ce que cette fonction fait, c&#8217;est qu&#8217;elle &#8220;bit shift&#8221; la valeur du Alpha que vous lui passez et l&#8217;ajoute à la couleur RGB pour en faire une couleur ARGB. Le format RGB utilise 8 bits pour chaques couleurs (24 bits en tous), quand vous ajoutez la transparence, le canal alpha ajoute un autre 8 bits (donc un total de 32 bits ce qui explique le nom de la fonction setPixel32. Cela explique aussi pourquoi newAlpha dans la fonction doit être entre 0 et 255 parce que 255 est le plus gros chiffre que l&#8217;on peut obtenir avec 8 bits. La couleur bleu occupe les bits 1 à 8, le vert les bits 9 à 16, le rouge les bits, 17 à 24 et enfin Alpha les bits 25 à 32. C&#8217;est pour cela qu&#8217;on bit shift le alpha de 24 bits (newAlpha << 24).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/fr/2008/convertir-une-couleur-rgb-et-un-alpha-en-une-couleur-argb-en-actionscript-3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>BlendMode.LAYER: une nécessité lorsqu&#8217;on change la propriété alpha d&#8217;un DisplayObject qui contient plusieurs DisplayObjects</title>
		<link>http://www.zedia.net/fr/2008/blendmodelayer-une-necessite-lorsquon-change-la-propriete-alpha-dun-displayobject-qui-contient-plusieurs-displayobjects/</link>
		<comments>http://www.zedia.net/fr/2008/blendmodelayer-une-necessite-lorsquon-change-la-propriete-alpha-dun-displayobject-qui-contient-plusieurs-displayobjects/#comments</comments>
		<pubDate>Thu, 15 May 2008 02:46:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[ActionScript 3]]></category>

		<category><![CDATA[blendMode]]></category>

		<category><![CDATA[blendMode.LAYER]]></category>

		<category><![CDATA[tweener en alpha]]></category>

		<guid isPermaLink="false">http://www.zedia.net/fr/?p=5</guid>
		<description><![CDATA[Je ne sais pas si vous avez déjà tweené l&#8217;alpha d&#8217;un MovieClip qui contenais plusieurs Objets, mais je fais cela pas mal souvent (fade in, fade out étant les transitions les plus facile à utiliser pour à peu près tout). Par défaut, Flash modifie l&#8217;alpha de chacun des Objets que contient ce MovieClip (ou Sprite). [...]]]></description>
			<content:encoded><![CDATA[<p>Je ne sais pas si vous avez déjà tweené l&#8217;alpha d&#8217;un MovieClip qui contenais plusieurs Objets, mais je fais cela pas mal souvent (fade in, fade out étant les transitions les plus facile à utiliser pour à peu près tout). Par défaut, Flash modifie l&#8217;alpha de chacun des Objets que contient ce MovieClip (ou Sprite). Des fois ce n&#8217;est pas grave, mais la plupart du temps ce n&#8217;est pas comme cela qu&#8217;on voudrait que cela se produise. Lorsque le MovieClip dont vous changez le alpha contient des formes ou des bitmaps qui se superposent ou en cachent d&#8217;autres complètement, vous allez apercevoir tout les Objects au lieu de voir seulement ceux qui sont visible au départ parce que Flash ne considère pas le conteneur comme un entier.</p>
<p>Bon, je ne sais pas si c&#8217;est clair, mais j&#8217;ai un exemple plus bas pour clarifier la chose. En tous cas, j&#8217;ai trouvé la solution pour ce problème en lisant la documentation de BlendMode.Si vous assignez au blendMode du DisplayObject conteneur la valeur de BlendMode.LAYER Flahs va considerer ce DIsplayObject comme une seule couche et va changer le alpha de la façon qu&#8217;on serait porter à le croire.</p>
<p>Voici un exemple pour mieux illustrer mon point. Le Sprite de gauche est l&#8217;object de référence, le Sprite du milieu n&#8217;a pas de blendMode appliqué et celui de droite a un blendMode de BlendMode.LAYER. Regardez particulièrement la région ou l&#8217;éllipse bleu se superpose à l&#8217;éllipse vert.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.zedia.net/fr/flash/blendmodeFR.swf" /><embed type="application/x-shockwave-flash" width="550" height="400" src="http://www.zedia.net/fr/flash/blendmodeFR.swf"></embed></object></p>
<p>J&#8217;aurais vraiment aimé trouver cela avant et j&#8217;espère que cela va aider d&#8217;autre qui était dans ma situation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/fr/2008/blendmodelayer-une-necessite-lorsquon-change-la-propriete-alpha-dun-displayobject-qui-contient-plusieurs-displayobjects/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Générer une chaîne de caractères (String) aux hazard en AS2 et AS3</title>
		<link>http://www.zedia.net/fr/2008/generer-une-chaine-de-caracteres-string-aux-hazard-en-as2-et-as3/</link>
		<comments>http://www.zedia.net/fr/2008/generer-une-chaine-de-caracteres-string-aux-hazard-en-as2-et-as3/#comments</comments>
		<pubDate>Wed, 14 May 2008 02:31:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[ActionScript 3]]></category>

		<category><![CDATA[ActionScript 2]]></category>

		<category><![CDATA[String au hazard]]></category>

		<guid isPermaLink="false">http://www.zedia.net/fr/?p=4</guid>
		<description><![CDATA[Je cherchais pour une fonction qui générait des String au hazard, mais j&#8217;ai rien trouvé donc j&#8217;ai été obligé de l&#8217;écrire moi-même à partir du code de quelqu&#8217;un qui faisait un effet de machine à écrire, par contre je n&#8217;arrive plus à trouver la page web&#8230; J&#8217;utitlise le code suivant quand je veux charger du [...]]]></description>
			<content:encoded><![CDATA[<p>Je cherchais pour une fonction qui générait des String au hazard, mais j&#8217;ai rien trouvé donc j&#8217;ai été obligé de l&#8217;écrire moi-même à partir du code de quelqu&#8217;un qui faisait un effet de machine à écrire, par contre je n&#8217;arrive plus à trouver la page web&#8230; J&#8217;utitlise le code suivant quand je veux charger du contenu dynamique comme du php et que je ne veux pas que Flash mette ma requête en cache. Voici la version ActionScript 2 du code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="actionscript"><span style="color: #000000; font-weight: bold;">function</span> generateRandomString<span style="color: #66cc66;">&#40;</span>newLength:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">var</span> a:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&quot;</span>;
  <span style="color: #000000; font-weight: bold;">var</span> alphabet:<span style="color: #0066CC;">Array</span> = a.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #000000; font-weight: bold;">var</span> randomLetter:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;&quot;</span>;
  <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&lt;</span>newLength; i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
    randomLetter += alphabet<span style="color: #66cc66;">&#91;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">floor</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">*</span> alphabet.<span style="color: #0066CC;">length</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>;
  <span style="color: #66cc66;">&#125;</span>
  <span style="color: #b1b100;">return</span> randomLetter;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>Pour la version ActionScript 3 j&#8217;ai fait quelques petites optimisations et j&#8217;ai créé une classe avec une version statique de la méthode; voici le code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="actionscript">package net.<span style="color: #006600;">zedia</span>.<span style="color: #006600;">utils</span><span style="color: #66cc66;">&#123;</span>
  <span style="color: #0066CC;">public</span> final <span style="color: #000000; font-weight: bold;">class</span> StringUtils<span style="color: #66cc66;">&#123;</span>
    <span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">function</span> generateRandomString<span style="color: #66cc66;">&#40;</span>newLength:uint = <span style="color: #cc66cc;">1</span>, userAlphabet:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&quot;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">var</span> alphabet:<span style="color: #0066CC;">Array</span> = userAlphabet.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span>;
      <span style="color: #000000; font-weight: bold;">var</span> alphabetLength:<span style="color: #0066CC;">int</span> = alphabet.<span style="color: #0066CC;">length</span>;
      <span style="color: #000000; font-weight: bold;">var</span> randomLetters:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;&quot;</span>;
      <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:uint = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&amp;</span>lt;newLength; i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
         randomLetters += alphabet<span style="color: #66cc66;">&#91;</span><span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">floor</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">*</span> alphabetLength<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>;
      <span style="color: #66cc66;">&#125;</span>
      <span style="color: #b1b100;">return</span> randomLetters;
    <span style="color: #66cc66;">&#125;</span>
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>Voici comment l&#8217;utiliser:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="actionscript"><span style="color: #0066CC;">import</span> net.<span style="color: #006600;">zedia</span>.<span style="color: #006600;">utils</span>.<span style="color: #006600;">StringUtils</span>;
<span style="color: #0066CC;">trace</span> <span style="color: #66cc66;">&#40;</span>StringUtils.<span style="color: #006600;">generateRandomString</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">4</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<span style="color: #808080; font-style: italic;">//for a random string of 4 characters</span>
<span style="color: #0066CC;">trace</span> <span style="color: #66cc66;">&#40;</span>StringUtils.<span style="color: #006600;">generateRandomString</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">4</span>, <span style="color: #ff0000;">&quot;ROGER&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<span style="color: #808080; font-style: italic;">//for a random string of 4 characters using only the following letters: ROGER</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/fr/2008/generer-une-chaine-de-caracteres-string-aux-hazard-en-as2-et-as3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>zedia flash blog maintenant en Français</title>
		<link>http://www.zedia.net/fr/2008/zedia-flash-blog-maintenant-en-francais/</link>
		<comments>http://www.zedia.net/fr/2008/zedia-flash-blog-maintenant-en-francais/#comments</comments>
		<pubDate>Wed, 14 May 2008 02:17:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[personel]]></category>

		<category><![CDATA[traduction]]></category>

		<category><![CDATA[zedia]]></category>

		<guid isPermaLink="false">http://www.zedia.net/fr/?p=3</guid>
		<description><![CDATA[J&#8217;ai commencé a écrire ce blogue avec comme but de rejoindre le plus grand auditoire possible, il était donc normal que je commence à le faire en anglais. J&#8217;avais songé à l&#8217;écrire dans les deux langues, mais je pensais que cela me prendrais trop de temps; j&#8217;ai une vie à vivre après tout. Par contre, [...]]]></description>
			<content:encoded><![CDATA[<p>J&#8217;ai commencé a écrire ce blogue avec comme but de rejoindre le plus grand auditoire possible, il était donc normal que je commence à le faire en anglais. J&#8217;avais songé à l&#8217;écrire dans les deux langues, mais je pensais que cela me prendrais trop de temps; j&#8217;ai une vie à vivre après tout. Par contre, par moment je n&#8217;ai plus d&#8217;inspiration pour écrire du contenu original. Sois je travaille sur de vieux projets ou bien je ne rencontre pas de problèmes qui vaillent la peine d&#8217;être expliqués. Par contre, il arrive souvent que par moment de non-inspiration, j&#8217;aille tout de même le goût d&#8217;écrire.</p>
<p>Voilà où entre en jeu la version francophone de mon blogue. Bon, on dirait que j&#8217;écris par dépit en français, mais ce n&#8217;est pas le cas. Traduire mon blogue répond aussi mon désir de rejoindre plus de gens, c&#8217;est juste qu&#8217;à un certain point il faut faire des choix. Donc je ne promets pas que 100% des articles seront traduits, mais la majorité le seront.</p>
<p>Bon, trève de bavardages, je vais de ce pas traduire mon premier article.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/fr/2008/zedia-flash-blog-maintenant-en-francais/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
