<?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>meta for(...) &#187; Bug</title>
	<atom:link href="http://www.meta-for.net/tag/bug/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.meta-for.net</link>
	<description>Actionscript poetic code</description>
	<pubDate>Tue, 20 Jul 2010 21:08:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>addCallback() et doctype</title>
		<link>http://www.meta-for.net/152/addcallback-et-doctype/</link>
		<comments>http://www.meta-for.net/152/addcallback-et-doctype/#comments</comments>
		<pubDate>Thu, 20 May 2010 08:13:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Actionscript3]]></category>

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

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

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

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

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

		<guid isPermaLink="false">http://www.meta-for.net/?p=152</guid>
		<description><![CDATA[Voilà une petite découverte qui m&#8217;a fait chercher un bon ptit moment l&#8217;autre jour. Voici un exemple:

ExternalInterface.addCallback&#40;&#34;callAs&#34;, cb&#41;;
btn.addEventListener&#40; MouseEvent.CLICK , clickHandler &#41;;
&#160;
private function clickHandler&#40; evt : MouseEvent &#41; : void
&#123;
    if&#40; ExternalInterface.available &#41;
    &#123;
        ExternalInterface.call&#40; &#34;callJS&#34; &#41;;
    &#125;
&#125;
&#160;
private function [...]]]></description>
			<content:encoded><![CDATA[<p>Voilà une petite découverte qui m&#8217;a fait chercher un bon ptit moment l&#8217;autre jour. Voici un exemple:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript actionscript" style="font-family:monospace;">ExternalInterface.<span style="color: #006600;">addCallback</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;callAs&quot;</span>, cb<span style="color: #66cc66;">&#41;</span>;
btn.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> MouseEvent.<span style="color: #006600;">CLICK</span> , clickHandler <span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> clickHandler<span style="color: #66cc66;">&#40;</span> evt : MouseEvent <span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> ExternalInterface.<span style="color: #006600;">available</span> <span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
        ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;callJS&quot;</span> <span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> cb<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;As called&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="html4strict html4strict" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span> xmlns<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span> <span style="color: #000066;">lang</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;en&quot;</span> xml:<span style="color: #000066;">lang</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;en&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html; charset=iso-8859-1&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;swfobject.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
            var flashvars = {};
            var params = {};
            params.wmode = &quot;transparent&quot;;
            params.allowscriptaccess = &quot;always&quot;;
            var attributes = {};
            attributes.id = &quot;flashcontent&quot;;
            attributes.name = &quot;myFlashContent&quot;;
            swfobject.embedSWF(&quot;Main.swf&quot;, &quot;myAlternativeContent&quot;, &quot;800&quot;, &quot;600&quot;, &quot;10.0.0&quot;, false, flashvars, params, attributes);
&nbsp;
            function callJS()
            {
                window.alert(&quot;callJS&quot;);
                flashcontent.callAs();
            }
        <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myAlternativeContent&quot;</span>&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.adobe.com/go/getflashplayer&quot;</span>&gt;</span>
                <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Get Adobe Flash player&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
            <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></div></div>

<p>Vous noterez que j&#8217;appelle le callback sur &#8220;flashcontent&#8221; qui est l&#8217;id du Flash. Et bien sous cette configuration callJS() est bien appelé, mais pas le callback. Mais étonnement tout s&#8217;exécute correctement si je supprime la première ligne du code html, le doctype. J&#8217;ai le même résultat sur Firefox 3.6 et Safari sur Mac. J&#8217;imagine que le fait d&#8217;effacer le doctype désactive le mode strict de rendu html.<br />
La solution consiste, et c&#8217;est la bonne pratique à utiliser de toute manière, à utiliser document de cette manière :</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict html4strict" style="font-family:monospace;">document[&quot;flashcontent&quot;].callAs();</pre></div></div>

<p>Voilou, voilou</p>
]]></content:encoded>
			<wfw:commentRss>http://www.meta-for.net/152/addcallback-et-doctype/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Bug ? Flex SDK 4 Gumbo et Collada Object</title>
		<link>http://www.meta-for.net/104/bug-flex-sdk-4-gumbo-et-collada-object/</link>
		<comments>http://www.meta-for.net/104/bug-flex-sdk-4-gumbo-et-collada-object/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 21:32:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[3d]]></category>

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

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

		<category><![CDATA[Flash Builder]]></category>

		<category><![CDATA[Flex Builder]]></category>

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

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

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

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

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

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

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

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

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

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

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

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

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

		<guid isPermaLink="false">http://www.meta-for.net/?p=104</guid>
		<description><![CDATA[Etant comme pas mal de vous sans-doute entrain de tester Flash Builder, je me suis rendu compte d&#8217;un problème( bug? ) assez embêtant&#8230;
En fait, c&#8217;est l&#8217;affichage de texture des objets Collada qui pose problème. En compilant avec le sdk 3.4 le code suivant fonctionne parfaitement:

// on assigne le model à l'objet Collada. Le 2e paramètre [...]]]></description>
			<content:encoded><![CDATA[<p>Etant comme pas mal de vous sans-doute entrain de tester Flash Builder, je me suis rendu compte d&#8217;un problème( bug? ) assez embêtant&#8230;</p>
<p>En fait, c&#8217;est l&#8217;affichage de texture des objets Collada qui pose problème. En compilant avec le sdk 3.4 le code suivant fonctionne parfaitement:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// on assigne le model à l'objet Collada. Le 2e paramètre est à null</span>
<span style="color: #808080; font-style: italic;">//car le chemin de la texture est indiqué dans le fichier DAE</span>
<span style="color: #000000; font-weight: bold;">var</span> poolBall:Collada = <span style="color: #000000; font-weight: bold;">new</span> Collada<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;DAE/poolBall.dae&quot;</span> , <span style="color: #000000; font-weight: bold;">null</span> , <span style="color: #cc66cc;">0.6</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">// on l'ajoute à la liste d'affichage</span>
&nbsp;
scene.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span> poolBall <span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Voici le résultat, tout est ok :</p>
<div id="attachment_109" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.meta-for.net/wp-content/uploads/2009/06/collada_sdk3_4.png" class="imgPost"><img class="size-medium wp-image-109" title="collada_sdk3_4" src="http://www.meta-for.net/wp-content/uploads/2009/06/collada_sdk3_4-300x198.png" alt="Collada Object with Flex SDK 3.4" width="300" height="198" /></a><p class="wp-caption-text">Collada Object with Flex SDK 3.4</p></div>
<p>Mais en utilisant le SDK 4 avec exactement le même code, la texture devient d&#8217;un seul coup introuvable:</p>
<div id="attachment_111" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.meta-for.net/wp-content/uploads/2009/06/collada_sdk4.png" class="imgPost"><img class="size-medium wp-image-111" title="collada_sdk4" src="http://www.meta-for.net/wp-content/uploads/2009/06/collada_sdk4-300x186.png" alt="Le même objet avec le sdk 4" width="300" height="186" /></a><p class="wp-caption-text">Le même objet avec le sdk 4</p></div>
<p>Et voici l&#8217;output de la console :</p>
<div id="attachment_112" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.meta-for.net/wp-content/uploads/2009/06/console_collada_sdk4.png" class="imgPost"><img class="size-medium wp-image-112" title="console_collada_sdk4" src="http://www.meta-for.net/wp-content/uploads/2009/06/console_collada_sdk4-300x33.png" alt="Console" width="300" height="33" /></a><p class="wp-caption-text">Console</p></div>
<p>J&#8217;ai essayé de modifier le chemin du bitmap dans le .dae de multiples manières mais rien n&#8217;y fait apparement. Voilà, je sais pas si certains d&#8217;entre vous ont été confrontés à ce même problème, personnellement je n&#8217;ai pas encore trouvé de solution. J&#8217;éditerai le post dès que ça sera fait, n&#8217;hésitez pas à laisser la solution en comment si vous l&#8217;avez&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.meta-for.net/104/bug-flex-sdk-4-gumbo-et-collada-object/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
