title: Flash as3 understanding localToGlobal
body: <p>I'm just having a little bit of trouble understanding Flash's localToGlobal functionality. I have a movieClip, which is nested inside a whole bunch of other movieclips. When that nested clip is clicked, I want to find its position, and moved the topmost containing clip by an amount such that the nested clip is in the center of the stage (basically what I have is a tree diagram, and the effect I want is that the treeContainer pans to the clicked "branch" as the center of the stage)</p>
  
  <p>So I have this:</p>
  
  <pre><code>var treePoint = new Point (treeContainer.x,treeContainer.y); //since treePoint's parent is the stage, don't need global here.
  
  var groupPoint = new Point (groupClip.x,groupClip.y);
  var groupPointGlobal = groupClip.localToGlobal(groupPoint);
  var stageCenter = new Point (int(stage.stageWidth/2),int(stage.stageHeight)/2);
  
  var shiftAmount = ???
  </code></pre>
  
  <p>Thanks for any help you can provide.</p>