# Help with Depths and overlapping mc's

**URL:** <https://forum.kirupa.com/t/help-with-depths-and-overlapping-mcs/217163>\
**Category:** flash\
**Created:** [February 23, 2007, 5:19pm UTC](https://forum.kirupa.com/t/help-with-depths-and-overlapping-mcs/217163 "2007-02-23T17:19:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fasterthanlight](https://avatars.discourse-cdn.com/v4/letter/f/ecc23a/32.png) [@fasterthanlight](https://forum.kirupa.com/u/fasterthanlight)\
**Post date:** [February 23, 2007, 5:19pm UTC](https://forum.kirupa.com/t/help-with-depths-and-overlapping-mcs/217163/1 "2007-02-23T17:19:35Z")

</div>

Greetings fellow air-breathers!

I’ve got this little flash thing I’m working on…

[SIZE=7][HERE](http://www.february-stars.com/Flash%20Map/map.html)  
[SIZE=2]

And I’m having a hard time figuring out how to deal with the problem of the stars overlapping the label box… Its definitely because I’m using \_root.getNextHighestDepth in both attachMovie’s

But I can’t figure out how to change it so that the label\_mc’s and the star\_mc’s are on two different _playing fields_ if you know what I mean…

[SIZE=7]  
THE CODE  
[SIZE=2]

```auto
var xcord_a:Array = new Array();
var ycord_a:Array = new Array();
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("xml.xml");
function loadXML(loaded) {
    if (loaded) {
        xmlNode = this.firstChild;
        total = xmlNode.childNodes.length;
        for (i=0; i<total; i++) {
            xcord_a.push(String(xmlNode.childNodes*.childNodes[0].firstChild.nodeValue));
            ycord_a.push(String(xmlNode.childNodes*.childNodes[1].firstChild.nodeValue));
            / ***HERE*** /
            _root.attachMovie("star_mc", ["star"+i+"_mc"], _root.getNextHighestDepth(), {_x:xcord_a*, _y:ycord_a*});
            _root.attachMovie("label_mc", ["label"+i+"_mc"], _root.getNextHighestDepth());
            / ************ /
            _root["star"+i+"_mc"].index = i;
            _root["star"+i+"_mc"].onRollOver = function() {
                _root["label"+this.index+"_mc"]._x = _root._xmouse;
                _root["label"+this.index+"_mc"]._y = _root._ymouse;
                fadeIn(this.index);
            };
            _root["star"+i+"_mc"].onRollOut = function() {
                cur = _root["label"+this.index+"_mc"]._currentframe;
                _root["label"+this.index+"_mc"].gotoAndPlay(22-cur);
                _root["label"+this.index+"_mc"].stopDrag();
            };
        }
    } else {
        trace("ERROR");
    }
}
function fadeIn(theIndex) {
    var labelHeight:Number = _root["label"+theIndex+"_mc"]._height;
    var labelWidth:Number = _root["label"+theIndex+"_mc"]._width;
    var stageWidth:Number = Stage.width-labelWidth;
    var stageHeight:Number = Stage.height-labelHeight;
    if (_root["star"+theIndex+"_mc"]._y>stageHeight && _root["star"+theIndex+"_mc"]._x>stageWidth) {
        trace("BOTH");
        _root["label"+theIndex+"_mc"].labelCont_mc.labelPos_mc._x = (-1)*(labelWidth/2+15);
        _root["label"+theIndex+"_mc"].labelCont_mc.labelPos_mc._y = (-1)*(labelHeight+10);
    } else if (_root["star"+theIndex+"_mc"]._y>stageHeight) {
        _root["label"+theIndex+"_mc"].labelCont_mc.labelPos_mc._y = (-1)*(labelHeight+10);
    } else if (_root["star"+theIndex+"_mc"]._x>stageWidth) {
        _root["label"+theIndex+"_mc"].labelCont_mc.labelPos_mc._x = (-1)*(labelWidth+20);
    } else {
        trace("TOP/LEFT");
    }
    _root["label"+theIndex+"_mc"].gotoAndPlay(2);
    _root["label"+theIndex+"_mc"].startDrag(true);
}

```

Can anyone offer me some wisdom?  
[FONT=Courier New][LEFT]  
[/LEFT]  
[/FONT]

[/SIZE] [/SIZE] [/SIZE][/SIZE]
