<?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>Le Blog du Crabe</title>
	<atom:link href="http://www.lecrabe.net/wordpress/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.lecrabe.net/wordpress</link>
	<description></description>
	<lastBuildDate>Wed, 05 Jan 2011 15:23:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Capturing Flash movie area to FLV file</title>
		<link>http://www.lecrabe.net/wordpress/?p=196</link>
		<comments>http://www.lecrabe.net/wordpress/?p=196#comments</comments>
		<pubDate>Wed, 05 Jan 2011 15:23:10 +0000</pubDate>
		<dc:creator>arthy</dc:creator>
				<category><![CDATA[Labo]]></category>

		<guid isPermaLink="false">http://www.lecrabe.net/wordpress/?p=196</guid>
		<description><![CDATA[Here is something i was thinking for along time : capturing a flash movie area and save it to video file. Hopefully I found a great AIR example to do this on : http://www.zeropointnine.com/blog/simpleflvwriteras-as3-class-to-create-flvs/ This application saved bitmapdatas to FLV video file. I turned it into non-AIR application, and i took the opportunity to add [...]]]></description>
			<content:encoded><![CDATA[<p>Here is something i was thinking for along time : capturing a flash movie area and save it to video file.</p>
<p>Hopefully I found a great AIR example to do this on : <a href="http://www.zeropointnine.com/blog/simpleflvwriteras-as3-class-to-create-flvs/">http://www.zeropointnine.com/blog/simpleflvwriteras-as3-class-to-create-flvs/</a><br />
This application saved bitmapdatas to FLV video file.</p>
<p>I turned it into non-AIR application, and i took the opportunity to add several improvements:</p>
<ul>
<li> easier constructor creation (simply specify displayobject to capture and video fps)</li>
<li>memory optimization</li>
<li>faster video computation</li>
<li>internal capture management</li>
<li> capture area parameter</li>
</ul>
<p>In the example captured area is inside a movieClip, and captured FLV is saved to local disk.</p>
<p><object width="400" height="300"><param name="movie" value="http://www.lecrabe.net/wordpress/swf/testRecorder.swf"></param><param name="allowFullScreen" value="false"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.lecrabe.net/wordpress/swf/testRecorder.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="false" width="400" height="300"></embed></object></p>
<p>Usage :</p>
<pre class="brush: as3; title: ;">
// capture screen_mc clip , with 20fps framerate
// note that clip bounding box will be used as capturing area
var _myRecord : FLVRecord = new FLVRecord(screen_mc, 20);

// start recording (or resume capture)
_myRecord.start();

// stop recording (or pause capture)
_myRecord.stop();

// you can use clean() to start a new record with start();
_myRecord.clean();

// and finally get the FLV raw data of FLV to save it or send it to PHP script
var _file : FileReference  = new FileReference();
_file.save(_myRecord.flvRawData, &quot;video.flv&quot;);
</pre>
<p>And here is <a href="http://www.lecrabe.net/wordpress/files/flvREcorder.zip">source download link</a>.</p>
<p><strong>BE CAREFUL WITH MEMORY !!!!!</strong></p>
<p>FLV files are quite huge, so use it wisely !!!<br />
To reduce FLV file size, lower FPS parameter and restrict capture area :</p>
<pre class="brush: as3; title: ;">
// capture screen_mc clip , with 15fps framerate, and restricted capturing area
var area : Rectangle = new Rectangle(92,9, 160,224);
var _myRecord : FLVRecord = new FLVRecord(screen_mc, 10, area);

// survey FLV size if it's going to big
var flvSize : Number = int(_myRecord.flvLength/100000)/10; // size in megabytes
if (flvSize&gt;35) trace(&quot;FLV size is larger than 35Mo);
</pre>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lecrabe.net/wordpress/?feed=rss2&#038;p=196</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Text2Speech Class</title>
		<link>http://www.lecrabe.net/wordpress/?p=182</link>
		<comments>http://www.lecrabe.net/wordpress/?p=182#comments</comments>
		<pubDate>Tue, 30 Nov 2010 16:02:23 +0000</pubDate>
		<dc:creator>arthy</dc:creator>
				<category><![CDATA[Labo]]></category>

		<guid isPermaLink="false">http://www.lecrabe.net/wordpress/?p=182</guid>
		<description><![CDATA[Here is a little experiment with the Google TTS (Text To speech) API. As far as i looked, there no limitation for using this API, so enjoy : NB : as a bonus, here is a funny use of TTS in german language Here is a short code to use my TextToSpeech class : var [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a little experiment with the Google TTS (Text To speech) API.</p>
<p>As far as i looked, there no limitation for using this API, so enjoy :</p>
<p>NB : as a bonus, here is a funny use of TTS in german language <img src='http://www.lecrabe.net/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><object width="400" height="320"><param name="movie" value="http://www.lecrabe.net/wordpress/swf/text2Speech.swf"></param><param name="allowFullScreen" value="false"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.lecrabe.net/wordpress/swf/text2Speech.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="false" width="400" height="320"></embed></object></p>
<p>Here is a short code to use my TextToSpeech class :</p>
<pre class="brush: as3; title: ;">
var _txt2Speech : TextToSpeech = new TextToSpeech();

// and simply call a new text to be said
// passing text + language to be used
_txt2Speech.say(&quot;bla bla bla&quot;, &quot;en&quot;);
</pre>
<p>And here is <a href="http://www.lecrabe.net/wordpress/files/text2Speech.zip">source download link</a>.</p>
<p>Have fun !</p>
<p>NB : for unknown reasons, the example is not working under Chrome browser...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lecrabe.net/wordpress/?feed=rss2&#038;p=182</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>FLASH AS3 Kinect Experiment phase 1</title>
		<link>http://www.lecrabe.net/wordpress/?p=178</link>
		<comments>http://www.lecrabe.net/wordpress/?p=178#comments</comments>
		<pubDate>Fri, 26 Nov 2010 16:43:12 +0000</pubDate>
		<dc:creator>arthy</dc:creator>
				<category><![CDATA[Labo]]></category>

		<guid isPermaLink="false">http://www.lecrabe.net/wordpress/?p=178</guid>
		<description><![CDATA[Here is a little experiment around the exciting Open Kinect project : http://openkinect.org/wiki/Main_Page My idea was to use the as3-server that comes with the git archive. Here are the several steps I've been through to get to this raw result : - compilation of the as3-server on OSX (yesterday version was finally working) - turned [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a little experiment around the exciting Open Kinect project :<br />
<a href="http://openkinect.org/wiki/Main_Page">http://openkinect.org/wiki/Main_Page</a></p>
<p>My idea was to use the as3-server that comes with the git archive.</p>
<p>Here are the several steps I've been through to get to this raw result :<br />
- compilation of the as3-server on OSX (yesterday version was finally working)<br />
- turned AS3 singletons examples to exploitable classes (to instantiate sockets individually and the get 3 streams at the same time)<br />
- found that Flash has to get the policy file from server before init the next sockets (i created a queue for sockets)</p>
<p>And here is the result : </p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/9RaOvnGWRx0?hl=fr&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/9RaOvnGWRx0?hl=fr&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>Upper image results from the RGB stream.<br />
Bottom image is the Depth stream.<br />
Extra data are shown in the white box.</p>
<p>I hope to have time soon and go deeper in all these data streams and create something fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lecrabe.net/wordpress/?feed=rss2&#038;p=178</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>New site !</title>
		<link>http://www.lecrabe.net/wordpress/?p=175</link>
		<comments>http://www.lecrabe.net/wordpress/?p=175#comments</comments>
		<pubDate>Tue, 12 Oct 2010 06:28:28 +0000</pubDate>
		<dc:creator>arthy</dc:creator>
				<category><![CDATA[Non classé]]></category>

		<guid isPermaLink="false">http://www.lecrabe.net/wordpress/?p=175</guid>
		<description><![CDATA[Feel free to visit my fresh new personal site !!! http://www.lecrabe.net Credits: GFX : Kassad / www.frak.fr Code: well, hum me...]]></description>
			<content:encoded><![CDATA[<p>Feel free to visit my fresh new personal site !!!</p>
<p><a href="http://www.lecrabe.net">http://www.lecrabe.net</a></p>
<p>Credits:<br />
GFX : Kassad / <a href="http://www.frak.fr">www.frak.fr</a><br />
Code: well, hum me...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lecrabe.net/wordpress/?feed=rss2&#038;p=175</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AS3 while loops performance</title>
		<link>http://www.lecrabe.net/wordpress/?p=149</link>
		<comments>http://www.lecrabe.net/wordpress/?p=149#comments</comments>
		<pubDate>Tue, 19 Jan 2010 16:37:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Non classé]]></category>

		<guid isPermaLink="false">http://www.lecrabe.net/wordpress/?p=149</guid>
		<description><![CDATA[Recently i made a quick visual effect including the latest Flash Player 10 classes : Vector &#38; Vector3D classes. As the Vector and Vector3D classes are well optimized, I wanted to optimized my own loops. So came again the question : "What is the most optimized loop system for these classes ?" So i wrote [...]]]></description>
			<content:encoded><![CDATA[<p>Recently i made a quick visual effect including the latest Flash Player 10 classes : Vector &amp; Vector3D classes.</p>
<p>As the Vector and Vector3D classes are well optimized, I wanted to optimized my own loops.</p>
<p>So came again the question : "What is the most optimized loop system for these classes ?"</p>
<p>So i wrote a quick "while loops" performance test where i use a huge Vector array of Vector3D instances where i tried several systems.</p>
<p>I firstly thought that there was no way using the "for loops", but i read this quite interesting article :</p>
<p><a href="http://www.experts-exchange.com/articles/Software/Photos_Graphics/Web_Graphics/Macromedia_Flash/ActionScript/20-Tips-to-Optimize-your-ActionScript.html" target="_blank">http://www.experts-exchange.com/articles/Software/Photos_Graphics/Web_Graphics/Macromedia_Flash/ActionScript/20-Tips-to-Optimize-your-ActionScript.html</a></p>
<p>and i finally put the for loop test as the last test.</p>
<p>Each test performs a vector crossproduct on each Vector3D, and this for 2 millions vectors !!!</p>
<p><a href="http://www.lecrabe.net/benchmark/while" target="_self">clear here to start the while-loop test</a></p>
<p>I was used to coding my loops with the first loop test :</p>
<pre class="brush: as3; title: ;">
i = vect.length;
while(i--){}
</pre>
<p>but apparently the most optimized loop on my mac (imac 27") should be the 3rd test :</p>
<pre class="brush: as3; title: ;">
i=vect.length;
while (--i&gt;=0) {}
</pre>
<p>For my computer (Mac/Firefox) each test of the benchmark is almost the same, even the "for loop" which is quite efficient.</p>
<p>But I look closely, the fact is was using the less optimized while loop (according to this test)...</p>
<p>It's up to you to test your own computer and may choose one of these loop.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lecrabe.net/wordpress/?feed=rss2&#038;p=149</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add Flex 3.5 SDK path to Snow Leopard</title>
		<link>http://www.lecrabe.net/wordpress/?p=144</link>
		<comments>http://www.lecrabe.net/wordpress/?p=144#comments</comments>
		<pubDate>Wed, 13 Jan 2010 10:46:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Non classé]]></category>

		<guid isPermaLink="false">http://www.lecrabe.net/wordpress/?p=144</guid>
		<description><![CDATA[As i was installing Alchemy toolkit for some experiment, i was first stuck in installing the Flex 3.5 SDK : to get the flex sdk linked to your system you are supposed to add the "flex/bin" directory in your system path. Looking on the web, the ".profile" file has to be changed, but i couldn't [...]]]></description>
			<content:encoded><![CDATA[<p>As i was installing Alchemy toolkit for some experiment, i was first stuck in installing the Flex 3.5 SDK : to get the flex sdk linked to your system you are supposed to add the "flex/bin" directory in your system path.</p>
<p>Looking on the web, the ".profile" file has to be changed, but i couldn't find it... the reason : I had no ".profile" file on my system....</p>
<p>So if you don't have any ".profile" file in your home directory (your nickname directory), here are the steps to follow :</p>
<p>1) First of all, you may want to show hidden files on your mac to see exactly what you do,  to do so type the following lines in your terminal:</p>
<p><code>defaults write com.apple.finder AppleShowAllFiles TRUE<br />
killall Finder</code></p>
<ul>
<li>change TRUE/FALSE to activate/deactivate the option</li>
<li>killall Finder will close all finders as it has to be restarted</li>
</ul>
<p>2) Then create a new file in TextEdit for example and add this :</p>
<p>export PATH=$PATH:/usr/local/bin:/Applications/flex_sdk_3.5/bin</p>
<p>(in my example I unzipped the flex sdk in my Applications generic folder)</p>
<p>This will add the flex bin folder path in your system path.</p>
<p>3) Now save the file as ".profile" in your your home directory</p>
<p>4) Now you have to load/reload your ".profile" to make it active, type this in the terminal :</p>
<p>open a new Terminal so that it opens in your home directory and type:</p>
<p>. ./.profile</p>
<p>this will reload the file</p>
<p>5) test if your path has been integrated in the $Path variable, type</p>
<p>echo $PATH</p>
<p>6) Final step, check if Flex SDK is now available :</p>
<p>just type "adt" in your terminal and you should not have any error</p>
<p>That's it, if you want to check if your path</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lecrabe.net/wordpress/?feed=rss2&#038;p=144</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3 + PHP Crypto classes &#8211; secured exchanges between Flash and PHP</title>
		<link>http://www.lecrabe.net/wordpress/?p=61</link>
		<comments>http://www.lecrabe.net/wordpress/?p=61#comments</comments>
		<pubDate>Wed, 16 Dec 2009 12:55:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Non classé]]></category>

		<guid isPermaLink="false">http://www.lecrabe.net/wordpress/?p=61</guid>
		<description><![CDATA[The facts : As you may know, some tools like firebug helps you tracing incoming and outcoming data between flash and scripts, even if you use POST data. See below how firebug can trace all variables sent through the POST data : So i tried to figure out how to implement a crypted system to [...]]]></description>
			<content:encoded><![CDATA[<p>The facts :</p>
<p>As you may know, some tools like firebug helps you tracing incoming and outcoming data between flash and scripts, even if you use POST data.</p>
<p>See below how firebug can trace all variables sent through the POST data :</p>
<div id="attachment_62" class="wp-caption alignnone" style="width: 473px"><img class="size-full wp-image-62" title="firebug" src="http://www.lecrabe.net/wordpress/wp-content/uploads/2009/12/firebug.jpg" alt="firebug tracing" width="463" height="256" /><p class="wp-caption-text">firebug tracing</p></div>
<p>So i tried to figure out how to implement a crypted system to secure (a little bit more) these data, with an encryption key if possible.</p>
<p>I found the useful project on the web : <a href="http://code.google.com/p/as3crypto/" target="_blank">as3crypto project</a></p>
<p>Thanks to this class, you can crypt/decrypt in flash but as far as i looked the sources, there was no information about crypt/decrypt on php side.</p>
<p>But i found another message in a forum where a php code was given, so i mixed both to provide you a simple way to set both sides.</p>
<p>In my example, flash send some data to php using crypted message and PHP answer another crypted message (+ the original decrypted flash message for verification):</p>
<p><img class="alignnone size-full wp-image-137" title="pnm_preview" src="http://www.lecrabe.net/wordpress/wp-content/uploads/2009/12/pnm_preview.jpg" alt="pnm_preview" width="560" height="521" /></p>
<pre><code>
</code></pre>
<ul>
<li>
<h3>Using the php class : cryptlib.php</h3>
</li>
</ul>
<ol>
<li>create an instance of the class, and call the init with the crypted key as parameter</li>
<li>decrypt the sent message (using POST object)</li>
</ol>
<pre class="brush: php; title: ;">
include_once &quot;lib/cryptlib.php&quot;;

// init a new instance of Crypto Class
$crypto = new Crypt;

// init with the encryption key
$result = $crypto-&gt;init(&quot;PASSWORD&quot;);

// get the POST data
$messagefromflash = $_POST [&quot;message&quot;];

// decrypt data
$decrypted_messagefromflash = $crypto-&gt;decrypt(utf8_decode($messagefromflash));
</pre>
<p>but you can also send back crypted data to flash using the "encrypt" method</p>
<pre class="brush: php; title: ;">
// return a crypted result to flash
$resultmsg = &quot;Ok, i received your data, everything is fine !&quot;;
echo &quot;result=&quot;.$crypto-&gt;encrypt(utf8_encode($resultmsg));
</pre>
<ul>
<li>
<h3>Using the as3 class : CryptoCode.as</h3>
</li>
</ul>
<ol>
<li>in your main class, create an instance of the CryptoCode class that will crypt/decrypt your data.</li>
<li>call the init method with the same key as PHP (just like PHP code)</li>
<li>then call "encrypt(s:String)" or ""decrypt(s:String)" methods through your crypto instance</li>
</ol>
<pre class="brush: as3; title: ;">
// instance of crypto class
 private var _crypto : CryptoCode;
 public var myLoader : URLLoader;

// create instance with encryption key
 _crypto = new CryptoCode(&quot;PASSWORD&quot;);

// send crypted string to php script
 var variables : URLVariables = new URLVariables();
 variables.message = _crypto.encrypt(tosend_in.text);

// create request with POST method
 var request : URLRequest = new URLRequest(&quot;http://www.lecrabe.net/wordpress/demo/crypt/scripts/testcrypto.php&quot;);
 request.method = URLRequestMethod.POST;
 request.data = variables;

 // send request
 myLoader.load(request);
</pre>
<p>If you want to get the whole example, please <a href="http://www.lecrabe.net/wordpress/demo/crypt/testCrypt.zip" target="_self">download the sources</a>.</p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lecrabe.net/wordpress/?feed=rss2&#038;p=61</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Mac Files Cleaner : removes mac files on windows system</title>
		<link>http://www.lecrabe.net/wordpress/?p=1</link>
		<comments>http://www.lecrabe.net/wordpress/?p=1#comments</comments>
		<pubDate>Tue, 29 Sep 2009 13:06:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Non classé]]></category>

		<guid isPermaLink="false">http://www.lecrabe.net/wordpress/?p=1</guid>
		<description><![CDATA[It's been a long time since i post a new article, and it's a brand new start !!! The blog turned into wordpress blog, and here is a handy tool I wrote for my personal use in the first place : Mac File Cleaner is a tool for people who work on both Mac and [...]]]></description>
			<content:encoded><![CDATA[<p>It's been a long time since i post a new article, and it's a brand new start !!!</p>
<p>The blog turned into wordpress blog, and here is a handy tool I wrote for my personal use in the first place :</p>
<p>Mac File Cleaner is a tool for people who work on both Mac and Windows platforms.</p>
<p>Every time a mac user send files to a windows user, many hidden files appears in the windows system : "._*" files and ".DS_Store" files.</p>
<p>These annoying files may be a problem as in my personal project, so MFC will solve this problem in 2 steps :</p>
<p>1) place the MFC executable file in the root folder where you want to remove those mac files</p>
<p>2) run MFC, and it will recursively remove every mac files</p>
<p>STEP 1 :</p>
<p><img class="alignnone size-full wp-image-44" title="MFC executable " src="http://www.lecrabe.net/wordpress/wp-content/uploads/2009/09/snap1.jpg" alt="MFC executable " width="384" height="288" /></p>
<p>The mac files cleaner is placed at the root of the project.</p>
<p>STEP 2:</p>
<p><img class="alignnone size-full wp-image-46" title="snap2" src="http://www.lecrabe.net/wordpress/wp-content/uploads/2009/09/snap2.jpg" alt="snap2" width="506" height="425" /></p>
<p>MFC indicates where the recursive operation will start from, then click CLEAN button</p>
<p>STEP3 :</p>
<p><img class="alignnone size-full wp-image-47" title="snap3" src="http://www.lecrabe.net/wordpress/wp-content/uploads/2009/09/snap3.jpg" alt="snap3" width="505" height="424" /></p>
<p>MFC deletes all mac files recursively and shows you the scanned folders and deleted files.</p>
<p>If wrong files are deleted, they may be found in the system trashcan.</p>
<p><a href="http://www.lecrabe.net/wordpress/files/MacFilesCleaner.zip" target="_self">Download Mac Files Cleaner</a></p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lecrabe.net/wordpress/?feed=rss2&#038;p=1</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Eclipse undelete option</title>
		<link>http://www.lecrabe.net/wordpress/?p=43</link>
		<comments>http://www.lecrabe.net/wordpress/?p=43#comments</comments>
		<pubDate>Wed, 06 Aug 2008 00:00:35 +0000</pubDate>
		<dc:creator>arthy</dc:creator>
				<category><![CDATA[Non classé]]></category>

		<guid isPermaLink="false">http://www.lecrabe.net/wordpress/?p=43</guid>
		<description><![CDATA[<p>Thanks god eclipse has its own undelete option !!!</p>]]></description>
			<content:encoded><![CDATA[<p>Thanks god eclipse has its own undelete option !!!</p>
<p><span id="more-43"></span></p>
<p>I had a strange bug in eclipse&nbsp;: when creating sources folder or a new class while another folder is selected, the new folder is created on root of classpath...</p>
<p>Anyway, i deleted the wrong folder class that was created and all the tree containing this folder was erased !!!! ..... <img src='http://www.lecrabe.net/wordpress/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>A quick look in the trashcan, nothing.... Eclipse does not put deleted files in the system trashcan, my blood goes off my body.... one day of coding lost because of this small bug....</p>
<p>So i started to test several undelete softwares. 3 hours later of scanning, my old photos or zip files came up, but no as files...</p>
<p>While i was starting crying my dear as code, i tried a last google search "Eclipse undelete", and here is the awaiting miracle !!! There is an option available in Eclipse !! select a folder and right mouse menu select&nbsp;: "<strong>Restore from Local History</strong>"</p>
<p>Then appear the deleted files history and you can choose which file to restore.</p>
<p>My coding day is restored too <img src='http://www.lecrabe.net/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.lecrabe.net/wordpress/?feed=rss2&#038;p=43</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>AS3 gotoAndStop &amp; gotoAndPlay issue</title>
		<link>http://www.lecrabe.net/wordpress/?p=42</link>
		<comments>http://www.lecrabe.net/wordpress/?p=42#comments</comments>
		<pubDate>Tue, 05 Aug 2008 17:16:35 +0000</pubDate>
		<dc:creator>arthy</dc:creator>
				<category><![CDATA[Non classé]]></category>

		<guid isPermaLink="false">http://www.lecrabe.net/wordpress/?p=42</guid>
		<description><![CDATA[<p>Here is a little trick that may help you to target items on scene right after a gotoAndStop/gotoAndPlay</p>]]></description>
			<content:encoded><![CDATA[<p>Here is a little trick that may help you to target items on scene right after a gotoAndStop/gotoAndPlay</p>
<p><span id="more-42"></span></p>
<p>Here is an annoying thing i faced today&nbsp;:</p>
<p>I used to program clips or buttons with several labels, and populate items at each label content when needed.</p>
<p>But in AS3, there is no way to do such things&nbsp;:</p>
<p><code>button_mc.gotoAndPlay("over");</code></p>
<p><code>button_mc.tf_over.text = "rollover text";</code></p>
<p>does not work at all.</p>
<p>I found a trick that used the Event.RENDER event which occurs after an enterframe&nbsp;: <a href="http://www.kirupa.com/forum/showthread.php?p=1914687" hreflang="fr">http://www.kirupa.com/forum/showthread.php?p=1914687</a></p>
<p>But i did not wanted to use an enterframe, and i found a second trick on Senocular site which uses the <code>stage.invalidate()</code></p>
<p>The invalidate method forces the current displayObject to render itself immediately.</p>
<p>So to sum up the trick, we have to&nbsp;:</p>
<ul>
<li>go the new frame using gotoAndStop/gotoAndPlay</li>
<li>add a listener on stage with Event.RENDER event</li>
<li>create a function that will populate the new frame</li>
</ul>
<p>So here is an example where a button needs to go to the "over" frame and fill a text which exists on this frame&nbsp;:</p>
<p> <i> <br />// set a clip as a button <br />button_mc.buttonMode = true; </p>
<p>// add a mouse rollover listener <br /> button_mc.addEventListener(MouseEvent.MOUSE_OVER, <b>onOver</b>); </p>
<p>// let's go for the trick <br />function <b>onOver</b>(evt:MouseEvent):void{ <br />&nbsp;&nbsp;        // go to the new frame <br />&nbsp;&nbsp;	    button_mc.gotoAndStop("on"); </p>
<p>&nbsp;&nbsp;        // add a new listener on the stage to get the next render event <br />&nbsp;&nbsp;	    <b>stage.addEventListener( Event.RENDER, <b>onButtonRollOver</b>, false, 0, true );</b> </p>
<p> &nbsp;&nbsp;      // force the current displayObject to trigger the Render event <br />&nbsp;&nbsp;      <b> stage.invalidate();</b> <br />} </p>
<p>// populate the rollOver frame <br />function <b>onButtonRollOver</b>(evt:Event):void{ <br />&nbsp;&nbsp;	trace("render rollover"); <br />&nbsp;&nbsp;	button_mc.tf_on.text = "RollOver text"; <br />&nbsp;&nbsp;	// important : remove the listener <br />&nbsp;&nbsp;	stage.removeEventListener( Event.RENDER, onButtonRollOver); <br />} <br /> </i></b>
<p>I was quite happy to find this trick, but unfortunately there seems to be a deeper problem with the RENDER event&nbsp;: I managed my button with 2 listeners like above (one for rollOver, and another for rollOut).</p>
<p>All seems to be ok, but when I drag the mouse over and out the button quickly, the RENDER is triggered while the targeted textfield is not yet available.</p>
<p>SO, use this trick in your production if you don't intend to move the playhead of the displayObject too quickly. Or else, just wait for another trick....</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lecrabe.net/wordpress/?feed=rss2&#038;p=42</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
