7 Replies Latest reply on Feb 18, 2007 2:40 PM by kglad

    LoadMovie Action

    dijonadobe
      Please can someone help me conform my loaded .swf from an external hosted site.
      The movie loads but it isn't conforming to location and size property values.
      I've input the correct URL, level and I'm using the GET variable to dynamically conform the
      new loaded movie from the hosted site. Please someone tell what I'm missing.
      Thank you.
        • 1. Re: LoadMovie Action
          kglad Adobe Community Professional & MVP
          you must wait until loading is complete before trying to control _width and _height properties.

          use preloader code or the onLoadInit() method of the moviecliploader class.
          • 2. Re: LoadMovie Action
            NeoAI23
            I'm trying to create a very simple YouTube video switcher, so YouTube movies are the SWF files I'm loading into a script-created movieClip. The Flash movie I'm creating, as enforced by the HTML it's embedded in, has a Stage that is larger than the normal embedded YouTube movie. I don't want the YouTube movie to scale at all, and instead be normal sized, but I need a larger stage for thumbnails and selecting different YouTube videos to load.

            Frame 1 Layer 1 of my timeline creates the movieClip and a loader then loads a YouTube movie into the mc, but I cannot get the embedded YouTube movie to resize using onLoadInit()

            var loader:MovieClipLoader = new MovieClipLoader();
            loader.addListener(this);

            function onLoadInit(_mc:MovieClip) {
            v_mc._width = 425;
            v_mc._height = 350;
            };

            function init() {
            createEmptyMovieClip("v_mc", getNextHighestDepth());
            v_mc._lockroot = true;
            v_mc._x = 10;
            v_mc._y = 10;

            loader.loadClip(" http://www.youtube.com/v/JzqumbhfxRo", v_mc);
            }

            init();


            If I create a button to resize the clip when pressed, it does the resize but is not positioned correctly. Also, the _xscale / _yscale is not 100% resizing this way, and the video controls in the YouTube SWF are the wrong size now.

            The HTML for embedding a YouTube movie yeilds the correct result on its own:
            <object width="425" height="350"><param name="movie" value=" http://www.youtube.com/v/JzqumbhfxRo"></param><param name="wmode" value="transparent"></param><embed src=" http://www.youtube.com/v/JzqumbhfxRo" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>

            How can I get the same result I would in a web page when I load an external SWF into my Flash movie? Isn't there any way to limit the size of the movieClip before an external SWF is loaded into it? Why doesn't a resize in onLoadInit() work for all movies?

            Thanks in advance for your advice.
            • 3. Re: LoadMovie Action
              kglad Adobe Community Professional & MVP
              there are youtube settings that adjust the videos size to the embed object size. when you load into a swf, that's going to be the _level0 stage size.

              to remedy, you must wait until the youtube resize finishes before you resize:

              • 4. Re: LoadMovie Action
                NeoAI23 Level 1
                Thank you for your help! The resize works on it's own and I've learned about setInterval()

                Here's what I'm presently confused by:
                The YouTube container movieClip (v_mc) _xscale / _yscale is based on the ( _level0 ) stage size, and resizing v_mc implicitly means a lower _xscale / _yscale - the result is that the YouTube watermark and video controls that accompany the video are smaller after a resize than when the video is embedded into a webpage at the correct size. IE, the YouTube movie code to resize to the embed object size changes the porportion of the movie elements. Additionally, for whatever reason under these conditions after the resize the movie is higher and to the left of where it should be: there's an offset for correct positioning and I don't know how to correct for it except by trial and error.

                Here's something interesting to me: some testing and I've discovered that _xscale / _yscale stay the same (or are inherit) when a file is loaded into a movieClip. So by setting the _xscale / _yscale before loading the YouTube clip it will already fit within the bounds I'd like (after I figure out the right scale to use) -- similarly the scaling problem with the clips various elements remains, as does the positioning problem.

                Again I'm curious why I can't determine what the stage size is that the YouTube movie sees as it's loaded. An HTML document can set it, but a flash movie can't? Why would it be any different? Well darn...

                Something else interesting to me: when I debug my movie I can see that the YouTube movie has a movieClip called Tube that contains the controller / movie / watermark movieClips. What I tried was resizing v_mc.tube and that works perfectly as far as it can be run in onLoadInit() with no interval needed, the video is then sized correctly, and the video is correctly positioned. The big problem with this is it works when using flash "Test Moive" or "Debug Movie" but not from the web server (because of YouTube movie protections?) and the base scaling problem still exists where the controller et al are not correctly porportioned.

                Any other clues for me?
                • 5. Re: LoadMovie Action
                  kglad Adobe Community Professional & MVP
                  the correct _xscale is your swf's 42500/Stage.width and the _yscale is 35000/Stage.height.
                  • 6. Re: LoadMovie Action
                    NeoAI23 Level 1
                    thank you for your help.
                    • 7. Re: LoadMovie Action
                      kglad Adobe Community Professional & MVP
                      you're welcome.