Trouble with onPress and drag inside a loop [Flash8]

Hi all,

I am trying to take a user input word, in this case “joe,” and add the movie clips representing those letters to the stage in a jumble. I then want the clips to be able to be dragged into correct order. Below is what I have. Everything works but the dragging bit.

I am very much a newbie. My instinct is telling me that the problem is that this is happening in a “for loop” and that the dragging ability is no longer possible at the end of the loop. Is this the case? If so, is there a work around.

var my_str:String = new String("joe");
    var my_array:Array = my_str.split("");
    for (var i = 0; i<my_array.length; i++) {
        var xran:Number = 100+random(100);
        var yran:Number = 100+random(100);
        _root.attachMovie((my_array*),(my_array*)+i,i,{_x:xran, _y:yran});
        var xyz = (my_array*)+i;
        xyz.onPress = function():Void  {
            this.startDrag(true);
        };
        xyz.onRelease = function():Void  {
            this.stopDrag();
        };
    }

Thanks. I appreciate the help with a newbie.