19 Replies Latest reply on Jun 6, 2010 11:27 AM by nvisibl

    How can I compress an Imported Movie even further?

    Comp. 792-YeIbLU

      I have a 20 second movie 230 x 129 size. The file size is 1.2 mb. I then imported it into Flash. After it's all said and done the finall SWF is 1.7 mb. I plan to put this on my homepage, but I want the file to be smaller. I reduced the flash .jpg and output settings to their lowest but the file remaied at 1.7 mb so this tells me the imported movie is causing the large file size here.

       

      Is there something I can do to make my imported movie smaller so my resulting SWF is under 1 MB.

       

      Update:

      I just compressed the QT movie to 520 kb (the old movie size was 1.2 mb) and then imported it into my Flash file, then I published the SWF and the file size was still 1.7 mb. This means the Flash SWF file with an imported movie of 1.2 MB movie is the same File size as a Flash SWF file with an imported movie size of 520 kb. This doesn't make sense to me as the SWF file size should be a lot lower.

       

      1.2 mb imported movie. SWF file size = 1.7 mb

      520 kb imported movie. SWF file size = 1.7 mb

       

      What's up with that?

        • 1. Re: How can I compress an Imported Movie even further?
          nvisibl

          i've got the same question with an SWF i'm trying to compress down from its 2.75MB

          no matter the size or whichever format my imported movie file is .mov or .avi the SWF remains 2.75MB

           

          i tried reducing the frames per second of the movie but it didn't make any difference

           

           

          can anyone advise please how to reduce this size, thank you

           

          http://www.highlandmeditation.com/?page_id=2288

          • 2. Re: How can I compress an Imported Movie even further?
            PJSB_DK Level 3

            Hi..

             

            Just a quick question...

             

            Why embed it inside the swf?? Why not stream it from server, thus keeping swf filesize small?

             

             

            Best regards

            Peter

            • 3. Re: How can I compress an Imported Movie even further?
              nvisibl Level 1

              hi peter, i'm not sure how to do that and if it would still allow me to have the clickable flash object i have there just now .. what do you think?

              http://www.highlandmeditation.com/?page_id=2288

              • 4. Re: How can I compress an Imported Movie even further?
                PJSB_DK Level 3

                Well, it should be fairly simple.

                 

                1. Menu ---> File ---> Import ---> Import video..

                 

                2. Choose "Already deployed to a web server...etc..."

                 

                3. Type in the exact url for your movie (example: http://www.webspace.com/movies/moviefile) --- >

                 

                4. Press next and select "no skinning"

                 

                Shouldn't be too much of a hazzle from this point on.

                 

                Backup your project and fiddle with it...

                 

                By doing it this way, you don't have to think of compression, even though small sizes are preferrable

                 

                Best regards

                 

                Peter

                • 5. Re: How can I compress an Imported Movie even further?
                  nvisibl Level 1

                  thanks for your time peter

                  it loads up quicker on the page......  though it doesn't loop nor hyperlink anymore..... have you an idea how i could resolve these things?

                   

                  i have this code in the actions so to make it hyperlinkeable, but it doesn't do it

                   

                  portal7.addEventListener(MouseEvent.CLICK, mcClick);

                   

                  function mcClick(evt:MouseEvent):void {

                     var url:String = "http://www.transformingscotland.com/?page_id=42";

                     var req:URLRequest = new URLRequest(url);

                     navigateToURL(req, "_self");

                  }

                   

                  • 6. Re: How can I compress an Imported Movie even further?
                    PJSB_DK Level 3

                    Hi again.

                     

                    Anytime buddy

                     

                    Well...The player have an eventListener too.

                    Try assigning the Mouse event to it.

                    f.ex. player_name.addEventListener(MouseEvent.CLICK, mcClick);

                    Concerning looping:: Try player_name.autoRewind = true;

                     

                    Best regards

                    Peter

                    • 7. Re: How can I compress an Imported Movie even further?
                      nvisibl Level 1

                      thanks peter, i'm quite the noob so very unsure

                      would you be able please to write out the code syntax so that i can copy/paste into the actions window? otherwise i'm stuck

                      • 8. Re: How can I compress an Imported Movie even further?
                        PJSB_DK Level 3


                        Try the following:

                         

                        player_name.autoRewind = true;

                         

                        //Assign mouse event listener to player. In this case MouseDown

                        player_name.addEventListener(MouseEvent.MouseDown, onMouseClick);

                         

                        player_name.addEventListener(VideoEvent.COMPLETE,onComplete);

                        //Above eventListener checks to see if playback has finished/completed
                        //So the onComplete function is called if finished

                         

                        function onComplete(e:VideoEvent):void
                        {
                            //The autoRewind will reset to first frame and stop
                            //Try one of the following below...Uncomment one at a time and try it...
                            //player_name.source = URLFILETOPLAY;  OR
                            //player_name.play();
                        }

                         

                        function onMouseClick(e:Event):void
                        {
                            //navigate to next page from here

                            trace("newUrlPage");
                        }

                         

                        Replace info as needed and test it out..The example is from memory, but i believe

                        it is usable.

                        Anyway..Getting stuck is just another curve og educational fun

                         

                        Regards

                        Peter.

                        • 9. Re: How can I compress an Imported Movie even further?
                          nvisibl Level 1

                          thanks for your time peter

                           

                          i get this when i test run the script

                           

                          Line8 :    1046: Type was not found or was not a compile-time constant: VideoEvent.

                           

                           

                           

                          this is the code i'm using:

                           

                          portal7.autoRewind = true;

                           

                          //Assign mouse event listener to player. In this case MouseDown player_name.addEventListener(MouseEvent.MouseDown, onMouseClick);

                           

                          portal7.addEventListener(VideoEvent.COMPLETE,onComplete);

                          //Above eventListener checks to see if playback has finished/completed //So the onComplete function is called if finished

                           

                          function onComplete(e:VideoEvent):void

                          {

                              //The autoRewind will reset to first frame and stop

                              //Try one of the following below...Uncomment one at a time and try it...

                              //player_name.source = URLFILETOPLAY;  OR

                              //player_name.play();

                          }

                           

                          function onMouseClick(e:Event):void

                          {

                              //navigate to next page from here

                              trace("newUrlPage");

                          }

                           

                           

                           

                           

                          i'm assuming that the player_name is the part i replace with the SWF instance name i'm using, in this case portal7

                          • 10. Re: How can I compress an Imported Movie even further?
                            PJSB_DK Level 3

                            You might need to import the video event...Like this:

                            At the top, type:

                             

                            import fl.video.VideoEvent;

                             

                            the player_name is the instance of the player itself

                             

                            Anyway, try adding the import and let me know how it goes.

                             

                            By the way: I really like your site and concept.

                             

                            Regards

                            Peter

                            • 11. Re: How can I compress an Imported Movie even further?
                              nvisibl Level 1

                              thank you x 2, much appreciated

                               

                              the movie plays okay without error now

                              still though it won't loop nor hyperlink

                              • 12. Re: How can I compress an Imported Movie even further?
                                PJSB_DK Level 3

                                Did you try a trace statement inside the onComplete() function to see

                                if the event is triggered?

                                 

                                If the onComplete event is triggered, try using these two instead...

                                 

                                 player_name.seek(0);  // <---This should position it a movie frame 0
                                player_name.play(Parameter);  <--Parameter could be the movie url.

                                About the click function:

                                The following is a workaround to the mouseClick.

                                1. Create a new layer above the video layer (Lock the video layer)
                                2. Draw a black rectangle in the new layer, so that it covers
                                   the entire video.
                                3. Convert the rectangle to a MovieClip. (Select it and Press F8).
                                4. Name it f.ex: overlay_mc
                                5. Go to the color effect property for the rectangle and
                                   select Alpha. Set the alpha value to 0

                                Now, go to you code and change :
                                     player_name.addEventListener(MouseEvent.mouseDown,onCLICK); to
                                     overlay_mc.addEventListener(MouseEvent.mouseDown,onCLICK);

                                This should take care of the click option...(As I said...A workaround )

                                Hope you'll get it working now.

                                Best regards
                                Peter
                                • 13. Re: How can I compress an Imported Movie even further?
                                  nvisibl Level 1

                                  i went through your instructions and with the trace event, thanks

                                  its looping now.. but only once and with a very noticeable gap in between

                                   

                                   

                                   

                                   

                                  import fl.video.VideoEvent;

                                   

                                   

                                  function onMouseClick(e:Event):void

                                  {

                                      //navigate to next page from here

                                      trace("http://www.transformingscotland.com/?page_id=42");

                                  }

                                   

                                   

                                   

                                   

                                   

                                  portal7.autoRewind = true;

                                   

                                  //Assign mouse event listener to player. In this case MouseDown player_name.addEventListener(MouseEvent.MouseDown, onMouseClick);

                                   

                                  portal7.addEventListener(VideoEvent.COMPLETE,onComplete);

                                  //Above eventListener checks to see if playback has finished/completed //So the onComplete function is called if finished

                                   

                                  function onComplete(e:VideoEvent):void

                                  {

                                      

                                      

                                      

                                       //The autoRewind will reset to first frame and stop

                                      //Try one of the following below...Uncomment one at a time and try it...

                                      //player_name.source = URLFILETOPLAY;  OR

                                      //player_name.play();

                                      

                                       portal7.seek(0);  // <---This should position it a movie frame 0

                                       portal7.play("http://www.transformingscotland.com/wp-content/themes/Amirra/Amirra/images/portalavi.flv");

                                      

                                  }

                                   

                                  ps - there's the ability to add fvars via the flash embed plugin that i use on the site.. (wordpress) not sure if that could be utilised for the hyperlinking?

                                  • 14. Re: How can I compress an Imported Movie even further?
                                    PJSB_DK Level 3

                                    hehe...Yep..It's aaaalll part of the learning process

                                     

                                    Try this: Now we're down to basic and I'm finally at home

                                     

                                    Keep the imports.....

                                     

                                    overlay_mc.buttonMode = true;       //<-- Show your users, that this is a clickable area
                                    overlay_mc.useHandCursor = true;  //<-- Show your users, that this is a clickable area
                                    overlay_mc.addEventListener(MouseEvent.CLICK, onMouseClick);   // You movieClip rectangle mouse click area

                                     

                                    portal7.addEventListener(VideoEvent.COMPLETE,onComplete);

                                     

                                    portal7.addEventListener(VideoEvent.COMPLETE,onComplete)

                                    portal7.source = "http://www.transformingscotland.com/wp-content/themes/Amirra/Amirra/images/porta___lavi.fl v";
                                       
                                    function onComplete(e:VideoEvent):void
                                    {
                                         //Okey dokey....Now it works...Loooooping......  

                                         portal7.play();
                                    }

                                     

                                    function onMouseClick(e:Event):void
                                    {
                                        //navigate to next page from here
                                    }

                                     

                                    Let me know how it goes...It loops from here..

                                     

                                    Best regards

                                    Peter

                                    • 15. Re: How can I compress an Imported Movie even further?
                                      nvisibl Level 1

                                      great its looping http://www.transformingscotland.com/?page_id=2288

                                       

                                      is there a way to reduce the pause in between loops?

                                      • 16. Re: How can I compress an Imported Movie even further?
                                        PJSB_DK Level 3

                                        That's a hard one..

                                         

                                        The problem with the small gap between loops are due to the reset and

                                        the fact that first frame and last frame are waaay different...I was just

                                        watching to se if it was possible to find some frames lookalike....heh!! Well I really

                                        tried

                                         

                                        Anyway you got it looping..Now all you need to do is implement

                                        the overlay_mc and activate your mouse click feature as i've explained

                                        previously and you're set to go.

                                         

                                        Best of luck with your site

                                         

                                        Peter

                                        • 17. Re: How can I compress an Imported Movie even further?
                                          nvisibl Level 1

                                          thanks for looking into it and for all your time and help !

                                           

                                           

                                           

                                          i'm doing the colour overlay part but haven't managed to change to alpha. i select the black rectangle (overlay_mc) then go to the left and click on the black coloured square and in the colour properties reduce alpha from 100 to 0, but its not affecting the rectangle. am i missing something?

                                           

                                           

                                          i looked too at the colour properties on the right and changed alpha to 0 but still the same

                                          • 18. Re: How can I compress an Imported Movie even further?
                                            PJSB_DK Level 3

                                            Hey again buddy

                                             

                                            Yep, you're missing something.

                                             

                                            1. Create a new layer above the video layer (Lock the video layer)
                                            2. Draw a black rectangle in the new layer, so that it covers
                                              the entire video area.
                                            3. Convert the rectangle to a MovieClip. (Select it and Press F8).
                                            4. Name it f.ex: overlay_mc
                                            5. Go to the color effect property for the rectangle and
                                               select Alpha. Set the alpha value to 0

                                            You're trying to change the alpha from the color swatch...
                                            When you've convertet the rectangle to a movieClip, you must
                                            give it an instance name.

                                            Select the newly made movieClip and look at your right side of
                                            your screen (Depending of your selected workspace, that is).
                                            There you'll find a property section called "Color effect"
                                            Inside the color effect, you'll find a dropdown box called "Style".

                                            Select Alpha from the dropdown and move the slider to 0.
                                            This turns the entire movieClip transparent.

                                            Now add the eventlistener as I've shown you in code like this:

                                            overlay_mc.buttonMode = true;       //<-- Show your users, that this is a clickable area
                                            overlay_mc.useHandCursor = true;  //<-- Show your users, that this is a clickable area

                                            overlay_mc.addEventListener(MouseEvent.CLICK, onMouseClick);   // Your movieClip rectangle mouse click area

                                            function onMouseClick(e:Event):void
                                            {
                                                 // Navigate....
                                            }

                                            And you're most welcome

                                            • 19. Re: How can I compress an Imported Movie even further?
                                              nvisibl Level 1

                                              got it, got it brilliant, sorted!

                                              its all working

                                               

                                              thanks man..i now understand stuff