<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: The Power of Relative Positioning</title>
	<link>http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/</link>
	<description>A digital supplement for the O'Reilly book</description>
	<pubDate>Thu, 11 Mar 2010 18:48:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Matt</title>
		<link>http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/#comment-5434</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Thu, 07 Jan 2010 14:57:50 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/#comment-5434</guid>
		<description>Nice examples, I was wondering, how could I apply this to a grid and when a user clicks on a cell, the rest of the cells move away from the one clicked based on the proximity to the cell clicked. ie, cells closer to the cell clicked move away farther than cells farther away from the cell clicked. If anyone has a link explaining something similar to that, I would appreciate it.</description>
		<content:encoded><![CDATA[<p>Nice examples, I was wondering, how could I apply this to a grid and when a user clicks on a cell, the rest of the cells move away from the one clicked based on the proximity to the cell clicked. ie, cells closer to the cell clicked move away farther than cells farther away from the cell clicked. If anyone has a link explaining something similar to that, I would appreciate it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Almog Koren</title>
		<link>http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/#comment-4355</link>
		<dc:creator>Almog Koren</dc:creator>
		<pubDate>Wed, 21 Oct 2009 19:29:31 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/#comment-4355</guid>
		<description>I was also trying to get two columns set up and not just a line.  

I did this which sets it up but now when I move an object it gets all messed up

&lt;pre class="code"&gt;

//CONSTRUCTOR
i  ;
searchWordBox.x=(searchWordBox.width   SEARCHWORDS_SPACING) * int(i % _cols) 15;
searchWordBox.y=(searchWordBox.height   SEARCHWORDS_SPACING) * int(i / _cols) 15;


//Align boxes, onLoop
b.x  = (b.xDest - b.x   int(i % _cols 15)) / 2;
b.y  = (0 - b.y   int(i % _cols   15)) / 2;

&lt;/pre&gt;

could really use the help. Thanks.</description>
		<content:encoded><![CDATA[<p>I was also trying to get two columns set up and not just a line.  </p>
<p>I did this which sets it up but now when I move an object it gets all messed up</p>
<pre class="code">

//CONSTRUCTOR
i  ;
searchWordBox.x=(searchWordBox.width   SEARCHWORDS_SPACING) * int(i % _cols) 15;
searchWordBox.y=(searchWordBox.height   SEARCHWORDS_SPACING) * int(i / _cols) 15;

//Align boxes, onLoop
b.x  = (b.xDest - b.x   int(i % _cols 15)) / 2;
b.y  = (0 - b.y   int(i % _cols   15)) / 2;
</pre>
<p>could really use the help. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Almog Koren</title>
		<link>http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/#comment-4353</link>
		<dc:creator>Almog Koren</dc:creator>
		<pubDate>Wed, 21 Oct 2009 17:59:18 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/#comment-4353</guid>
		<description>Hi I found this a couple of days ago and this is very helpfully however I am stuck with something I'm trying to have the the boxes width change depending on a dynamic text filed, but I'm getting space which I believe is caused by the container moveclip. I was hopping you could help me with this here is the code thanks, almog.


&lt;pre class="code"&gt;

public function init(searchwords:Array):void
{
  trace("MainViewBasic init");
  var i:int;
  var j:int;

  container.x = 10;
  container.y = 40;
  

  //For each searchword
  for each (var word:String in searchwords)
  {
	//How many search words there are
	NUM_SEARCHWORDS  ;

	//Adds the search word
	var searchWordBox:SearchWordBox = new SearchWordBox();
	var searchWordTxt:TextField = new TextField;

	//Adds the text
	searchWordTxt.text = word;  (  i);
	
	//Sets the text format
	searchWordTxt.setTextFormat( searchWordBox.searchWordTextFormat );
	
	//Adds searchWordTxt to search word box, this is the text
	searchWordBox.addChild(searchWordTxt);
	
	//Adds searchWordBox to container
	container.addChild(searchWordBox);
	
	//Adds container to powerWordsBoxContainer - powerWordsBox 
	powerWordsBoxContainer.powerWordsBox.addChild(container);
	
	//trace(searchWordTxt.textWidth);
	//powerWordsBoxContainer.powerWordsBox.searchWordBox.width = 50;
	trace(container.width);
	
	
	_searchWords.push(searchWordBox);
	//searchWordContainer.name = "searchWordContainer"   i;

	
	searchWordBox.addEventListener(MouseEvent.MOUSE_UP, onStageUp, false, 0, true);
	setupDraggableBox(searchWordBox);
	
	

  }
  //Adds objects
  addChild(powerWordsBoxContainer);
  onStageUp();
}


function setupDraggableBox(mc:SearchWordBox):void
{

  // local variable for use with zeno's paradox
  mc.xDest = mc.x;
	   

  mc.buttonMode = true;
  mc.mouseChildren = false;
  mc.addEventListener(MouseEvent.MOUSE_DOWN, onDown, false, 0, true);
  //_searchWords.push(mc);
}


function onDown(evt:MouseEvent):void
{
  removeEventListener(Event.ENTER_FRAME, onLoop);
  container.addChild(MovieClip(evt.currentTarget));
  evt.currentTarget.startDrag();
}

function onStageUp(evt:MouseEvent = null):void
{

  stopDrag();
  addEventListener(Event.ENTER_FRAME, onLoop, false, 0, true);

}

function onLoop(evt:Event):void
{

  //sort the boxes array by the x property of each clip
  _searchWords.sortOn("x", Array.NUMERIC);

  //make sure the first box always eases to the same position (10, 40);
  _searchWords[0].x  = (0 - _searchWords[0].x) / 2;
  _searchWords[0].y  = (0 - _searchWords[0].y) / 2;

  //align boxes
  for (var i:int = 1; i &#60;NUM_SEARCHWORDS; i  )
  {
	var b:MovieClip=_searchWords[i];
	var prev:MovieClip=_searchWords[i-1];

	b.xDest=prev.x prev.width;
	b.x  = (b.xDest - b.x) / 2;
	b.y  = (0 - b.y) / 2;
  }

}

&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Hi I found this a couple of days ago and this is very helpfully however I am stuck with something I&#8217;m trying to have the the boxes width change depending on a dynamic text filed, but I&#8217;m getting space which I believe is caused by the container moveclip. I was hopping you could help me with this here is the code thanks, almog.</p>
<pre class="code">

public function init(searchwords:Array):void
{
  trace("MainViewBasic init");
  var i:int;
  var j:int;

  container.x = 10;
  container.y = 40;

  //For each searchword
  for each (var word:String in searchwords)
  {
	//How many search words there are
	NUM_SEARCHWORDS  ;

	//Adds the search word
	var searchWordBox:SearchWordBox = new SearchWordBox();
	var searchWordTxt:TextField = new TextField;

	//Adds the text
	searchWordTxt.text = word;  (  i);

	//Sets the text format
	searchWordTxt.setTextFormat( searchWordBox.searchWordTextFormat );

	//Adds searchWordTxt to search word box, this is the text
	searchWordBox.addChild(searchWordTxt);

	//Adds searchWordBox to container
	container.addChild(searchWordBox);

	//Adds container to powerWordsBoxContainer - powerWordsBox
	powerWordsBoxContainer.powerWordsBox.addChild(container);

	//trace(searchWordTxt.textWidth);
	//powerWordsBoxContainer.powerWordsBox.searchWordBox.width = 50;
	trace(container.width);

	_searchWords.push(searchWordBox);
	//searchWordContainer.name = "searchWordContainer"   i;

	searchWordBox.addEventListener(MouseEvent.MOUSE_UP, onStageUp, false, 0, true);
	setupDraggableBox(searchWordBox);

  }
  //Adds objects
  addChild(powerWordsBoxContainer);
  onStageUp();
}

function setupDraggableBox(mc:SearchWordBox):void
{

  // local variable for use with zeno's paradox
  mc.xDest = mc.x;

  mc.buttonMode = true;
  mc.mouseChildren = false;
  mc.addEventListener(MouseEvent.MOUSE_DOWN, onDown, false, 0, true);
  //_searchWords.push(mc);
}

function onDown(evt:MouseEvent):void
{
  removeEventListener(Event.ENTER_FRAME, onLoop);
  container.addChild(MovieClip(evt.currentTarget));
  evt.currentTarget.startDrag();
}

function onStageUp(evt:MouseEvent = null):void
{

  stopDrag();
  addEventListener(Event.ENTER_FRAME, onLoop, false, 0, true);

}

function onLoop(evt:Event):void
{

  //sort the boxes array by the x property of each clip
  _searchWords.sortOn("x", Array.NUMERIC);

  //make sure the first box always eases to the same position (10, 40);
  _searchWords[0].x  = (0 - _searchWords[0].x) / 2;
  _searchWords[0].y  = (0 - _searchWords[0].y) / 2;

  //align boxes
  for (var i:int = 1; i &lt;NUM_SEARCHWORDS; i  )
  {
	var b:MovieClip=_searchWords[i];
	var prev:MovieClip=_searchWords[i-1];

	b.xDest=prev.x prev.width;
	b.x  = (b.xDest - b.x) / 2;
	b.y  = (0 - b.y) / 2;
  }

}
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andris</title>
		<link>http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/#comment-3417</link>
		<dc:creator>Andris</dc:creator>
		<pubDate>Fri, 31 Jul 2009 10:02:02 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/#comment-3417</guid>
		<description>I think it is because the the mask is listening to some eventHandlers and it is covering the buttons. so the event handlers of the button do not get through..... could it be the case? If so how can I get through to my buttons?

thank you</description>
		<content:encoded><![CDATA[<p>I think it is because the the mask is listening to some eventHandlers and it is covering the buttons. so the event handlers of the button do not get through&#8230;.. could it be the case? If so how can I get through to my buttons?</p>
<p>thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andris</title>
		<link>http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/#comment-3412</link>
		<dc:creator>Andris</dc:creator>
		<pubDate>Thu, 30 Jul 2009 20:07:37 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/#comment-3412</guid>
		<description>Hi, I have created accordion using your code. I have three buttons(movieclips) on stage and inside each movieclip is a mask that masks submenus. So when you roll over the button , the mask expands revealing submenus - buttons(movie clips). All buttons are aligning to the mask. So far so good. But there is a problem. I can not access submenus - nested movie clips which are revealed by the expanding mask. Any ideas??? I guess it must me something to do with those "setupRollOvers"....... hmmmm... I have created three different "setupRollOvers" because each expanding box needs to be different height. Thank you in advance.
here is the code:

&lt;pre class="code"&gt;

// alignment code
box1.buttonMode =box2.buttonMode =box3.buttonMode = true;

box1.x = 54;
box1.y = 47;

setupRollOver1(box1.mask1);
setupRollOver2(box2.mask2);
setupRollOver3(box3.mask3);

function setupRollOver1(mc:MovieClip):void {
	// add a local variable to each clip for use with Zeno's paradox
	mc.scaleDest1 = 1;
	mc.buttonMode = true;
	mc.addEventListener(MouseEvent.ROLL_OVER, onOver1, false, 0, true);
	mc.addEventListener(MouseEvent.ROLL_OUT, onOut1, false, 0, true);
	mc.addEventListener(Event.ENTER_FRAME, onScale1, false, 0, true);
}
function onScale1(evt:Event):void {
	var mc:MovieClip = MovieClip(evt.target);
	mc.scaleY  = (mc.scaleDest1 - mc.scaleY) / 3.5;
}
function onOver1(evt:MouseEvent):void {
	evt.target.scaleDest1 = 3;
}
function onOut1(evt:MouseEvent):void {
	evt.target.scaleDest1 = 1;
}

//-------------------------------------------------------------------------------------------

function setupRollOver2(mc:MovieClip):void {
	// add a local variable to each clip for use with Zeno's paradox
	mc.scaleDest2 = 1;
	mc.buttonMode = true;
	mc.addEventListener(MouseEvent.ROLL_OVER, onOver2, false, 0, true);
	mc.addEventListener(MouseEvent.ROLL_OUT, onOut2, false, 0, true);
	mc.addEventListener(Event.ENTER_FRAME, onScale2, false, 0, true);
}
function onScale2(evt:Event):void {
	var mc:MovieClip = MovieClip(evt.target);
	mc.scaleY  = (mc.scaleDest2 - mc.scaleY) / 3.5;
}
function onOver2(evt:MouseEvent):void {
	evt.target.scaleDest2 = 6;
}
function onOut2(evt:MouseEvent):void {
	evt.target.scaleDest2 = 1;
}

//-------------------------------------------------------------------------------------------

function setupRollOver3(mc:MovieClip):void {
	// add a local variable to each clip for use with Zeno's paradox
	mc.scaleDest3 = 1;
	mc.buttonMode = true;
	mc.addEventListener(MouseEvent.ROLL_OVER, onOver3, false, 0, true);
	mc.addEventListener(MouseEvent.ROLL_OUT, onOut3, false, 0, true);
	mc.addEventListener(Event.ENTER_FRAME, onScale3, false, 0, true);
}
function onScale3(evt:Event):void {
	var mc:MovieClip = MovieClip(evt.target);
	mc.scaleY  = (mc.scaleDest3 - mc.scaleY) / 3.5;
}
function onOver3(evt:MouseEvent):void {
	evt.target.scaleDest3 = 6;
}
function onOut3(evt:MouseEvent):void {
	evt.target.scaleDest3 = 1;
}


addEventListener(Event.ENTER_FRAME, onLoop, false, 0, true);
function onLoop(evt:Event):void {
	// position box1 based on box0's x and width properties
	box2.y = (box1.y   box1.mask1.height);
	box2.x = box1.x;

	box3.y = (box2.y   box2.mask2.height);
	box3.x = box2.x;
}

//---------------- no errors but it doesn't work :( ----------------------
box1.subMenu.addEventListener(MouseEvent.MOUSE_UP, menuUp);
function menuUp(e:MouseEvent):void{
	trace("It is not enough room to swing a cat");
}

&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Hi, I have created accordion using your code. I have three buttons(movieclips) on stage and inside each movieclip is a mask that masks submenus. So when you roll over the button , the mask expands revealing submenus - buttons(movie clips). All buttons are aligning to the mask. So far so good. But there is a problem. I can not access submenus - nested movie clips which are revealed by the expanding mask. Any ideas??? I guess it must me something to do with those &#8220;setupRollOvers&#8221;&#8230;&#8230;. hmmmm&#8230; I have created three different &#8220;setupRollOvers&#8221; because each expanding box needs to be different height. Thank you in advance.<br />
here is the code:</p>
<pre class="code">

// alignment code
box1.buttonMode =box2.buttonMode =box3.buttonMode = true;

box1.x = 54;
box1.y = 47;

setupRollOver1(box1.mask1);
setupRollOver2(box2.mask2);
setupRollOver3(box3.mask3);

function setupRollOver1(mc:MovieClip):void {
	// add a local variable to each clip for use with Zeno's paradox
	mc.scaleDest1 = 1;
	mc.buttonMode = true;
	mc.addEventListener(MouseEvent.ROLL_OVER, onOver1, false, 0, true);
	mc.addEventListener(MouseEvent.ROLL_OUT, onOut1, false, 0, true);
	mc.addEventListener(Event.ENTER_FRAME, onScale1, false, 0, true);
}
function onScale1(evt:Event):void {
	var mc:MovieClip = MovieClip(evt.target);
	mc.scaleY  = (mc.scaleDest1 - mc.scaleY) / 3.5;
}
function onOver1(evt:MouseEvent):void {
	evt.target.scaleDest1 = 3;
}
function onOut1(evt:MouseEvent):void {
	evt.target.scaleDest1 = 1;
}

//-------------------------------------------------------------------------------------------

function setupRollOver2(mc:MovieClip):void {
	// add a local variable to each clip for use with Zeno's paradox
	mc.scaleDest2 = 1;
	mc.buttonMode = true;
	mc.addEventListener(MouseEvent.ROLL_OVER, onOver2, false, 0, true);
	mc.addEventListener(MouseEvent.ROLL_OUT, onOut2, false, 0, true);
	mc.addEventListener(Event.ENTER_FRAME, onScale2, false, 0, true);
}
function onScale2(evt:Event):void {
	var mc:MovieClip = MovieClip(evt.target);
	mc.scaleY  = (mc.scaleDest2 - mc.scaleY) / 3.5;
}
function onOver2(evt:MouseEvent):void {
	evt.target.scaleDest2 = 6;
}
function onOut2(evt:MouseEvent):void {
	evt.target.scaleDest2 = 1;
}

//-------------------------------------------------------------------------------------------

function setupRollOver3(mc:MovieClip):void {
	// add a local variable to each clip for use with Zeno's paradox
	mc.scaleDest3 = 1;
	mc.buttonMode = true;
	mc.addEventListener(MouseEvent.ROLL_OVER, onOver3, false, 0, true);
	mc.addEventListener(MouseEvent.ROLL_OUT, onOut3, false, 0, true);
	mc.addEventListener(Event.ENTER_FRAME, onScale3, false, 0, true);
}
function onScale3(evt:Event):void {
	var mc:MovieClip = MovieClip(evt.target);
	mc.scaleY  = (mc.scaleDest3 - mc.scaleY) / 3.5;
}
function onOver3(evt:MouseEvent):void {
	evt.target.scaleDest3 = 6;
}
function onOut3(evt:MouseEvent):void {
	evt.target.scaleDest3 = 1;
}

addEventListener(Event.ENTER_FRAME, onLoop, false, 0, true);
function onLoop(evt:Event):void {
	// position box1 based on box0's x and width properties
	box2.y = (box1.y   box1.mask1.height);
	box2.x = box1.x;

	box3.y = (box2.y   box2.mask2.height);
	box3.x = box2.x;
}

//---------------- no errors but it doesn't work <img src='http://www.learningactionscript3.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> ----------------------
box1.subMenu.addEventListener(MouseEvent.MOUSE_UP, menuUp);
function menuUp(e:MouseEvent):void{
	trace("It is not enough room to swing a cat");
}
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rich</title>
		<link>http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/#comment-2973</link>
		<dc:creator>Rich</dc:creator>
		<pubDate>Thu, 21 May 2009 14:50:59 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/#comment-2973</guid>
		<description>@Ashley, you can certainly use the script to reposition things, but there's no email functionality built in. There are scores and scores of email scripts online, and most require some interaction with the server, such as PHP. You'll need to talk to your system administrator to see what scripting environments are supported on your server and then find one that fits your needs.</description>
		<content:encoded><![CDATA[<p>@Ashley, you can certainly use the script to reposition things, but there&#8217;s no email functionality built in. There are scores and scores of email scripts online, and most require some interaction with the server, such as PHP. You&#8217;ll need to talk to your system administrator to see what scripting environments are supported on your server and then find one that fits your needs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashley</title>
		<link>http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/#comment-2966</link>
		<dc:creator>Ashley</dc:creator>
		<pubDate>Thu, 21 May 2009 04:52:49 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/#comment-2966</guid>
		<description>Hi mate i just found your site about moving objects/sortable lists.
 
i run a family/friends fantsy football comp and for years have played with different ways for the player to log in and select a playing team from their available squad and have it emailed to me as a form.
 
basically my question is can your script be used  for someone to rearrange the order then have a submit button so the order chosen could be emailed to me??
 
i have plently of other info and questions but i suppose it all comes down to whether that main questin is able to be done or if its too hard for the average joe.</description>
		<content:encoded><![CDATA[<p>Hi mate i just found your site about moving objects/sortable lists.</p>
<p>i run a family/friends fantsy football comp and for years have played with different ways for the player to log in and select a playing team from their available squad and have it emailed to me as a form.</p>
<p>basically my question is can your script be used  for someone to rearrange the order then have a submit button so the order chosen could be emailed to me??</p>
<p>i have plently of other info and questions but i suppose it all comes down to whether that main questin is able to be done or if its too hard for the average joe.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christopher coats</title>
		<link>http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/#comment-2583</link>
		<dc:creator>Christopher coats</dc:creator>
		<pubDate>Thu, 02 Apr 2009 07:03:07 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/#comment-2583</guid>
		<description>Can I jump in here?  I am a film teacher looking to make a flash module on basic film editing.  The example above is perfect! and I have been looking for a very long time for something like this but I need the Advanced Align Example (above)to have graphics in them or even better video clips! thisw ould allow students to drag different clips to different areas in a "time line."

I have seen this once but the site is now gone.  The user was able to drag short video clips in any order and then play the order of the clips to view the entire.  There is a site I found that sort of does this but it uses icons to drag into a grid and then the various clips play in an order determined by what icons the user drags into the grid.



http://portfolio.barbariangroup.com/portfoliojobs/259/index.html

and then select ‘Interactive films.”  the scene order of the movie that plays depends on what icons are placed on the grid.  

All I really need though is at least the above advance alignment fla to allow for graphics (no resizing or anything needed just the ability to drag and drop to rearrange the order, thanks!</description>
		<content:encoded><![CDATA[<p>Can I jump in here?  I am a film teacher looking to make a flash module on basic film editing.  The example above is perfect! and I have been looking for a very long time for something like this but I need the Advanced Align Example (above)to have graphics in them or even better video clips! thisw ould allow students to drag different clips to different areas in a &#8220;time line.&#8221;</p>
<p>I have seen this once but the site is now gone.  The user was able to drag short video clips in any order and then play the order of the clips to view the entire.  There is a site I found that sort of does this but it uses icons to drag into a grid and then the various clips play in an order determined by what icons the user drags into the grid.</p>
<p><a href="http://portfolio.barbariangroup.com/portfoliojobs/259/index.html" rel="nofollow">http://portfolio.barbariangroup.com/portfoliojobs/259/index.html</a></p>
<p>and then select ‘Interactive films.”  the scene order of the movie that plays depends on what icons are placed on the grid.  </p>
<p>All I really need though is at least the above advance alignment fla to allow for graphics (no resizing or anything needed just the ability to drag and drop to rearrange the order, thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KS</title>
		<link>http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/#comment-2566</link>
		<dc:creator>KS</dc:creator>
		<pubDate>Tue, 31 Mar 2009 18:43:04 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/#comment-2566</guid>
		<description>Partial success!
&lt;pre class="code"&gt;
function onDown(evt:MouseEvent):void
{
	removeEventListener(Event.ENTER_FRAME, onLoop);
	
	var currentTerm:MovieClip = MovieClip(evt.currentTarget);
	currentTerm.parent.addChild(currentTerm);
	currentTerm.startDrag();
}
&lt;/pre&gt;

This seems to fix it as far as the sorting and returning to its parent container's 0,0 goes. I still don't know why the code just doesn't say 0, 0 instead of: 

&lt;pre class="code"&gt;
boxes[0].x = (0 - boxes[0].x) / 2;
boxes[0].y = (0 - boxes[0].y) / 2;
&lt;/pre&gt;

Can you explain this?

Also, I am using a TimerEvent.TIMER to prevent the EnterFrame Event from constantly running. It's just a 5 second buffer that removes the listener from the stage after onLoop finishes, but it seems to help. Now I just have to work on transferring from one group to another. Any insight? Thanks!</description>
		<content:encoded><![CDATA[<p>Partial success!</p>
<pre class="code">
function onDown(evt:MouseEvent):void
{
	removeEventListener(Event.ENTER_FRAME, onLoop);

	var currentTerm:MovieClip = MovieClip(evt.currentTarget);
	currentTerm.parent.addChild(currentTerm);
	currentTerm.startDrag();
}
</pre>
<p>This seems to fix it as far as the sorting and returning to its parent container&#8217;s 0,0 goes. I still don&#8217;t know why the code just doesn&#8217;t say 0, 0 instead of: </p>
<pre class="code">
boxes[0].x = (0 - boxes[0].x) / 2;
boxes[0].y = (0 - boxes[0].y) / 2;
</pre>
<p>Can you explain this?</p>
<p>Also, I am using a TimerEvent.TIMER to prevent the EnterFrame Event from constantly running. It&#8217;s just a 5 second buffer that removes the listener from the stage after onLoop finishes, but it seems to help. Now I just have to work on transferring from one group to another. Any insight? Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KS</title>
		<link>http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/#comment-2565</link>
		<dc:creator>KS</dc:creator>
		<pubDate>Tue, 31 Mar 2009 17:31:18 +0000</pubDate>
		<guid>http://www.learningactionscript3.com/2008/05/13/the-power-of-relative-positioning/#comment-2565</guid>
		<description>And apparently this comment is from the future [I'm on (GMT-5:00) Eastern Time (US &#38; Canada)]</description>
		<content:encoded><![CDATA[<p>And apparently this comment is from the future [I&#8217;m on (GMT-5:00) Eastern Time (US &amp; Canada)]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
