Xml infinite menu problems

Hello all at last i have found somewhere where people really help each other.

I’ve been learning flash on and off for a few years but only started to know what i was doing a few months back.

I’m not a logical thinker so my problems all start there. To many ideas.

Right i’ve found a few source codes on this site with what i’d like to do but all seem to go way above my head. :crying:

I’ve made a simple flash file that loads data from an xml document and i want it to scroll up and down on a infinite loop.

My problem is my movie clips start to over lap and mess up and looks tat.


stop();
// populate movie with movieClips 
function makeList() {
        var spacing:Number = 100;
        maxLength = (testXML.firstChild.childNodes.length * 100);
        for (var i = 0; i < testXML.firstChild.childNodes.length; ++i) {
                var name:String = "nav" + i;
                var y:Number = i * spacing;
                var rootNode:XMLNode = testXML.firstChild;
                parentNav_mc.attachClip_mc.attachMovie("box", name, i);
                parentNav_mc.attachClip_mc[name]._y = y;
                parentNav_mc.attachClip_mc[name].name_txt.text = rootNode.childNodes*.attributes.name;
        }
}
// connect to xml 
var testXML:XML = new XML();
testXML.onLoad = makeList;
testXML.ignoreWhite = true;
testXML.load("test2.xml");
var maxLengthHeight:Number;
var maxLength:Number;
var whatSpeed:Number;
var movieHeight:Number;
// loop movie clips 
parentNav_mc.onEnterFrame = function() {
        var speedFactor:Number = 0.1;
        var scrollSpeed:Number = (150 - _root._ymouse) * speedFactor;
        _root.whatSpeed = Math.round(scrollSpeed);
        _root.movieHeight = _root.parentNav_mc._height;
        for (name in parentNav_mc.attachClip_mc) {
                if ((name.indexOf("nav") == 0)) {
                        parentNav_mc.attachClip_mc[name]._y += _root.whatSpeed;
                        if (parentNav_mc.attachClip_mc[name]._y > _root.movieHeight) {
                                parentNav_mc.attachClip_mc[name]._y = 10;
                        }
                        else if (parentNav_mc.attachClip_mc[name]._y < 10) {
                                parentNav_mc.attachClip_mc[name]._y = _root.movieHeight;
                        }
                }
        }
};

Any help on what i’m doing wrong would be great. Cheers :beer: