<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: AS3 Shuffle Grid Class</title>
	<atom:link href="http://blog.soulwire.co.uk/code/open-source/as3-drag-drop-shuffle-grid-menu/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.soulwire.co.uk/code/open-source/as3-drag-drop-shuffle-grid-menu</link>
	<description>Art + Technology</description>
	<lastBuildDate>Thu, 06 Oct 2011 13:58:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Abhinov</title>
		<link>http://blog.soulwire.co.uk/code/open-source/as3-drag-drop-shuffle-grid-menu/comment-page-6#comment-9849</link>
		<dc:creator>Abhinov</dc:creator>
		<pubDate>Wed, 07 Sep 2011 12:42:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=311#comment-9849</guid>
		<description>Really nice.Thanks for this.</description>
		<content:encoded><![CDATA[<p>Really nice.Thanks for this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: antonio brandao</title>
		<link>http://blog.soulwire.co.uk/code/open-source/as3-drag-drop-shuffle-grid-menu/comment-page-6#comment-9664</link>
		<dc:creator>antonio brandao</dc:creator>
		<pubDate>Tue, 05 Apr 2011 18:05:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=311#comment-9664</guid>
		<description>too bad you version requies all slots to be full. something very unlikely in the in most applications. a little update would be very appreiated for those struggling to use your version</description>
		<content:encoded><![CDATA[<p>too bad you version requies all slots to be full. something very unlikely in the in most applications. a little update would be very appreiated for those struggling to use your version</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ActionScript Tutorials and Quick Tips. Weekly Roundup from DesignFloat &#124; DesignFloat Blog</title>
		<link>http://blog.soulwire.co.uk/code/open-source/as3-drag-drop-shuffle-grid-menu/comment-page-5#comment-9545</link>
		<dc:creator>ActionScript Tutorials and Quick Tips. Weekly Roundup from DesignFloat &#124; DesignFloat Blog</dc:creator>
		<pubDate>Fri, 18 Mar 2011 16:00:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=311#comment-9545</guid>
		<description>[...] AS3 Shuffle Grid Class [...]</description>
		<content:encoded><![CDATA[<p>[...] AS3 Shuffle Grid Class [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zoruo</title>
		<link>http://blog.soulwire.co.uk/code/open-source/as3-drag-drop-shuffle-grid-menu/comment-page-5#comment-9543</link>
		<dc:creator>zoruo</dc:creator>
		<pubDate>Thu, 17 Mar 2011 06:36:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=311#comment-9543</guid>
		<description>I&#039;ve found a bug in this class in function getPosition
Here&#039;s the correct version:(Sorry if there is any code format inconvenience.)
private function getPosition(row : int, col : int) : Point
		{
			return new Point(col * (_rowSize + _padd), row * (_colSize + _padd));
		}</description>
		<content:encoded><![CDATA[<p>I&#8217;ve found a bug in this class in function getPosition<br />
Here&#8217;s the correct version:(Sorry if there is any code format inconvenience.)<br />
private function getPosition(row : int, col : int) : Point<br />
		{<br />
			return new Point(col * (_rowSize + _padd), row * (_colSize + _padd));<br />
		}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Byoung-Kwng</title>
		<link>http://blog.soulwire.co.uk/code/open-source/as3-drag-drop-shuffle-grid-menu/comment-page-5#comment-9529</link>
		<dc:creator>Byoung-Kwng</dc:creator>
		<pubDate>Fri, 11 Mar 2011 09:34:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=311#comment-9529</guid>
		<description>Thank for your sharing source, it strongly helps to me.</description>
		<content:encoded><![CDATA[<p>Thank for your sharing source, it strongly helps to me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prakash</title>
		<link>http://blog.soulwire.co.uk/code/open-source/as3-drag-drop-shuffle-grid-menu/comment-page-5#comment-9338</link>
		<dc:creator>Prakash</dc:creator>
		<pubDate>Thu, 09 Dec 2010 02:07:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=311#comment-9338</guid>
		<description>Excellent post with the drag &amp; drop shuffle grid menu systems.  I really love it &amp; inspired with this AS3 shuffle grid class.  

Thx for sharing such an informative post with appropriate coding</description>
		<content:encoded><![CDATA[<p>Excellent post with the drag &amp; drop shuffle grid menu systems.  I really love it &amp; inspired with this AS3 shuffle grid class.  </p>
<p>Thx for sharing such an informative post with appropriate coding</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vladimir</title>
		<link>http://blog.soulwire.co.uk/code/open-source/as3-drag-drop-shuffle-grid-menu/comment-page-5#comment-9328</link>
		<dc:creator>vladimir</dc:creator>
		<pubDate>Mon, 06 Dec 2010 16:30:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=311#comment-9328</guid>
		<description>amazing work!
Excuse me for the stupid question, but I try figure out how can I get an items by its position on the grid. For example to call item at 1-st cell, or second, or items by its col and raw position. Please help!</description>
		<content:encoded><![CDATA[<p>amazing work!<br />
Excuse me for the stupid question, but I try figure out how can I get an items by its position on the grid. For example to call item at 1-st cell, or second, or items by its col and raw position. Please help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darshan</title>
		<link>http://blog.soulwire.co.uk/code/open-source/as3-drag-drop-shuffle-grid-menu/comment-page-5#comment-9196</link>
		<dc:creator>Darshan</dc:creator>
		<pubDate>Mon, 25 Oct 2010 08:43:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=311#comment-9196</guid>
		<description>Excellent, Thanks</description>
		<content:encoded><![CDATA[<p>Excellent, Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rich</title>
		<link>http://blog.soulwire.co.uk/code/open-source/as3-drag-drop-shuffle-grid-menu/comment-page-5#comment-9102</link>
		<dc:creator>Rich</dc:creator>
		<pubDate>Thu, 26 Aug 2010 10:59:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=311#comment-9102</guid>
		<description>Hi, 

I couldn&#039;t quite get Sabee&#039;s exact code to work but the following is working for me for grids that are not full 

change these two functions:

public function getItemAtPosition(row : int, col : int) : ShuffleGridItemVO
		{
			var item:ShuffleGridItemVO;

			if(_index[row] != null &amp;&amp; _index[row].length &gt; col)
			{
				item = _index[row][col];
			}else
			{
				item = null;
			}
			return item;
		} 




and



private function shuffleItems() : void
		{
			var itemVO : ShuffleGridItemVO = _dictionary[_currentItem];
			var cell : Point = getCell(_currentItem.x, _currentItem.y);
			
			var col : int = (getItemAtPosition(cell.y, cell.x) != null)?cell.x: itemVO.col;
			var row : int = (getItemAtPosition(cell.y, cell.x) != null)?cell.y: itemVO.row;
			
			var colFound:Boolean = false;
			
			
			if(col == itemVO.col &amp;&amp; row == itemVO.row)
			{
				return;
			}
			
			var hMove : int = (col == itemVO.col)?0:col - itemVO.col;
			var vMove : int = (row == itemVO.row)?0:row - itemVO.row;
			
			var i : int;
			var item : ShuffleGridItemVO;
			var move : Array = [];
			
			
			
			if(hMove = itemVO.col + hMove; i--)
				{
					if(_index[itemVO.row][i])
					{
						item = _index[itemVO.row][i];
						item.col++;
						
						_index[item.row][item.col] = item;
						move.push(item);
					}
				}
			}
			else
			{
				for (i = itemVO.col + 1;i &lt;= itemVO.col + hMove; i++)
				{
					if(_index[itemVO.row][i])
					{
						item = _index[itemVO.row][i];
						item.col--;
						
						_index[item.row][item.col] = item;
						move.push(item);
					}
				}
			}
			
			if(vMove = itemVO.row + vMove; i--)
				{
					if(_index[i][itemVO.col + hMove])
					{
						item = _index[i][itemVO.col + hMove];
						item.row++;
						
						while(!colFound){
							if (getItemAtPosition(item.row, item.col)) {
								colFound = true;
							}else {
								item.col--;
							}
						}
						
						_index[item.row][item.col] = item;
						move.push(item);
						
					}
				}
			}
			else
			{
				for (i = itemVO.row + 1;i &lt;= itemVO.row + vMove; i++)
				{
					if(_index[i][itemVO.col + hMove])
					{
						item = _index[i][itemVO.col + hMove];
						item.row--;
						
						_index[item.row][item.col] = item;
						move.push(item);
					}
				}
			}
			
			
			for (i = 0;i &lt; move.length; i++)
			{
				snapToGrid(move[i]);
			}
			
			itemVO.row = row;
			itemVO.col = col;
			
			_index[row][col] = itemVO;
		}</description>
		<content:encoded><![CDATA[<p>Hi, </p>
<p>I couldn&#8217;t quite get Sabee&#8217;s exact code to work but the following is working for me for grids that are not full </p>
<p>change these two functions:</p>
<p>public function getItemAtPosition(row : int, col : int) : ShuffleGridItemVO<br />
		{<br />
			var item:ShuffleGridItemVO;</p>
<p>			if(_index[row] != null &amp;&amp; _index[row].length &gt; col)<br />
			{<br />
				item = _index[row][col];<br />
			}else<br />
			{<br />
				item = null;<br />
			}<br />
			return item;<br />
		} </p>
<p>and</p>
<p>private function shuffleItems() : void<br />
		{<br />
			var itemVO : ShuffleGridItemVO = _dictionary[_currentItem];<br />
			var cell : Point = getCell(_currentItem.x, _currentItem.y);</p>
<p>			var col : int = (getItemAtPosition(cell.y, cell.x) != null)?cell.x: itemVO.col;<br />
			var row : int = (getItemAtPosition(cell.y, cell.x) != null)?cell.y: itemVO.row;</p>
<p>			var colFound:Boolean = false;</p>
<p>			if(col == itemVO.col &amp;&amp; row == itemVO.row)<br />
			{<br />
				return;<br />
			}</p>
<p>			var hMove : int = (col == itemVO.col)?0:col &#8211; itemVO.col;<br />
			var vMove : int = (row == itemVO.row)?0:row &#8211; itemVO.row;</p>
<p>			var i : int;<br />
			var item : ShuffleGridItemVO;<br />
			var move : Array = [];</p>
<p>			if(hMove = itemVO.col + hMove; i&#8211;)<br />
				{<br />
					if(_index[itemVO.row][i])<br />
					{<br />
						item = _index[itemVO.row][i];<br />
						item.col++;</p>
<p>						_index[item.row][item.col] = item;<br />
						move.push(item);<br />
					}<br />
				}<br />
			}<br />
			else<br />
			{<br />
				for (i = itemVO.col + 1;i &lt;= itemVO.col + hMove; i++)<br />
				{<br />
					if(_index[itemVO.row][i])<br />
					{<br />
						item = _index[itemVO.row][i];<br />
						item.col&#8211;;</p>
<p>						_index[item.row][item.col] = item;<br />
						move.push(item);<br />
					}<br />
				}<br />
			}</p>
<p>			if(vMove = itemVO.row + vMove; i&#8211;)<br />
				{<br />
					if(_index[i][itemVO.col + hMove])<br />
					{<br />
						item = _index[i][itemVO.col + hMove];<br />
						item.row++;</p>
<p>						while(!colFound){<br />
							if (getItemAtPosition(item.row, item.col)) {<br />
								colFound = true;<br />
							}else {<br />
								item.col&#8211;;<br />
							}<br />
						}</p>
<p>						_index[item.row][item.col] = item;<br />
						move.push(item);</p>
<p>					}<br />
				}<br />
			}<br />
			else<br />
			{<br />
				for (i = itemVO.row + 1;i &lt;= itemVO.row + vMove; i++)<br />
				{<br />
					if(_index[i][itemVO.col + hMove])<br />
					{<br />
						item = _index[i][itemVO.col + hMove];<br />
						item.row&#8211;;</p>
<p>						_index[item.row][item.col] = item;<br />
						move.push(item);<br />
					}<br />
				}<br />
			}</p>
<p>			for (i = 0;i &lt; move.length; i++)<br />
			{<br />
				snapToGrid(move[i]);<br />
			}</p>
<p>			itemVO.row = row;<br />
			itemVO.col = col;</p>
<p>			_index[row][col] = itemVO;<br />
		}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rich</title>
		<link>http://blog.soulwire.co.uk/code/open-source/as3-drag-drop-shuffle-grid-menu/comment-page-5#comment-9101</link>
		<dc:creator>Rich</dc:creator>
		<pubDate>Wed, 25 Aug 2010 16:08:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=311#comment-9101</guid>
		<description>Hi Soulwire, 

Thank you so much for sharing this! Sabee posted some code for irregular grids but it seems to have some bits missing. Did you ever find time to figure this out? 

Cheers
Rich</description>
		<content:encoded><![CDATA[<p>Hi Soulwire, </p>
<p>Thank you so much for sharing this! Sabee posted some code for irregular grids but it seems to have some bits missing. Did you ever find time to figure this out? </p>
<p>Cheers<br />
Rich</p>
]]></content:encoded>
	</item>
</channel>
</rss>

