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

<channel>
	<title>Handnotes &#187; Flash</title>
	<atom:link href="http://memmie.lenglet.name/category/flash/feed" rel="self" type="application/rss+xml" />
	<link>http://memmie.lenglet.name</link>
	<description>Some tests, tricks and sugar</description>
	<lastBuildDate>Sat, 03 Oct 2009 14:49:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Font streaming</title>
		<link>http://memmie.lenglet.name/flash/actionscript/font-streaming</link>
		<comments>http://memmie.lenglet.name/flash/actionscript/font-streaming#comments</comments>
		<pubDate>Sun, 19 Jul 2009 01:32:26 +0000</pubDate>
		<dc:creator>Mem's</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Typography]]></category>
		<category><![CDATA[fstream]]></category>

		<guid isPermaLink="false">http://memmie.lenglet.name/?p=64</guid>
		<description><![CDATA[Update: Now the project is on google code A promise is a promise Now you can download sources of my library handling progressive download of fonts for Flash. I clean up all to separate different works. 1. Waterfall demo Main demo proof of concept. Demonstrate the system with non embed fonts where chars are loaded [...]]]></description>
			<content:encoded><![CDATA[<p><ins>Update: Now the project is on <a href="http://code.google.com/p/fstream/">google code</a></ins></p>
<p>A promise is a promise <img src='http://memmie.lenglet.name/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Now you can download sources of my library handling progressive download of fonts for Flash.</p>
<p>I clean up all to separate different works.</p>
<h3>1. Waterfall demo</h3>
<p><a href="http://memmie.lenglet.name/documents/lab/fontstream/waterfall_demo.html"><img src="http://memmie.lenglet.name/wp-content/uploads/2009/07/fontstream.png" alt="Font stream waterfall demo" title="Font stream waterfall demo" /></a></p>
<p>Main demo proof of concept. Demonstrate the system with non embed fonts where chars are loaded when them entered. Also give an example to the usage with Flex on custom components (through <code>Text.fontContext</code>)</p>
<h3>2. Font cache generator</h3>
<p>An AS3 Command line executable (made with <a href="http://code.google.com/p/redtamarin/">redtamarin</a>) allow quickly generate fonts cache. A binary file format used to serve fast small amount of font data (optionaly a format used to storage data).</p>
<p>Use it to add more supported fonts for build in test (Waterfall demo). For generate font cache files simply use console: <code>fcgen embed_fonts.swf</code> (or use <code>--help</code> for display help), put generated files (by default <code>*.foncache</code>) in fontcache folder and update <code>fontlist.xml</code></p>
<p>This contains also 2 others version, an old version in AS3/SWF by passing the SWF file by clicking on stage first and save the result by click second, and an not working flex alternative (read only some information about the SWF file passing through the button &#8220;open&#8221;).</p>
<h3>3. SWF template base</h3>
<p>Not realy important but used for generated the template used in library for generate dynamically SWF file contain fonts data.</p>
<p>Here miss an other part used to modify the SWF template for keep only needed informations (remove debug, metadata &#8230;)</p>
<p>And finally an example to embed font with Flex SDK.</p>
<h3>Notice</h3>
<p>I&#8217;m currently work on a big multilingual project which use it. But the server get in trouble (we suppose) with PHP when handling huge file like for Arial Unicode MS for <abbr title="Chinese Japanese and Korean">CJK</abbr> texts. We use a (temporary ?) solution by caching requested files and serve again for same requests. This not include in sources.</p>
<p>Beyond, is hard to get styles applied on HTML text. This for what, I had create a class handling HTML text and parsing it to know used text/fonts, improve HTML support by TextField (by some hack and HTML transformations). Is not yet include in souces.</p>
<ul>
<li>Can have memory impact or CPU time when intensive usage for large range of chars (need be more tested)</li>
<li>Not all font information supported, but maybe no real impact (Small text ? and language code ? )</li>
<li><strong>Server performance</strong> (PHP parsing and generating are time consumer) (need enhance by optimizing the script or use an other language like C/C++ or use a DB for stocking gyphs data instead a unique file)</li>
<li>Only TextField can use it, not supported by new Flash 10 TextEngine, it use an other way to embed font (CFF Fonts) (need support DefineFont4 tag)</li>
<li>The font embedded by Flash are cleaner than Flex SDK, but Flash CS3 allow generate fake italic and bold whereas Flash CS4 allow used real font styles (Light, Condensed, Heavy &#8230;)</li>
</ul>
<p>No licence explicitly declared but sure i think as GPL, no AS3 package, more examples, SVN, dedicated page, real name, logo &#8230; this will come.</p>
<p><del><a href="http://memmie.lenglet.name/documents/lab/fontstream/FontStream.zip">Download it</a> ~50Mo</del> <ins><a href="http://code.google.com/p/fstream/downloads/list">Download it on google code</a></ins></p>
]]></content:encoded>
			<wfw:commentRss>http://memmie.lenglet.name/flash/actionscript/font-streaming/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>[JSFL] Publish all opened FLA</title>
		<link>http://memmie.lenglet.name/flash/jsfl-publish-all-opened-fla</link>
		<comments>http://memmie.lenglet.name/flash/jsfl-publish-all-opened-fla#comments</comments>
		<pubDate>Sun, 12 Jul 2009 08:08:36 +0000</pubDate>
		<dc:creator>Mem's</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://memmie.lenglet.name/?p=52</guid>
		<description><![CDATA[When you work on a large project, sometime often, you need to recompile all FLAs. With this script, you can do this without execute the compilation by hand for each. Download it: Publish all.jsfl Install it in apt folder : Windows Vista: boot drive\Users\username\Local Settings\Application Data\Adobe\Flash CS4\language\Configuration\Commands Windows XP: boot drive\Documents and Settings\user\Local Settings\Application Data\Adobe\Flash [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://memmie.lenglet.name/wp-content/uploads/2009/07/commands_menu_fr.png" alt="Command menu on CS4 French" title="Commands menu FR" /></p>
<p>When you work on a large project, <del>sometime</del> often, you need to recompile all FLAs. With this script, you can do this without execute the compilation by hand for each.</p>
<p>Download it: <a href="http://memmie.lenglet.name/documents/lab/Publish%20all.jsfl">Publish all.jsfl</a></p>
<p>Install it in apt folder :</p>
<ul>
<li>Windows Vista: <code>boot drive\Users\username\Local Settings\Application Data\Adobe\Flash CS4\language\Configuration\Commands</code></li>
<li>Windows XP: <code>boot drive\Documents and Settings\user\Local Settings\Application Data\Adobe\Flash CS4\language\Configuration\Commands</code></li>
<li>Mac OS X: <code>Macintosh HD/Users/userName/Library/Application Support/Adobe/Flash CS4/language/Configuration/Commands</code></li>
</ul>
<p>(You don&#8217;t need relaunch Flash CS4)</p>
<p>Go to menu &#8220;Command&#8221; > &#8220;Publish all&#8221; and voilà.</p>
<p>Resources:</p>
<ul>
<li><a href="http://help.adobe.com/en_US/Flash/10.0_ExtendingFlash/index.html">Extending Flash CS4</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://memmie.lenglet.name/flash/jsfl-publish-all-opened-fla/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Streaming de polices</title>
		<link>http://memmie.lenglet.name/flash/actionscript/streaming-de-polices</link>
		<comments>http://memmie.lenglet.name/flash/actionscript/streaming-de-polices#comments</comments>
		<pubDate>Sun, 15 Mar 2009 18:36:01 +0000</pubDate>
		<dc:creator>Mem's</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Typography]]></category>
		<category><![CDATA[fstream]]></category>

		<guid isPermaLink="false">http://memmie.lenglet.name/?p=33</guid>
		<description><![CDATA[Je viens de mettre au point un système qui permet d&#8217;utiliser des polices embarquées, mais seulement de charger les caractères nécessaires. Le système est simple : Le server de streaming Il va s&#8217;occuper de la sélection des caractères à retourner en fonction de ceux demandés. Le client Il va s&#8217;occuper de faire le choix des [...]]]></description>
			<content:encoded><![CDATA[<p>Je viens de mettre au point un système qui permet d&#8217;utiliser des polices embarquées, mais seulement de charger les caractères nécessaires.</p>
<p>Le système est simple :</p>
<dl>
<dt>Le server de streaming</dt>
<dd>Il va s&#8217;occuper de la sélection des caractères à retourner en fonction de ceux demandés.</dd>
<dt>Le client</dt>
<dd>Il va s&#8217;occuper de faire le choix des caractères nécessaires (en fonction du texte à afficher) ainsi que le leur rapatriement et l&#8217;intégration aux polices à utiliser.</dd>
</dl>
<p><img src="http://memmie.lenglet.name/wp-content/uploads/2009/03/scheme.png" alt="SWF to Font cache to SWF" title="Font stream scheme" /></p>
<p><a href="/documents/lab/fontstream/waterfall_demo.html">Voir la démo</a></p>
<p>La police Arial Unicode MS, contient la majorité des plages unicodes : Latin, CJK (Chinois, Japonais, Coréen), Cyrillique, Hébreu, &#8230;</p>
<p>A titre d&#8217;information :</p>
<ul>
<li>ShinGoPro-Medium_regular.fontcache 3,38Mo (A-OTF-ShinGoPro-Medium.otf 3,11Mo)</li>
<li>Arial Unicode MS_regular.fontcache 9,96Mo (Arial Unicode MS.otf 23,28Mo)</li>
<li>CodingFontTobi_regular.fontcache 53Ko (cft.ttf 47Ko)</li>
<li>Coca Cola ii_regular.fontcacheCoca 20Ko (Cola ii.ttf 58Ko)</li>
<li>Futura_boldItalic.fontcache 27Ko (Futura Bold Italic.ttf 35Ko)</li>
<li>Futura_bold.fontcache 25Ko (Futura Bold.ttf 34Ko)</li>
<li>Futura Heavy_regular.fontcache 28Ko (Futura-Heavy.otf 17Ko)</li>
<li>Futura Heavy_italic.fontcache 29Ko (Futura-HeavyOblique.otf 17Ko)</li>
<li>Futura Light_regular.fontcache 29Ko (Futura-Light.otf 17Ko)</li>
<li>Futura_italic.fontcache 29Ko (Futura-Oblique.otf 16Ko)</li>
<li>Futura Heavy_regular.fontcache 28Ko (Futura.otf 16Ko)</li>
<li>Futura Condensed_regular.fontcache 28Ko (FuturaCondMedium.otf 22Ko)</li>
<li>Microsoft YaHei_bold.fontcache 8,7Mo (Microsoft YaHei Bold.otf 14,69Mo)</li>
<li>Microsoft YaHei_regular.fontcache 8,89Mo (Microsoft YaHei.otf 15,04Mo)</li>
<li>SegoeUI_regular.fontcache 252Ko (segoeui.ttf 415Ko)</li>
</ul>
<p>Total 31,48Mo (56,81Mo)</p>
]]></content:encoded>
			<wfw:commentRss>http://memmie.lenglet.name/flash/actionscript/streaming-de-polices/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Flash Player info reader</title>
		<link>http://memmie.lenglet.name/flash/flash-player-info-reader</link>
		<comments>http://memmie.lenglet.name/flash/flash-player-info-reader#comments</comments>
		<pubDate>Mon, 10 Nov 2008 11:27:12 +0000</pubDate>
		<dc:creator>Mem's</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://memmie.lenglet.name/?p=29</guid>
		<description><![CDATA[function testFlashToContainerCall() { return true; } function testContainerToFlashCall(identifier, callbackName) { return document.getElementById(identifier)[callbackName](); }]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript">
	function testFlashToContainerCall()
	{
		return true;
	}
	function testContainerToFlashCall(identifier, callbackName)
	{
		return document.getElementById(identifier)[callbackName]();
	}
</script></p>
<p>
<object type="application/x-shockwave-flash" data="/documents/lab/info/info_reader.swf" style="width: 370px; height: 420px;" id="infoReader" name="infoReader"><param name="movie" value="/documents/lab/info/info_reader.swf" /><param name="flashvars" value="var1=value1&amp;var2=value2" /><param name="wmode" value="transparent" /></object></p>
]]></content:encoded>
			<wfw:commentRss>http://memmie.lenglet.name/flash/flash-player-info-reader/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[How to] Create SVN managed project with 3rd part library on SVN</title>
		<link>http://memmie.lenglet.name/flash/as3/how-to-create-svn-managed-project-with-3rd-part-library-on-svn</link>
		<comments>http://memmie.lenglet.name/flash/as3/how-to-create-svn-managed-project-with-3rd-part-library-on-svn#comments</comments>
		<pubDate>Sat, 13 Sep 2008 11:54:59 +0000</pubDate>
		<dc:creator>Mem's</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://memmie.lenglet.name/?p=26</guid>
		<description><![CDATA[SVN has a smart fonctionality : Externals. The objective is import files from an other SVN repository Instead of download all of them and keep it in a folder (only one for all your project using this lib or a duplicate inside each projects), make only a link to the repository. For example, my project [...]]]></description>
			<content:encoded><![CDATA[<p>SVN has a smart fonctionality : Externals. The objective is import files from an other SVN repository<br />
Instead of download all of them and keep it in a folder (only one for all your project using this lib or a duplicate inside each projects), make only a link to the repository.<br />
For example, my project use <a href="http://blog.papervision3d.org/" title="Papervision 3D blog">Papervision 3D</a>. I need juste add &#8220;svn:externals&#8221; property to my root folder of classes.</p>
<p>On Window with Turtoise SVN : Right click on folder and select &#8220;TurtoiseSNV&#8221; > &#8220;Properties &#8230;&#8221;<br />
<img src="http://memmie.lenglet.name/wp-content/uploads/2008/09/turtoisesvn_menu.png" alt="Turtoise SVN folder menu" title="Turtoise SVN folder menu" /><br />
Click on &#8220;Add&#8221; button, select &#8220;svn:externals&#8221; for property name and set property value to :</p>
<pre>org/papervision3d http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/
org/ascollada http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/ascollada/
nochump http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/nochump/</pre>
<p><img src="http://memmie.lenglet.name/wp-content/uploads/2008/09/turtoisesvn_properties.png" alt="Turtoise SVN folder properties window" title="Turtoise SVN folder properties window" /><br />
Now commit and update your local copy.</p>
<p>Now indicated folders/files are synconized when you update your local copy with external(s) SVN(s)</p>
<p>For use a specific revision, use <code>-r</code> indicator. For example work with revision 727 of Papervision 3D, use property value :</p>
<pre>org/papervision3d <strong>-r727</strong> http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/
org/ascollada <strong>-r727</strong> http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/ascollada/
nochump <strong>-r727</strong> http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/nochump/</pre>
<p>You can also use SVN tags.</p>
<p>Resources:</p>
<ul>
<li><a href="http://svnbook.red-bean.com/nightly/en/svn.advanced.externals.html">SVN externals</a> on SVN book</li>
<li><a href="http://subversion.tigris.org/svn_1.5_releasenotes.html#externals">Externals</a> on SVN 1.5 release notes</li>
<li><a href="http://en.wikipedia.org/wiki/Subversion_(software)">Subversion</a> on Wikipedia</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://memmie.lenglet.name/flash/as3/how-to-create-svn-managed-project-with-3rd-part-library-on-svn/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Random non-uniform distribution</title>
		<link>http://memmie.lenglet.name/flash/actionscript/random-non-uniform-distribution</link>
		<comments>http://memmie.lenglet.name/flash/actionscript/random-non-uniform-distribution#comments</comments>
		<pubDate>Sun, 22 Jun 2008 13:58:09 +0000</pubDate>
		<dc:creator>Mem's</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>

		<guid isPermaLink="false">http://memmie.lenglet.name/?p=24</guid>
		<description><![CDATA[Ces graphiques sont généré à partir de 1 000 000 valeurs (à chaque affichage). Le rouge est la valeur moyenne et le rose est la répartition moyenne de probabilité (tout les valeurs on le même probabilité de sortir) Sources Ce qui serai excellent c&#8217;est de faire la même chose mais avec des points de contrôles [...]]]></description>
			<content:encoded><![CDATA[<p>
<object type="application/x-shockwave-flash" data="/documents/lab/random/RandomDistributionDemo.swf" style="width: 256px; height: 512px;"><param name="movie" value="/documents/lab/random/RandomDistributionDemo.swf" /></object><br />
Ces graphiques sont généré à partir de 1 000 000 valeurs (à chaque affichage). Le rouge est la valeur moyenne et le rose est la répartition moyenne de probabilité (tout les valeurs on le même probabilité de sortir)</p>
<p><a href="/documents/lab/random/random_distribution.zip">Sources</a></p>
<p>Ce qui serai excellent c&#8217;est de faire la même chose mais avec des points de contrôles comme pour les courbes de bézier.</p>
<p>Des liens :</p>
<ul>
<li><a href="http://lab.polygonal.de/index.php?s=seed">A good Pseudo-Random Number Generator (PRNG)</a></li>
<li><a href="http://www.gskinner.com/blog/archives/2008/01/source_code_see.html">Source Code: Seeded Random in ActionScript 3</a></li>
<li><a href="http://pixelero.wordpress.com/2008/04/24/various-functions-and-various-distributions-with-mathrandom/">various functions with different distributions for Math.random()</a></li>
<li><a href="http://www.gskinner.com/blog/archives/2008/01/source_code_ran.html">Source Code: Random Methods Utility Class</a></li>
<li><a href="http://mathworld.wolfram.com/UniformSumDistribution.html">Uniform Sum Distribution</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://memmie.lenglet.name/flash/actionscript/random-non-uniform-distribution/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash et les langues &#8220;exotiques&#8221;</title>
		<link>http://memmie.lenglet.name/flash/flash-et-les-langues-exotiques</link>
		<comments>http://memmie.lenglet.name/flash/flash-et-les-langues-exotiques#comments</comments>
		<pubDate>Sat, 21 Jun 2008 09:16:21 +0000</pubDate>
		<dc:creator>Mem's</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Typography]]></category>

		<guid isPermaLink="false">http://memmie.lenglet.name/?p=23</guid>
		<description><![CDATA[Comment faire quand on a un Flash avec du texte dynamique en français, anglais, russe ou chinois ? Déjà le problème c’est qu’on ne peut pas utiliser qu’une seule police. Le graphisme utilise une police, mais celle-ci, dans la majorité des cas ne gère pas tout les caractère Unicode. Faire une concession sur le graphisme, [...]]]></description>
			<content:encoded><![CDATA[<p>Comment faire quand on a un Flash avec du texte dynamique en français, anglais, russe ou chinois ?</p>
<p>Déjà le problème c’est qu’on ne peut pas utiliser qu’une seule police. Le graphisme utilise une police, mais celle-ci, dans la majorité des cas ne gère pas tout les caractère Unicode.<br />
Faire une concession sur le graphisme, ou utilise 2 polices ?</p>
<p>Une police qui gère le chinois ? Pas sûr, par exemple avec la police PMingLiU (police par défaut sur XP gérant les caractères asiatiques) avec les caractères chinois tous (Chinois traditionnel tous + chinois simplifié) sois 21664 caractères, on rajoute 12Mo au SWF&#8230;</p>
<p>Après quelques tests, le seul moyen que j’ai trouvé, c’est d’utiliser pour les langues européennes (romanes et germaniques) la police du graphisme (exemple : DIN ou Helvetica) et pour les autres langues utiliser la police _sans.<br />
Le seul soucis c’est que pour du texte qui utilise la police _sans, il faut le mettre en <code>myTextField.embedFonts = false;</code> sinon elle n’apparaitra pas. De ce fait, on ne pourra pas appliquer des transformation tels que la rotation ou le scaling au champs texte quand on utilise _sans. Seule l’alpha peut être appliqué en mettant le champ texte en mode de fusion <code>BlendMode.LAYER</code></p>
<p>La seule chose qu’il reste à faire, c’est détecter quand on doit utiliser _sans ? Quelques pistes :</p>
<ul>
<li>Identifier la langue utilisé et faire une correspondance (exemple <a href="http://www.w3.org/International/questions/qa-css-lang#colon-lang">l’attribut lang et/ou xml:lang</a>)</li>
<li>Vérifier chaque caractère si il exsite dans la police, sinon utiliser _sans avec <code>myFont.hasGlyphs(myString);</code></li>
</ul>
<p>Informations complémentaires :</p>
<ul>
<li><a href="http://www.w3.org/International/articles/language-tags/">Language tags in HTML and XML</a></li>
<li><a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/Font.html#hasGlyphs%28%29">flash.text.Font:hasGlyphs()</a></li>
<li><a href="http://www.ietf.org/rfc/rfc1766.txt">RFC 1766: Tags for the Identification of Languages</a></li>
<li><a href="http://www.w3.org/TR/html401/struct/dirlang.html#h-8.1.1">HTML 4.01 Specification &#8211; Language information and text direction</a></li>
<li><a href="http://en.wikipedia.org/wiki/Summary_of_Unicode_character_assignments">Summary of Unicode character assignments</a></li>
<li><a href="http://en.wikipedia.org/wiki/List_of_Unicode_characters">List of Unicode characters</a></li>
<li><a href="http://livedocs.adobe.com/flash/9.0/main/00000894.html">Creating custom character sets in Flash CS3</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://memmie.lenglet.name/flash/flash-et-les-langues-exotiques/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cadratin &#8211; part 1</title>
		<link>http://memmie.lenglet.name/flash/actionscript/cadratin-part-1</link>
		<comments>http://memmie.lenglet.name/flash/actionscript/cadratin-part-1#comments</comments>
		<pubDate>Mon, 26 May 2008 23:35:32 +0000</pubDate>
		<dc:creator>Mem's</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[fstream]]></category>

		<guid isPermaLink="false">http://memmie.lenglet.name/?p=21</guid>
		<description><![CDATA[L&#8217;AS3 à permis d&#8217;ouvrir la porte à pas mal de choses dont 2 intéressantes : la gestion native de ByteArray et le chargement dynamique de SWF à partir de données contenu dans un ByteArray. Dit comme ça, ça n&#8217;a pas forcément d&#8217;intérêt immédiat. Seulement, le fait de pouvoir modifier/générer les données binaires d&#8217;un SWF et [...]]]></description>
			<content:encoded><![CDATA[<p>L&#8217;AS3 à permis d&#8217;ouvrir la porte à pas mal de choses dont 2 intéressantes : la gestion native de ByteArray et le chargement dynamique de SWF à partir de données contenu dans un ByteArray.</p>
<p>Dit comme ça, ça n&#8217;a pas forcément d&#8217;intérêt immédiat. Seulement, le fait de pouvoir modifier/générer les données binaires d&#8217;un SWF et de les charger pour les récuperer sous forme native, ça change pas mal de choses !<br />
Image, vidéo ou vectoriel bon ça on peut déjà le faire nativement avec BitmapData et Video ou Shape. Mais on peux aussi le faire pour du <a href="http://www.flashcodersbrighton.org/wordpress/?p=9">son</a>, du code <a href="http://eval.hurlant.com/">ActionScript</a>, ou pour une police embarquée. C&#8217;est ce dernier point, qui m&#8217;intéresse et qui n&#8217;a pas encore vraiment été exploré.</p>
<p>Pour ce faire, j&#8217;ai appris à lire les données brut du format SWF : <a href="/documents/lab/cadratin/index.html">demo</a>, <a href="/documents/lab/cadratin/Cadratin.zip">sources</a><br />
Attention les logs générés sont assez lourds ~1Mo pour un SWF d&#8217;environ 30Ko contenant seulement une police embarqué.</p>
<p>Ca lit les données global d&#8217;un SWF (dimensions, couleur de fond, bibliothèque) ainsi que tout la partie qui gère les polices (le nom de la police, les données de dessins des glyphs &#8230;). Il faudra ensuite que je fasse l&#8217;opération inverse : génerer les données nécéssaire à l&#8217;intégration d&#8217;une police dans un SWF.</p>
<p>Liens :</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Em_%28typography%29">Em</a></li>
<li><a href="http://fr.wikipedia.org/wiki/Cadratin">Cadratin</a></li>
<li><a href="http://www.m2osw.com/fr/swf_alexref.html">Alexis&#8217; SWF Reference</a> <a href="/web-archive/swf_alexref.html">Mirror</a></li>
<li><a href="http://developer.apple.com/textfonts/TTRefMan/RM08/appendixE.html">Converting Outlines to the TrueType Format</a></li>
<li><a href="http://code.google.com/p/flash-decompiler/">flash-decompiler</a></li>
<li><a href="http://steve.hollasch.net/cgindex/curves/cbez-quadspline.html">Converting Bezier Curves to Quadratic Splines</a></li>
<li><a href="http://lab.libspark.org/trac/browser/as3/ByteCodeDisassembler">ByteCodeDisassembler</a></li>
<li><a href="http://xmlgraphics.apache.org/fop/">Formatting Objects Processor</a></li>
<li><a href="http://jnode.org/">JNode</a></li>
<li><a href="http://www.pdfbox.org/">PDFBox</a></li>
<li><a href="http://www.libming.org">Ming</a></li>
<li><a href="http://sourceforge.net/projects/jarexplorer/">Jar Explorer (with JODE)</a></li>
<li><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Font.html#createFont(int,%20java.io.InputStream)">java.awt.Font</a></li>
<li><a href="http://www.sephiroth.it/weblog/archives/2007/07/fontreader_convert_truetype_fonts_in.php">Ming</a> – by sephiroth / Alessandro Crugnola</li>
<li><a href="http://www.adobe.com/devnet/swf/pdf/swf_file_format_spec_v9.pdf">SWF file format specification</a></li>
<li><a href="http://www.half-serious.com/swf/format/">Macromedia Flash File Format (SWF)</a></li>
<li><a href="http://www.codeplex.com/swf">SWF.Net</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://memmie.lenglet.name/flash/actionscript/cadratin-part-1/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[How to] Image format</title>
		<link>http://memmie.lenglet.name/flash/actionscript/image-format</link>
		<comments>http://memmie.lenglet.name/flash/actionscript/image-format#comments</comments>
		<pubDate>Mon, 26 May 2008 17:16:33 +0000</pubDate>
		<dc:creator>Mem's</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://memmie.lenglet.name/?p=22</guid>
		<description><![CDATA[Un problème auquel j&#8217;ai été confronté récemment, c&#8217;est le poids que font des PNG 32bits de taille moyen ~ 400px * 500px pour ~ 200Ko. En passant par PNGOUT on gagne une ou deux dizaine de kilooctet au maximum. Seulement, ces images au nombre d&#8217;une vingtaine était utilisé simultanément (ou presque). Rien qu&#8217;une image au [...]]]></description>
			<content:encoded><![CDATA[<p>Un problème auquel j&#8217;ai été confronté récemment, c&#8217;est le poids que font des PNG 32bits de taille moyen ~ 400px * 500px pour ~ 200Ko. En passant par PNGOUT on gagne une ou deux dizaine de kilooctet au maximum.<br />
Seulement, ces images au nombre d&#8217;une vingtaine était utilisé simultanément (ou presque). Rien qu&#8217;une image au poids de 200Ko dépasse largement le poids normal conseillé d&#8217;une page HTML (JS + CSS + images compris).</p>
<p>Pourtant je devais absolument disposer d&#8217;images transparente. Hélas seul le format acceptable dans ce cas est le PNG. Le BMP, TIFF ou encore TGA étant encore plus lourd, de plus non géré nativement dans Flash. Comment réduire le poid (compression lossy ?) et tout en conservant la transparence (une palette gris ?) tout ça en utilisant un containers supportés par Flash ou en passant par une librairies (si faut pas la faire une sois même) ?</p>
<p>Je suis pas allé très loin pour trouver la solution : utiliser 2 images au lieu d&#8217;une. Un JPEG pour les canneaux rouge, vert, bleu, plus un PNG 8bits (voir moins) en palette de gris pour la transparence. Restait plus qu&#8217;a les gérer dans flash.</p>
<pre>var rgb:BitmapData = myRGBBitmapData;
var alpha:BitmapData = myAlphaBitmapData;

//Loaded JPEG BitmapData are not transparent
argb = new BitmapData(rgb.width, rgb.height, true, 0x00000000);
//Copy RGB
argb.copyPixels
(
	rgb,
	new Rectangle(0, 0, rgb.width, rgb.height),
	new Point(0, 0)
)

//Apply alpha channel
argb.copyChannel
(
	alpha,
	new Rectangle(0, 0, alpha.width, alpha.height),
	new Point(0, 0),
	BitmapDataChannel.RED,//r = g = b = gray
	BitmapDataChannel.ALPHA
);

//ARGB is ready to use
argb;</pre>
<p>Le réslutat :<br />
<object type="application/x-shockwave-flash" data="/documents/lab/jpng/ReadJPNG.swf" id="ReadJPNG" name="ReadJPNG" style="width: 100%; height: 400px; display:block; margin-top: 0.2em;"><param name="movie" value="/documents/lab/jpng/ReadJPNG.swf" /><param name="allowScriptAccess" value="always" /><param name="flashvars" value="rgb=/documents/lab/jpng/rgb.jpg&#038;alpha=/documents/lab/jpng/alpha.png" /></object></p>
<p><a href="/documents/lab/jpng/rgb.jpg">RGB (JPEG)</a> (<strong>32&nbsp;024</strong> octets) + <a href="/documents/lab/jpng/alpha.png">Alpha (PNG8)</a> (<strong>12&nbsp;037</strong> octets) = <strong>44&nbsp;061</strong> octets vs. <a href="/documents/lab/jpng/argb.png">Result (PNG32)</a> (<strong>58&nbsp;618</strong> octets). Soit un gain de 25% par rapport à l&#8217;original. On peut même atteindre un gain de 90%.<br />
On pourrai aller encore plus loin en les compressant dans un fichier 7zip. Dans notre cas celui ci permet de gagner encore 10&nbsp;422 octets, soit au final 57% de la taille originale.</p>
<p>Dans tout ça, le problème après, c&#8217;est le temps de calcul nécessaire à la lecture et la décompression du(des) fichier(s) chargé(s) plus le temps de calcul pour que Flash fasse la fusion des 2 images.</p>
<p>Les sources :</p>
<ul>
<li><a href="/documents/lab/jpng/ReadJPNG.as">ActionScript source</a></li>
<li><a href="/documents/lab/jpng/JPNG.zip">All sources (Zip)</a></li>
</ul>
<p>Mais sinon pourquoi pas ?</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Comparison_of_graphics_file_formats">Comparison of graphics file formats</a> – by Wikipedia</li>
<li><a href="http://en.wikipedia.org/wiki/Progressive_Graphics_File">Progressive Graphics File</a> – by Wikipedia</li>
<li><a href="http://sourceforge.net/projects/libpgf/">libPGF</a></li>
<li><a href="http://en.wikipedia.org/wiki/HD_Photo">HD Photo</a> – by Wikipedia</li>
<li><a href="http://www.bytearray.org/?p=105">ASZip</a></li>
<li><a href="http://www.nochump.com/blog/?p=15">ZipLib</a> – by nochump</li>
<li><a href="http://codeazur.com.br/lab/fzip/">FZip</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://memmie.lenglet.name/flash/actionscript/image-format/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Astro say :</title>
		<link>http://memmie.lenglet.name/flash/astro-say</link>
		<comments>http://memmie.lenglet.name/flash/astro-say#comments</comments>
		<pubDate>Thu, 15 May 2008 12:19:05 +0000</pubDate>
		<dc:creator>Mem's</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://memmie.lenglet.name/?p=20</guid>
		<description><![CDATA[Some classes name from ABC data : //Inverse Kinematics fl.ik:IKBone fl.ik:IKJoint fl.ik:IKNode fl.ik:IKLink fl.ik:IKSubTree fl.ik:IKArmature fl.ik:IKShapeTree fl.ik:IKShapeNode fl.ik:IKUtils fl.ik:Contour fl.ik:ContourPoint fl.ik:ConnectionData fl.ik:IKSymbolNode fl.ik:IKManager //Vector Data Type __AS3__.vec.Vector //Maybe not new ? GraphicsPath IGraphicsData //Custom Filters and Effects Shader flash.filters:ShaderFilter flash.display:ShaderParameter //? com.adobe.astrobox.events:FaceEvent com.adobe.astrobox.events:Tween3DEvent com.adobe.astrobox.events:TrackEvent com.adobe.astrobox.transitions:Tween3D com.adobe.astrobox.managers:FaceManager com.adobe.astrobox.display:Face com.adobe.astrobox.views:Main//Use for Main.swf //Text vellum_flash //FOV property access [...]]]></description>
			<content:encoded><![CDATA[<p>Some classes name from ABC data :</p>
<pre>//Inverse Kinematics
fl.ik:IKBone
fl.ik:IKJoint
fl.ik:IKNode
fl.ik:IKLink
fl.ik:IKSubTree
fl.ik:IKArmature
fl.ik:IKShapeTree
fl.ik:IKShapeNode
fl.ik:IKUtils
fl.ik:Contour
fl.ik:ContourPoint
fl.ik:ConnectionData
fl.ik:IKSymbolNode
fl.ik:IKManager

//Vector Data Type
__AS3__.vec.Vector

//Maybe not new ?
GraphicsPath
IGraphicsData

//Custom Filters and Effects
Shader
flash.filters:ShaderFilter
flash.display:ShaderParameter

//?
com.adobe.astrobox.events:FaceEvent
com.adobe.astrobox.events:Tween3DEvent
com.adobe.astrobox.events:TrackEvent
com.adobe.astrobox.transitions:Tween3D
com.adobe.astrobox.managers:FaceManager
com.adobe.astrobox.display:Face
com.adobe.astrobox.views:Main//Use for Main.swf

//Text
vellum_flash

//FOV property access
&lt;DisplayObject&gt;.transform.perspectiveProjection.fieldOfView = 50</pre>
<ul>
<li><a href="http://labs.adobe.com/technologies/flashplayer10/releasenotes.html">All improvements</a></li>
<li><a href="http://wiki.libspark.org/wiki/FlashPlayer/10/API">Flash Player 10 API</a> on Libspark project</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://memmie.lenglet.name/flash/astro-say/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
