Try to mask a dinamicaly loaded img and not work, is a limitation from Flash MX or I make a mistake in my code?
You have to wait until the image is completely loaded before you can use setMask OR you can put that image inside a container clip and mask the container, which is a lot easier.
Thanks for your quick reply
I loaded in a container, mask the containerā¦ nothing.
How can I now if an img is fully loaded? the loadMovie dont have status or something elseā¦
You can use the getBytesLoaded and getBytesTotal methods.
But as I said, the other method is better. Instead of doing
container.loadMovie ("somePic.jpg") ;
container.setMask (theMask) ;
you can do
container.createEmptyMovieClip ("picContainer", 0) ;
container.picContainer.loadMovie ("somePic.jpg") ;
container.setMask (theMask) ;
See what I mean?