I’ve been working on a stupid piece of code for 4 days now.
I want to reorder some buttons on the screen by dragging them and have that update the xml behind them. Simple? I don’t know anymore. I’ve whipped up more complex things in minutes, but I have a problem with looping things.
Here’s two ways I’ve been trying:
- I heard tell loaded xml can be manipulated like an array. So I’d like to sort an array based on the user’s drag (I’d like to make this work only targeting the **childnode number ** for change. It would be much faster than adding and deleting whole nodes, I assume.) Here’s my pseudo code:
newval.push({xml_id: x, yval: movie._y});
newval.sortOn(yval), then as it loops it should rearrange the the xml
- xml.childnode[oldval] = newval[newval] *
Can this work?
… :trout: Or should I stick with the second thing I am trying.
- I switched to deleting an old node and inserting a new one where it should go. But this is a lot slower, and for some reason, it is not very consistent.