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)
So I have this:
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 = ???
Thanks for any help you can provide.