5 Replies Latest reply on Aug 24, 2009 7:09 PM by Rothrock

    Using loadMovie command...  sizing?


      on (press){


      As shown in the example... I have entered an action to load a movie when I press a button.  It works fine but the original swf was made at 800 by 600 when I need it to be 400 by 200.  Is there a way to have the video loaded smaller using some kind of width and height line to the command above?  I don't want to have to go redue the swf I am loading in...


      In the swf, I am working on this for class, so It is not finished or have any real sense to it, other than what is required by the teacher.  If you press the button under the Home button.. sorry, it's not marked.. You will see how the movie is too big for the content window.





        • 1. Re: Using loadMovie command...  sizing?
          Ned Murphy Adobe Community Professional & MVP

          If you load the movie into another movieclip you can use that movieclip's instance name to command the loaded swf's properties.  You will have a couple obstacles to overcome though.


          The first being the 800x600 doesn't fit proportionally into 400x200.  You can force it, but it's gonna look a bit squarshed unless that wouldn't matter..


          Another aspect you'll have to deal with is waiting for the movie to load before you try to resize it.  loadMovie is not the best way to load a movie when you need to know when it's loaded before taking action.  YOu will want to look into using the MovieClipLoader.loadClip() method instead since that class supports having ;isteners that will allow you to detect when the movie is finished loading.

          1 person found this helpful
          • 2. Re: Using loadMovie command...  sizing?
            londel26 Level 1

            Thank you for answering.. I had one other forum response as well.


            What I found.  You are so correct in the loading procedure.. but, this is what our teacher wants us to use... But, From the other forum, I got the solution.


            have the swf load on the    on (press)


            have the swf resize on the    on (release)


            It's choppy, kinda... But it works for the class sake...


            Thanks so much for the quick help.


            Much Appreciated.



            • 3. Re: Using loadMovie command...  sizing?
              Ned Murphy Adobe Community Professional & MVP

              That's not a solution.  It will fail in a real world scenario.  But if your teacher insists on it, go for it.

              • 4. Re: Using loadMovie command...  sizing?
                londel26 Level 1

                Yeah, that is the fun of being in a classroom situation, and we have to use what was given from our assignments.  So,  yah, I kinda figued what we were doing was outdated, it's ok though.  But, luckily, I see here is a great resourse for when real world situations come.  And, Hope to join some more advanced classes.


                Thank you again



                • 5. Re: Using loadMovie command...  sizing?
                  Rothrock Level 5

                  Don't know what kind of classroom situation this is, but if you paid money for this eduction I would suggest you ask for your money back!


                  As stated having the resizing code on the release is NOT a solution that will work except for the luckiest of local tests.


                  Additionally, no one should be using the on(event) style of coding unless they must publish to Flash 5 or earlier. That style of coding really went out when Flash 6 was released in 2001. Here is a great article about why not to use it.




                  Really you should use the MovieClipLoader class because it is so easy and does, exactly what you need. But if you are required to use loadMovie, then you need to make some preloader code that will check if the clip is completely loaded and if it is, then resize.


                  Doing so with on(event) style of coding is going to be really difficult and I'm far too lazy to type it all up for you. But if you really need it I could help.