views:

22

answers:

2
A: 

You posted code seems to have syntactical errors, but I think the solution for your problem should be the call of e.target.startDrag();. With your call of my_thumb.startDrag(); you are trying to call a function startDrag on e.target.name which doesn't exists.

Alternativly you can replace

var my_thumb = e.target.name;

with

var my_thumb = e.target;
splash
A: 

There are a lot of errors in your code. You're also trying to do too much with one single method. You parse your data, create a movie clip , add a loader , load an image then call a function on the loader... I've tried to get rid of the obvious mistakes , but there's no doubt your code could be improved by separating concerns.

If you split your code into separate methods, your code will be more flexible & much easier to debug too... You could load & parse your variables , in another function prepare your XML data for your designs , then leave the display logic to another method.

In the meantime, here's your code with less mistakes

    function onDataLoad(evt:Event)
    {

        for(var i:uint=0; i< evt.target.data.cant; i++)
        {
            var mc_holder:MovieClip = new MovieClip();
            mc_holder.name = "mc_holder"+i;
            mc_holder.x = 30;
            mc_holder.y = mc_holder.height+10;

             //trace(mc_holder.y = mc_holder.height*i);
            addChild(mc_holder);

            var loader:Loader = new Loader();

            loader.load(new URLRequest(evt.target.data["Image"+i]));

            mc_holder.addChild(loader)
            mc_holder.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);

        }
    }

    function mouseDownHandler(e:MouseEvent):void 
    {
        var my_thumb:MovieClip = e.target as MovieClip;
        trace(my_thumb);
        my_thumb.startDrag();

    }  
PatrickS