<?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: Dynamic Stacking</title>
	<atom:link href="http://blog.soulwire.co.uk/code/open-source/dynamic-stacking/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.soulwire.co.uk/code/open-source/dynamic-stacking</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: Ant</title>
		<link>http://blog.soulwire.co.uk/code/open-source/dynamic-stacking/comment-page-4#comment-9090</link>
		<dc:creator>Ant</dc:creator>
		<pubDate>Thu, 12 Aug 2010 15:31:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=31#comment-9090</guid>
		<description>Great piece of work. Any help on offer to add a button to the right of each box that will show a unique movie clip when clicked? I&#039;m working with the AS3 version.

Thanks.</description>
		<content:encoded><![CDATA[<p>Great piece of work. Any help on offer to add a button to the right of each box that will show a unique movie clip when clicked? I&#8217;m working with the AS3 version.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AS3 Drag Sort Grid Experiment &#124; The Reformation</title>
		<link>http://blog.soulwire.co.uk/code/open-source/dynamic-stacking/comment-page-4#comment-9084</link>
		<dc:creator>AS3 Drag Sort Grid Experiment &#124; The Reformation</dc:creator>
		<pubDate>Sun, 01 Aug 2010 14:16:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=31#comment-9084</guid>
		<description>[...] orginal file came from the excellent soulwire (JUSTIN WINDLE) at this url; http://blog.soulwire.co.uk/art/dynamic-stacking/   This entry was posted in ActionScript 3 and tagged ActionScript 3, Class, drag, drag n drop, [...]</description>
		<content:encoded><![CDATA[<p>[...] orginal file came from the excellent soulwire (JUSTIN WINDLE) at this url; <a href="http://blog.soulwire.co.uk/art/dynamic-stacking/"  rel="nofollow">http://blog.soulwire.co.uk/art/dynamic-stacking/</a>   This entry was posted in ActionScript 3 and tagged ActionScript 3, Class, drag, drag n drop, [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mart</title>
		<link>http://blog.soulwire.co.uk/code/open-source/dynamic-stacking/comment-page-4#comment-174</link>
		<dc:creator>mart</dc:creator>
		<pubDate>Sun, 06 Dec 2009 15:48:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=31#comment-174</guid>
		<description>Hey Justin,

Thanks for script, this has been a great help to me and somewhere to start from ...

Im having some peculiar results with the deleteLayer method.

Im finding in some instances its removing the items from the array (great news) and other times its just emptying the item - which causes issues when the sort method is called.

Any ideas?

Thanks in advance</description>
		<content:encoded><![CDATA[<p>Hey Justin,</p>
<p>Thanks for script, this has been a great help to me and somewhere to start from &#8230;</p>
<p>Im having some peculiar results with the deleteLayer method.</p>
<p>Im finding in some instances its removing the items from the array (great news) and other times its just emptying the item &#8211; which causes issues when the sort method is called.</p>
<p>Any ideas?</p>
<p>Thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://blog.soulwire.co.uk/code/open-source/dynamic-stacking/comment-page-4#comment-173</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Tue, 01 Dec 2009 09:55:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=31#comment-173</guid>
		<description>Hi, now it&#039;s working for me, I just removed the line setChildIndex in OnBoxPress func... Thanks, it&#039;s really great tutorial...</description>
		<content:encoded><![CDATA[<p>Hi, now it&#8217;s working for me, I just removed the line setChildIndex in OnBoxPress func&#8230; Thanks, it&#8217;s really great tutorial&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://blog.soulwire.co.uk/code/open-source/dynamic-stacking/comment-page-4#comment-172</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Tue, 01 Dec 2009 08:51:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=31#comment-172</guid>
		<description>Hi, this is really great! But I have some problem with AS3 version. Everything works fine until I don&#039;t put boxes into some movieclip.
So I defined some movieclip and added
holder.addChild( box );
and onBoxPress
holder.setChildIndex( event.currentTarget as Box, numChildren - 1 );
And it&#039;s working fine only if there are more than 15 items, if less, then nothing happened, I cant drag the items. But when I dont put it to movieclip, then its good. I don&#039;t have any idea, why, do you have some, please?
Thanks...</description>
		<content:encoded><![CDATA[<p>Hi, this is really great! But I have some problem with AS3 version. Everything works fine until I don&#8217;t put boxes into some movieclip.<br />
So I defined some movieclip and added<br />
holder.addChild( box );<br />
and onBoxPress<br />
holder.setChildIndex( event.currentTarget as Box, numChildren &#8211; 1 );<br />
And it&#8217;s working fine only if there are more than 15 items, if less, then nothing happened, I cant drag the items. But when I dont put it to movieclip, then its good. I don&#8217;t have any idea, why, do you have some, please?<br />
Thanks&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eddiem</title>
		<link>http://blog.soulwire.co.uk/code/open-source/dynamic-stacking/comment-page-4#comment-171</link>
		<dc:creator>eddiem</dc:creator>
		<pubDate>Mon, 09 Nov 2009 15:04:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=31#comment-171</guid>
		<description>hi kool tut

but i was wondering if u knew how to do the same thing but with images i already have instead of boxes?</description>
		<content:encoded><![CDATA[<p>hi kool tut</p>
<p>but i was wondering if u knew how to do the same thing but with images i already have instead of boxes?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Almog Koren</title>
		<link>http://blog.soulwire.co.uk/code/open-source/dynamic-stacking/comment-page-4#comment-170</link>
		<dc:creator>Almog Koren</dc:creator>
		<pubDate>Thu, 22 Oct 2009 23:19:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=31#comment-170</guid>
		<description>Any I could really use the help.</description>
		<content:encoded><![CDATA[<p>Any I could really use the help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Almog Koren</title>
		<link>http://blog.soulwire.co.uk/code/open-source/dynamic-stacking/comment-page-4#comment-169</link>
		<dc:creator>Almog Koren</dc:creator>
		<pubDate>Thu, 22 Oct 2009 12:08:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=31#comment-169</guid>
		<description>Hi does anyone know how to have this work with two columns, with the width of each box being dynamic.
Thanks
Almog</description>
		<content:encoded><![CDATA[<p>Hi does anyone know how to have this work with two columns, with the width of each box being dynamic.<br />
Thanks<br />
Almog</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chand</title>
		<link>http://blog.soulwire.co.uk/code/open-source/dynamic-stacking/comment-page-4#comment-168</link>
		<dc:creator>chand</dc:creator>
		<pubDate>Sun, 13 Sep 2009 07:15:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=31#comment-168</guid>
		<description>&lt;code&gt;&lt;pre lang=&quot;actionscript&quot;&gt; [ var names:Array = [&quot;12&quot;, &quot;11&quot;, &quot;10&quot;, &quot;9&quot;, &quot;8&quot;, &quot;7&quot;, &quot;6&quot;, &quot;5&quot;, &quot;4&quot;, &quot;3&quot;, &quot;2&quot;, &quot;1&quot;]; ] &lt;/pre&gt;&lt;/code&gt;

Why the array shown from the end on the boxes. The code reads the array from the last index. Could we change that order instead of populating our array in such a manner as I do above. Any help must be appreciated.

Thanks</description>
		<content:encoded><![CDATA[<p><code>
<pre lang="actionscript"> [ var names:Array = ["12", "11", "10", "9", "8", "7", "6", "5", "4", "3", "2", "1"]; ] </pre>
<p></code></p>
<p>Why the array shown from the end on the boxes. The code reads the array from the last index. Could we change that order instead of populating our array in such a manner as I do above. Any help must be appreciated.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chand</title>
		<link>http://blog.soulwire.co.uk/code/open-source/dynamic-stacking/comment-page-4#comment-167</link>
		<dc:creator>chand</dc:creator>
		<pubDate>Thu, 10 Sep 2009 11:27:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.soulwire.co.uk/?p=31#comment-167</guid>
		<description>I want to copy the sorted values in another array, I need hint how I can do that. like we have the names array it remain same but after each sorting I want to have the values in another sortedArray. Please guide me how I can do that.

&lt;code&gt;&lt;pre lang=&quot;actionscript&quot;&gt; [
var boxes:Array = new Array ();
var boxCount:Number = 0;
var boxGap:Number = 50;//85

var names:Array = [&quot;12&quot;, &quot;11&quot;, &quot;10&quot;, &quot;9&quot;, &quot;8&quot;, &quot;7&quot;, &quot;6&quot;, &quot;5&quot;, &quot;4&quot;, &quot;3&quot;, &quot;2&quot;, &quot;1&quot;];
var paths:Array = [&quot;../pages/cover.jpg&quot;, &quot;../pages/page1_left.png&quot;, &quot;../pages/page2_right.png&quot;,
				  &quot;../pages/page3_left.png&quot;, &quot;../pages/page4_right.png&quot;, &quot;../pages/page5_left.png&quot;,
				  &quot;../pages/page6_right.png&quot;, &quot;../pages/page7_left.png&quot;, &quot;../pages/page8_right.png&quot;,
				  &quot;../pages/image67.jpg&quot;, &quot;../pages/image106.jpg&quot;, &quot;../pages/backend.jpg&quot;];

//var sortedPaths:Array = new Array();



//relocate
/*
Array.prototype.relocate = function (from, to, putBefore)
{
    var index = this.splice(from, 1);
    this.splice(to - (putBefore ? 1 : 0), 0, index[0]);
}

*/
Array.prototype.shuffle = function (x, y)
{
	var i:Number = this.slice (x, x + 1);
	this.splice (x, 1);
	this.splice (y, 0, i);
};

function sort ()
{
	var count:Number = boxes.length;
	for (var i = 0; i &lt; count; i++)
	{
		var id:Number = boxes[i];
		var box:MovieClip = eval (&quot;menu.box&quot; + id);
		var y:Number = i * boxGap;
		var sortedNames:Array = new Array();
		box.id = i;
		sortedNames.push(this.name.text);
		trace(sortedNames);
		box.tween (&quot;_y&quot;, y, 0.8, &quot;easeInOut&quot;);
	}
}

function addBox ()
{

	var d:Number = menu.getNextHighestDepth ();
	var i:Number = boxCount;
	boxes.unshift (i);
	var box:MovieClip = menu.attachMovie (&quot;box&quot;, &quot;box&quot; + i, d);

	box.initBox (i);
	boxCount++;
	sort ();

}
function deleteLayer (id)
{
	var box:MovieClip = eval (&quot;menu.box&quot; + boxes[id]);
	box.removeMovieClip ();
	boxes.splice (id, 1);
	sort ();
}

MovieClip.prototype.initBox = function (num)
{
	this.id = num;
	this.name.text = names[num];
	this.path.text = paths[num];


	this.onPress = function ()
	{
		var top:Number = boxCount + 1;
		this.swapDepths (top);
		this.startDrag();
		/*
		this.relocate(paths[num], sortedPaths[num], sortedPaths[num++]);
		trace(sortedPaths);
		trace(paths);
		*/
		this._alpha = 70;
	};

	this.onRelease = this.onReleaseOutside = function ()
	{
		this.stopDrag ();
		this._alpha = 100;
		this.tween (&quot;_x&quot;, 0, 0.8, &quot;easeInOut&quot;);
		var x:Number = this.id;
		var y:Number = Math.round (this._y / boxGap);

//		this.relocate(paths[num], sortedPaths[num], sortedPaths[num++]);
//		trace(sortedPaths);
//		trace(paths);

		boxes.shuffle (x, y);
		sort ();

		if(this.id == 0){
		_root.gotoPage(1, false);
		}
		if(this.id == 2){
		_root.gotoPage(3, false);
		}
		if(this.id == 3){
		_root.gotoPage(5, false);
		}
		if(this.id == 4){
		_root.gotoPage(7, false);
		}
		if(this.id == 5){
		_root.gotoPage(9, false);
		}
		if(this.id == 6){
		_root.gotoPage(11, false);
		}
	};
};

for (var i = 1; i &lt;= 12; i++)
{
	addBox ();

}
 ] &lt;/pre&gt;&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I want to copy the sorted values in another array, I need hint how I can do that. like we have the names array it remain same but after each sorting I want to have the values in another sortedArray. Please guide me how I can do that.</p>
<p><code>
<pre lang="actionscript"> [
var boxes:Array = new Array ();
var boxCount:Number = 0;
var boxGap:Number = 50;//85

var names:Array = ["12", "11", "10", "9", "8", "7", "6", "5", "4", "3", "2", "1"];
var paths:Array = ["../pages/cover.jpg", "../pages/page1_left.png", "../pages/page2_right.png",
				  "../pages/page3_left.png", "../pages/page4_right.png", "../pages/page5_left.png",
				  "../pages/page6_right.png", "../pages/page7_left.png", "../pages/page8_right.png",
				  "../pages/image67.jpg", "../pages/image106.jpg", "../pages/backend.jpg"];

//var sortedPaths:Array = new Array();

//relocate
/*
Array.prototype.relocate = function (from, to, putBefore)
{
    var index = this.splice(from, 1);
    this.splice(to - (putBefore ? 1 : 0), 0, index[0]);
}

*/
Array.prototype.shuffle = function (x, y)
{
	var i:Number = this.slice (x, x + 1);
	this.splice (x, 1);
	this.splice (y, 0, i);
};

function sort ()
{
	var count:Number = boxes.length;
	for (var i = 0; i &lt; count; i++)
	{
		var id:Number = boxes[i];
		var box:MovieClip = eval ("menu.box" + id);
		var y:Number = i * boxGap;
		var sortedNames:Array = new Array();
		box.id = i;
		sortedNames.push(this.name.text);
		trace(sortedNames);
		box.tween ("_y", y, 0.8, "easeInOut");
	}
}

function addBox ()
{

	var d:Number = menu.getNextHighestDepth ();
	var i:Number = boxCount;
	boxes.unshift (i);
	var box:MovieClip = menu.attachMovie ("box", "box" + i, d);

	box.initBox (i);
	boxCount++;
	sort ();

}
function deleteLayer (id)
{
	var box:MovieClip = eval ("menu.box" + boxes[id]);
	box.removeMovieClip ();
	boxes.splice (id, 1);
	sort ();
}

MovieClip.prototype.initBox = function (num)
{
	this.id = num;
	this.name.text = names[num];
	this.path.text = paths[num];

	this.onPress = function ()
	{
		var top:Number = boxCount + 1;
		this.swapDepths (top);
		this.startDrag();
		/*
		this.relocate(paths[num], sortedPaths[num], sortedPaths[num++]);
		trace(sortedPaths);
		trace(paths);
		*/
		this._alpha = 70;
	};

	this.onRelease = this.onReleaseOutside = function ()
	{
		this.stopDrag ();
		this._alpha = 100;
		this.tween ("_x", 0, 0.8, "easeInOut");
		var x:Number = this.id;
		var y:Number = Math.round (this._y / boxGap);

//		this.relocate(paths[num], sortedPaths[num], sortedPaths[num++]);
//		trace(sortedPaths);
//		trace(paths);

		boxes.shuffle (x, y);
		sort ();

		if(this.id == 0){
		_root.gotoPage(1, false);
		}
		if(this.id == 2){
		_root.gotoPage(3, false);
		}
		if(this.id == 3){
		_root.gotoPage(5, false);
		}
		if(this.id == 4){
		_root.gotoPage(7, false);
		}
		if(this.id == 5){
		_root.gotoPage(9, false);
		}
		if(this.id == 6){
		_root.gotoPage(11, false);
		}
	};
};

for (var i = 1; i &lt;= 12; i++)
{
	addBox ();

}
 ] </pre>
<p></code></p>
]]></content:encoded>
	</item>
</channel>
</rss>

