views:

329

answers:

1

Have little bit of problem for my flash apps

I have a loader which load the image from the server. I also have a large movieclip that hold a list of small movieclips that are used to preview an image using the loader class.

It can display the image if I used the loader to add it directly on the large movieclip but it doesn't display the image when add them to a small movieclip and add them to the large movieclip...

This is my code :

enter code heres    loaderinfo.loader.width *= scale;
     loaderinfo.loader.height *= scale;

    var movie:MovieClip = new MovieClip();
    movie.image_src = xml.child("item")[loaderinfo.loader.name].child("image_src").valueOf();

    movie.x = 0;
    movie.y = 0;
    movie.width = loaderinfo.loader.width;
    movie.height = loaderinfo.loader.height;

    movie.addChild(loaderinfo.loader);
    ItemHolders.addChild(movie);

    col_count++;

    if (col_count == ttl_columms)
    {

     distX = spacing;
     distY += spacing + distHeight;
    }
    else if (col_count < ttl_columms)
    {
     distX += spacing + distWidth;

    }
A: 

I'm not sure, but it could be due to this 3 lines of code:

movie.width = loaderinfo.loader.width;
movie.height = loaderinfo.loader.height;
movie.addChild(loaderinfo.loader);

You are trying to resize an empty MovieClip, and that could be problematic... try adding the child prior to resizing the movieclip (though I don't see the need for resizing it ;)).

Cay