Perhaps I'm wrong, but I thought I did a valid test to see what _width was returned right after a holder clip, which already had an image loaded, was instructed to load another image. The width that was returned was for the prior image, even though the loadMovie command for a new image had already been issued:

holder.loadMovie("image01.jpg");
// then after a few seconds, call this:
holder.loadMovie("image02.jpg");
trace (holder._width) // returns the width of image01.jpg, NOT zero or the width of image02.jpg

Thus I don't believe that this code, which you proposed, will detect if the new image has loaded:

this.holder.loadMovie("some.jpg");
this.onEnterFrame = function() {
        if (this.holder._width > 4) {
                resizeHolder();
                delete this.onEnterFrame;
        }
};

That's why I think onLoadInit is required. How else would you know when to rescale the new image?

By the way, I do like your code to determine the scale factor and do the scaling. Nice and efficient.

-Marc

At 04:44 PM 11/1/2006, you wrote:

You don't NEED to use MovieClipLoader and onLoadInit, but feel free to
if you WANT.  :)


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to