<?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>First Intelligence laboratory</title>
	<atom:link href="http://labs.first.lv/feed/" rel="self" type="application/rss+xml" />
	<link>http://labs.first.lv</link>
	<description>PHP, Flash, Flex, Air RIA development</description>
	<lastBuildDate>Tue, 19 Apr 2011 21:30:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Sticky Button class for Flash Actionscript 3</title>
		<link>http://labs.first.lv/2009/11/27/sticky-buttons-class-for-flash-actionscript-30/</link>
		<comments>http://labs.first.lv/2009/11/27/sticky-buttons-class-for-flash-actionscript-30/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 13:12:15 +0000</pubDate>
		<dc:creator>darklow</dc:creator>
				<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://labs.first.lv/?p=54</guid>
		<description><![CDATA[Enjoy this old, but still nice mjau-mjau.com sticky buttons script for AS3. Couldn't find it anywhere for AS2 or AS3 so i rewrote it for AS3; Feel free to use anywhere...
AC_FL_RunContent = 0;
	if (AC_FL_RunContent == 0) {		alert("This page requires AC_RunActiveContent.js.");	} else {		
	AC_FL_RunContent(			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',			'width', '400',			'height', '200',			'src', 'http://labs.first.lv/wp-content/uploads/2009/11/StickyButton',			'quality', 'high',			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',			'align', 'middle',			'play', 'true',			'loop', 'true',			'scale', 'showall',			'wmode', 'window',			'devicefont', 'false',			'id', 'StickyButton',			'bgcolor', [...]]]></description>
			<content:encoded><![CDATA[<p>Enjoy this old, but still nice mjau-mjau.com sticky buttons script for AS3. Couldn't find it anywhere for AS2 or AS3 so i rewrote it for AS3; Feel free to use anywhere...<br />
<script language="javascript">AC_FL_RunContent = 0;</script><script src="http://labs.first.lv/wp-content/uploads/2009/11/ac_runactivecontent.js" language="javascript"></script><br />
<script language="javascript">	if (AC_FL_RunContent == 0) {		alert("This page requires AC_RunActiveContent.js.");	} else {		
	AC_FL_RunContent(			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',			'width', '400',			'height', '200',			'src', 'http://labs.first.lv/wp-content/uploads/2009/11/StickyButton',			'quality', 'high',			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',			'align', 'middle',			'play', 'true',			'loop', 'true',			'scale', 'showall',			'wmode', 'window',			'devicefont', 'false',			'id', 'StickyButton',			'bgcolor', '#ffffff',			'name', 'StickyButton',			'menu', 'true',			'allowFullScreen', 'false',			'allowScriptAccess','sameDomain',			'movie', 'http://labs.first.lv/wp-content/uploads/2009/11/StickyButton',			'salign', ''			); }</script><br />
<noscript>	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="400" height="200" id="StickyButton" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="http://labs.first.lv/wp-content/uploads/2009/11/StickyButton.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="http://labs.first.lv/wp-content/uploads/2009/11/StickyButton.swf" quality="high" bgcolor="#ffffff" width="400" height="200" name="StickyButton" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />	</object></noscript></p>
<p><span id="more-54"></span></p>
<p><strong>StickyButton Class for AS 3.0</strong></p>
<p>There are very many ways you can use or adopt this class. Here is one of the simplest ways by specifying MovieClip base class in Library:<br />
<a href="/wp-content/uploads/2009/11/StickyButton.zip">Download example (Flash CS3 .FLA file)</a></p>
<pre class="actionscript3">&nbsp;
<span style="color: #006699; font-weight: bold;">package</span> <span style="color: #663366;">&#123;</span>
&nbsp;
	<span style="color: #006600; font-weight: bold;">import</span> <span style="color: #660099 !important; font-weight: bold;">flash.<span style="color: #006600;">display</span></span>.<span style="color: #0000cc; font-weight: bold;">MovieClip</span>;
	<span style="color: #006600; font-weight: bold;">import</span> <span style="color: #660099 !important; font-weight: bold;">flash.<span style="color: #006600;">events</span></span>.<span style="color: #0000cc; font-weight: bold;">Event</span>;
	<span style="color: #006600; font-weight: bold;">import</span> <span style="color: #660099 !important; font-weight: bold;">flash.<span style="color: #006600;">events</span></span>.<span style="color: #0000cc; font-weight: bold;">MouseEvent</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	 * @author - darklow, First Intelligence www.first.lv (rewriting from AS 1.0 to AS 3.0)
	 * @author - www.mjau-mjau.vom (original AS 1.0 code author)
	 */</span>
&nbsp;
	<span style="color: #66cccc; font-weight: bold;">public</span> <span style="color: #006699; font-weight: bold;">class</span> StickyButton <span style="color: #006699; font-weight: bold;">extends</span> <span style="color: #0000cc; font-weight: bold;">MovieClip</span>	<span style="color: #663366;">&#123;</span>
&nbsp;
		<span style="color: #66cccc; font-weight: bold;">private</span> <span style="color: #006699; font-weight: bold;">var</span> accel:<span style="color: #0000cc; font-weight: bold;">Number</span> = .<span style="color: #ff6600; font-weight: bold;">6</span>;
		<span style="color: #66cccc; font-weight: bold;">private</span> <span style="color: #006699; font-weight: bold;">var</span> convert:<span style="color: #0000cc; font-weight: bold;">Number</span> = .<span style="color: #ff6600; font-weight: bold;">7</span>;
		<span style="color: #66cccc; font-weight: bold;">private</span> <span style="color: #006699; font-weight: bold;">var</span> r:<span style="color: #0000cc; font-weight: bold;">Number</span> = <span style="color: #ff6600; font-weight: bold;">3</span>;
&nbsp;
		<span style="color: #66cccc; font-weight: bold;">private</span> <span style="color: #006699; font-weight: bold;">var</span> xstart:<span style="color: #0000cc; font-weight: bold;">Number</span>;
		<span style="color: #66cccc; font-weight: bold;">private</span> <span style="color: #006699; font-weight: bold;">var</span> ystart:<span style="color: #0000cc; font-weight: bold;">Number</span>;
&nbsp;
		<span style="color: #66cccc; font-weight: bold;">private</span> <span style="color: #006699; font-weight: bold;">var</span> targetx:<span style="color: #0000cc; font-weight: bold;">Number</span>;
		<span style="color: #66cccc; font-weight: bold;">private</span> <span style="color: #006699; font-weight: bold;">var</span> targety:<span style="color: #0000cc; font-weight: bold;">Number</span>;
		<span style="color: #66cccc; font-weight: bold;">private</span> <span style="color: #006699; font-weight: bold;">var</span> t:<span style="color: #0000cc; font-weight: bold;">Number</span>;
&nbsp;
		<span style="color: #66cccc; font-weight: bold;">private</span> <span style="color: #006699; font-weight: bold;">var</span> xpos:<span style="color: #0000cc; font-weight: bold;">Number</span> = <span style="color: #ff6600; font-weight: bold;">0</span>;
		<span style="color: #66cccc; font-weight: bold;">private</span> <span style="color: #006699; font-weight: bold;">var</span> ypos:<span style="color: #0000cc; font-weight: bold;">Number</span> = <span style="color: #ff6600; font-weight: bold;">0</span>;
		<span style="color: #66cccc; font-weight: bold;">private</span> <span style="color: #006699; font-weight: bold;">var</span> drag:<span style="color: #0000cc; font-weight: bold;">Number</span> = <span style="color: #ff6600; font-weight: bold;">0</span>;
		<span style="color: #66cccc; font-weight: bold;">private</span> <span style="color: #006699; font-weight: bold;">var</span> drag_this:<span style="color: #0000cc; font-weight: bold;">Boolean</span> = <span style="color: #669933; font-weight: bold;">false</span>;
		<span style="color: #66cccc; font-weight: bold;">private</span> <span style="color: #006699; font-weight: bold;">var</span> mouseOnStage:<span style="color: #0000cc; font-weight: bold;">Boolean</span> = <span style="color: #669933; font-weight: bold;">false</span>;
&nbsp;
		<span style="color: #66cccc; font-weight: bold;">public</span> <span style="color: #006699; font-weight: bold;">function</span> StickyButton<span style="color: #663366;">&#40;</span><span style="color: #663366;">&#41;</span> <span style="color: #663366;">&#123;</span>
			<span style="color: #669933; font-weight: bold;">if</span> <span style="color: #663366;">&#40;</span><span style="color: #0000cc; font-weight: bold;">stage</span><span style="color: #663366;">&#41;</span> init<span style="color: #663366;">&#40;</span><span style="color: #663366;">&#41;</span>;
			<span style="color: #669933; font-weight: bold;">else</span> addEventListener<span style="color: #663366;">&#40;</span><span style="color: #0000cc; font-weight: bold;">Event</span>.<span style="color: #006600;">ADDED_TO_STAGE</span>, init<span style="color: #663366;">&#41;</span>;
		<span style="color: #663366;">&#125;</span>
		<span style="color: #66cccc; font-weight: bold;">private</span> <span style="color: #006699; font-weight: bold;">function</span> init<span style="color: #663366;">&#40;</span>e:<span style="color: #0000cc; font-weight: bold;">Event</span> = <span style="color: #669933; font-weight: bold;">null</span><span style="color: #663366;">&#41;</span>:<span style="color: #669933; font-weight: bold;">void</span> <span style="color: #663366;">&#123;</span>
			removeEventListener<span style="color: #663366;">&#40;</span><span style="color: #0000cc; font-weight: bold;">Event</span>.<span style="color: #006600;">ADDED_TO_STAGE</span>, init<span style="color: #663366;">&#41;</span>;
			<span style="color: #006699; font-weight: bold;">var</span> iterations:<span style="color: #0000cc; font-weight: bold;">Number</span> = <span style="color: #ff6600; font-weight: bold;">5</span>;
			xstart = x;
			ystart = y;
			targetx = xstart;
			targety = ystart;
			<span style="color: #006699; font-weight: bold;">var</span> xx:<span style="color: #0000cc; font-weight: bold;">Number</span> = <span style="color: #663366;">&#40;</span><span style="color: #ff6600; font-weight: bold;">2</span> * <span style="color: #0000cc; font-weight: bold;">Math</span>.<span style="color: #006600;">PI</span><span style="color: #663366;">&#41;</span> * <span style="color: #663366;">&#40;</span><span style="color: #ff6600; font-weight: bold;">1</span> / iterations<span style="color: #663366;">&#41;</span>;
			t = <span style="color: #0000cc; font-weight: bold;">Math</span>.<span style="color: #006600;">tan</span><span style="color: #663366;">&#40;</span>xx<span style="color: #663366;">&#41;</span>;
			addEventListener<span style="color: #663366;">&#40;</span><span style="color: #0000cc; font-weight: bold;">Event</span>.<span style="color: #006600;">ENTER_FRAME</span>, checkFrame<span style="color: #663366;">&#41;</span>;
			<span style="color: #0000cc; font-weight: bold;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #663366;">&#40;</span><span style="color: #0000cc; font-weight: bold;">MouseEvent</span>.<span style="color: #006600;">MOUSE_MOVE</span>, <span style="color: #006699; font-weight: bold;">function</span><span style="color: #663366;">&#40;</span><span style="color: #0000cc; font-weight: bold;">event</span>:<span style="color: #0000cc; font-weight: bold;">MouseEvent</span><span style="color: #663366;">&#41;</span>:<span style="color: #669933; font-weight: bold;">void</span> <span style="color: #663366;">&#123;</span>
				mouseOnStage = <span style="color: #669933; font-weight: bold;">true</span>;
			<span style="color: #663366;">&#125;</span><span style="color: #663366;">&#41;</span>;
			<span style="color: #0000cc; font-weight: bold;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #663366;">&#40;</span><span style="color: #0000cc; font-weight: bold;">Event</span>.<span style="color: #006600;">MOUSE_LEAVE</span>, <span style="color: #006699; font-weight: bold;">function</span><span style="color: #663366;">&#40;</span><span style="color: #0000cc; font-weight: bold;">event</span>:<span style="color: #0000cc; font-weight: bold;">Event</span><span style="color: #663366;">&#41;</span>:<span style="color: #669933; font-weight: bold;">void</span> <span style="color: #663366;">&#123;</span>
				mouseOnStage = <span style="color: #669933; font-weight: bold;">false</span>;
			<span style="color: #663366;">&#125;</span><span style="color: #663366;">&#41;</span>;
		<span style="color: #663366;">&#125;</span>
		<span style="color: #66cccc; font-weight: bold;">private</span> <span style="color: #006699; font-weight: bold;">function</span> checkFrame<span style="color: #663366;">&#40;</span>e:<span style="color: #0000cc; font-weight: bold;">Event</span><span style="color: #663366;">&#41;</span>:<span style="color: #669933; font-weight: bold;">void</span> <span style="color: #663366;">&#123;</span>
			<span style="color: #669933; font-weight: bold;">if</span> <span style="color: #663366;">&#40;</span><span style="color: #669933; font-weight: bold;">this</span>.<span style="color: #006600;">hitTestPoint</span><span style="color: #663366;">&#40;</span>root.<span style="color: #006600;">mouseX</span>, root.<span style="color: #006600;">mouseY</span>, <span style="color: #669933; font-weight: bold;">true</span><span style="color: #663366;">&#41;</span> &amp;&amp; mouseOnStage<span style="color: #663366;">&#41;</span> <span style="color: #663366;">&#123;</span>
				<span style="color: #006699; font-weight: bold;">var</span> deltax:<span style="color: #0000cc; font-weight: bold;">Number</span> = parent.<span style="color: #006600;">mouseX</span> - xstart;
				<span style="color: #006699; font-weight: bold;">var</span> deltay:<span style="color: #0000cc; font-weight: bold;">Number</span> = parent.<span style="color: #006600;">mouseY</span> - ystart;
				targetx = <span style="color: #663366;">&#40;</span>parent.<span style="color: #006600;">mouseX</span> - deltax / r<span style="color: #663366;">&#41;</span>;
				targety = <span style="color: #663366;">&#40;</span>parent.<span style="color: #006600;">mouseY</span> - deltay / r<span style="color: #663366;">&#41;</span>;
				<span style="color: #669933; font-weight: bold;">if</span> <span style="color: #663366;">&#40;</span>!drag_this<span style="color: #663366;">&#41;</span> <span style="color: #663366;">&#123;</span>
					drag_this = <span style="color: #669933; font-weight: bold;">true</span>;
					drag++;
				<span style="color: #663366;">&#125;</span>
			<span style="color: #663366;">&#125;</span> <span style="color: #669933; font-weight: bold;">else</span> <span style="color: #663366;">&#123;</span>
				targetx = xstart;
				targety = ystart;
				<span style="color: #669933; font-weight: bold;">if</span> <span style="color: #663366;">&#40;</span>drag_this<span style="color: #663366;">&#41;</span> <span style="color: #663366;">&#123;</span>
					drag_this = <span style="color: #669933; font-weight: bold;">false</span>;
					drag--;
				<span style="color: #663366;">&#125;</span>
			<span style="color: #663366;">&#125;</span>
			xpos = xpos * accel + <span style="color: #663366;">&#40;</span>targetx - x<span style="color: #663366;">&#41;</span> * convert;
			x += xpos;
			ypos = ypos * accel + <span style="color: #663366;">&#40;</span>targety - y<span style="color: #663366;">&#41;</span> * convert;
			y += ypos;
		<span style="color: #663366;">&#125;</span>
	<span style="color: #663366;">&#125;</span>
<span style="color: #663366;">&#125;</span>
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://labs.first.lv/2009/11/27/sticky-buttons-class-for-flash-actionscript-30/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>YetAnotherCoverflowClone rotation and startIndex</title>
		<link>http://labs.first.lv/2008/10/21/yetanothercoverflowclone-rotation-startindex/</link>
		<comments>http://labs.first.lv/2008/10/21/yetanothercoverflowclone-rotation-startindex/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 09:00:38 +0000</pubDate>
		<dc:creator>Kaspars Jaudzems</dc:creator>
				<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[coverflow]]></category>
		<category><![CDATA[Liip]]></category>
		<category><![CDATA[start]]></category>
		<category><![CDATA[startPlane]]></category>
		<category><![CDATA[YetAnotherCoverflowClone]]></category>

		<guid isPermaLink="false">http://labs.first.lv/?p=4</guid>
		<description><![CDATA[UPDATE: THERE IS A MUCH FASTER COVERFLOW NOW AVAILABLE, WHICH HAS BOTH FEATURES ALREADY IN IT!
http://www.weberdesignlabs.com/blog/2009/12/flash-10-coverflow/
---------------------------------------------------------------------------------------------
Thanks to Liip for open sourcing their great coverflow clone, which did very well for
Baltkom TV  - Premiere and Cinema channels microsite


We added 2 more features:

rotation (after last cover first cover is the next)
startIndex (different start index support)

You can [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE: THERE IS A MUCH FASTER COVERFLOW NOW AVAILABLE, WHICH HAS BOTH FEATURES ALREADY IN IT!</strong></p>
<p><a href="http://www.weberdesignlabs.com/blog/2009/12/flash-10-coverflow/"><strong>http://www.weberdesignlabs.com/blog/2009/12/flash-10-coverflow/</strong></a></p>
<p>---------------------------------------------------------------------------------------------</p>
<p>Thanks to <a href="http://blog.liip.ch/">Liip </a>for open sourcing their great <a href="http://blog.liip.ch/archive/2008/08/14/local-ch-coverflow-goes-open-source.html">coverflow clone</a>, which did very well for<br />
<a href="http://labs.first.lv/data/BaltkomTV/">Baltkom TV  - Premiere and Cinema channels microsite<br />
<img src="http://labs.first.lv/wp-content/uploads/2008/10/baltkom.jpg" alt="Baltkom coverflow" /><br />
</a><br />
We added 2 more features:</p>
<ul>
<li><strong>rotation </strong>(after last cover first cover is the next)</li>
<li><strong>startIndex </strong>(different start index support)</li>
</ul>
<p>You can <strong>download </strong>the <a href="http://labs.first.lv/wp-content/uploads/2009/02/yetanothercoverflowclone1.zip">patched files</a> or a <a href="http://labs.first.lv/wp-content/uploads/2008/10/rotation_startindex.patch">Subversion patch file</a></p>
<p>Both features are implemented as settings to be configured in data.xml:</p>
<p><code> &lt;!-- Turn rotation on by setting rotation to "true": --&gt;<br />
&lt;rotation&gt;true&lt;/rotation&gt;</code><code><br />
</code></p>
<p><code>&lt;!-- Display different start conver by specifying start index --&gt;<br />
&lt;</code><code>startIndex</code><code>&gt;1&lt;/</code><code>startIndex</code><code>&gt;<br />
</code></p>
<p><code> &lt;!-- You can also set this to "center" for having always the middle start index --&gt;<br />
&lt;startIndex&gt;center&lt;/startIndex&gt;</code><code><br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.first.lv/2008/10/21/yetanothercoverflowclone-rotation-startindex/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>

