troubleshooting Question

movieClipLoader "stretch-to-Fit" issue loading external mvoies of different sizes

Avatar of jobrienct
jobrienct asked on
Adobe Flash
7 Comments1 Solution306 ViewsLast Modified:
I have a TV frame on the stage which has internal dimensions of W:509 x H:390, this is intended to be the "screen" inside of which externally loaded movies play.

I allow the user to select a movie to load from a menu and I load that movie into the tv to play. I have no control over the external movies sizes and they are different as per their creators design.

I need to make them all fit within that internal rectangle and fill the tv screen, essentially "stretch to fit".

When I try it with the following code, 2 movies of different original size and aspect ratio require completely different _width and _height values in order to fit properly within my rectangle as defined by mcMovieWnd, the clip Im loading them into.

Im confused as to what the issue is. When I explicitly set the width on each of them they take on drastically different sizes. This is apparently related to the difference in their aspect ratios - but I simply need to enforce both the width and height for every movie, regardless of aspect ratio or original size.

Im using mx 2004.

myMCL = new MovieClipLoader();  //define MovieClipLoader
myListener = new Object();      //define listener

myMCL.addListener(myListener);

myMCL = new MovieClipLoader();  //define MovieClipLoader
myListener = new Object();      //define listener

myMCL.addListener(myListener);

myListener.onLoadInit = function(targetMC){
      /* smaller movie fits with */
      mcMovieWnd._width = 504;
      mcMovieWnd._height = 400;

      //larger movie fits with
      //mcMovieWnd._width = 685;
      //mcMovieWnd._height = 413;
};

myMCL.loadClip(_root.mcMovDesc.smallFile, "mcMovieWnd");
// myMCL.loadClip(_root.mcMovDesc.largeFile, "mcMovieWnd");

I appreciate any help.

thanks,

John
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros