17 Replies Latest reply on Aug 30, 2009 11:23 AM by robdillon

    Loading swf into a movieClip that sits within a movieClip that sits within a MovieClip!

    Shaneob78

      I am trying to load an swf into a movie clip (Named 'mc' which I have created using a transparent border rectangle with no fill), which sits within a movie clip on a layer of its own, which sits within another movie clip.

       

      I have been told to try:

       

      mc._lockroot = true
      mc.loadMovie("Professional Video Player V.3.swf");

       

      I attached this to frame 1 within the mc movieClip, I attached it to mc in the movieClip it sits in and even tried attaching it to the frame mc sits on - but none of them worked.

       

      I've attached a screenshot of my file with notes on what is what.

       

      Can anyone help?

        • 1. Re: Loading swf into a movieClip that sits within a movieClip that sits within a MovieClip!
          robdillon Most Valuable Participant

          Do you get an error, do you get anything in the Output window? You should change the name of the .swf to remove the spaces between words. You want the file name to be something like: ProfessionalVideoPlayerV3.swf. Is this .swf in the same folder as the movie that you are loading it into?

          • 2. Re: Loading swf into a movieClip that sits within a movieClip that sits within a MovieClip!
            Shaneob78 Level 1

            Thanks.

             

            I tried that and was told to attach the following code to the primary movieClip (Mask_):

             

            Mask_._lockroot = true;
            Mask_.Pages._lockroot = true;
            Mask_.Pages.mc._lockroot = true;
            Mask_.Pages.mc.
            loadMovie("ProfessionalVideoPlayerV.3.swf")

             

            But it just made everything in the bottom half of the page disappear.

            The bottom half of the page is where Mask_ is located and this holds all the pages and their contents on frames within 'Pages'.

             

            I'm working from the template: http://www.templatemonster.com/flash-templates/24124.html

             

            Yes, the fla is saved in the same folder as the ProfessionalVideoPlayerV.3.swf

             

            Hope you can help,

             

            Shaneo

            • 3. Re: Loading swf into a movieClip that sits within a movieClip that sits within a MovieClip!
              robdillon Most Valuable Participant

              Who is telling you to make these code changes? The template people?

               

              If your movieClip mc is located only on that one frame in your movie, then any code that refers to it must be in the same frame. Is the file ProfessionalVideoPlayerV.3.swf something that you made, or is it a file that came from somewhere else? If you made this file, is there any reference to _root anywhere in the movie? If not, then you don't need any of that _lockroot nonsense. While it will probably do no wrong to leave those calls in your movie, it should have no effect on whether the .swf loads or not.

               

              Without seeing the actual structure of this template, its difficult to visualise where the problem may be. From your description, it sounds like the lower portion of the stage area has a mask. The masked area is what is being displayed. It is possible that the mask is animated and that when you load in this new .swf, the mask is not properly positioned or sized to expose the .swf. It is possible that you are placing the new .swf into a space that is sitting behind something else that is blocking it.

               

              If you are not seeing any errors, then your .swf may be loading but is not being shown correctly.

               

              Are you adapting this template, or are you just working within its normal methods and providing your own content into the spaces provided?

              • 4. Re: Loading swf into a movieClip that sits within a movieClip that sits within a MovieClip!
                Shaneob78 Level 1

                OK, thanks Rob, sheds some light on it. 

                 

                Yes, the bottom half of the page is a mask.

                I have attached what you see when you open up each of the 2 movieClips and what you see within the one where the 'mc' sits.

                 

                The player is a file I purchased separate from the template and am trying to include with this template site.

                 

                These code instructions are coming from the player author.

                 

                I have modified the template to include my images and texts, and I also have a different video player on the home page (site can be seen here but is unfinished and is much more complete and modified on my Hard drive):

                 

                http://milanjuniorcamp.co.uk/

                 

                I see what you mean about being hidden, but nothing of the player is visible in the area of the page.

                I have opened up my 'mc' movieclip (which I created with a rectangle which has a transparent border) and moved the rectangle border to be positioned above and left of the crosshairs (so the bottom right hand corner is aligned with the North east corner of the crosshairs) instead of being below and right of them - is this correct?

                 

                But what code do I place on the same frame of the mc movieClip and do i attach the code to the frame or the movieClip?

                 

                Thanks

                • 5. Re: Loading swf into a movieClip that sits within a movieClip that sits within a MovieClip!
                  robdillon Most Valuable Participant

                  The way that your code is currently written, it should be attached to the frame, not the movieClip.

                   

                  If this video player is a different template, are you using the same version of Actionscript and saving the .swf to same player version as the first template?

                   

                  If you test the mc movieClip that you made, does it play as expected? Does it import the video player swf correctly?

                   

                  When you import a new .swf into an existing movieClip, the registration point for the imported file is at its upper left corner, regardless of any registration inside the movieClip. The imported clip's upper left corner is positioned at the registration point of the movieClip that it imports into.

                   

                  You could, temporarily, import a static jpeg image instead of the .swf, just to get the import and alignment sorted out. You could just take a screenshot to the .swf and use that for the testing.

                   

                  There were no attachments in your last message.

                  • 6. Re: Loading swf into a movieClip that sits within a movieClip that sits within a MovieClip!
                    Shaneob78 Level 1

                    Sorry Rob, attachments attached!

                     

                    I think they are both actionscript 2.0. The player is advertised as AS2: http://mmfiles.com/flash/media_players/professional_video_player_v_3_760.html

                    How can i see if the website template is?

                     

                    If I change the border of teh box within mc to a solid colour, I can see it as it should be.

                    What code should I attach to the frame to test a jpeg?

                     

                    If I go into mc and import the player swf onto the stage then only elements of it can be seen. The video content is not visible. Only the menu controls, refresh arrows, author signature and share window popup box are.

                     

                    All the elements don't exactly appear where they should do so I'm not sure whats happening with the anchor point??

                     

                    Thanks Rob

                    • 7. Re: Loading swf into a movieClip that sits within a movieClip that sits within a MovieClip!
                      Shaneob78 Level 1

                      Hi,

                       

                      Ive now done a simple mc.loadMovie("Professional Video Player V.3.swf");

                       

                      But when I do a publish preview I get this message in the compiler error window:

                       

                      (Location) Symbol=Pages, layer=Pict, frame 7, Line 1

                      (Description) Statement must appear within on/onClipEvent handler

                      • 8. Re: Loading swf into a movieClip that sits within a movieClip that sits within a MovieClip!
                        robdillon Most Valuable Participant

                        You're seeing that error because you have the actionscript attached to a movieClip, not the frame. Make sure that the Actions window says "frame action" when you write the code.

                        • 9. Re: Loading swf into a movieClip that sits within a movieClip that sits within a MovieClip!
                          robdillon Most Valuable Participant

                          From the code that you're using, the site movie is also in AS2.

                           

                          In both Mask_.jpg and Scene1.jpg, the Compiler Error tab shows that there are 17 errors. This is a LOT of problems that need to be addressed. If you look at Mcmovieclip.jpg, and look at the mc movieclip, that dot in the center is the registration point. Anything that you load into that movieClip will be placed with its upper left corner at that point.

                           

                          To load in a .jpg instead of the .swf just substitute the name of the .jpg file in the loadmovie function.

                           

                          If you test the videoplayer movie alone, does it work correctly? You can see the controls as well as the movie that you want to play inside it? I'm guessing that this videoplayer movie uses an flv player component, is that correct? In the component's Parameters window, you should have set the path to the .flv file that you want to play. Is this file in the same relative location when you try to play it from the website template movie?

                          • 10. Re: Loading swf into a movieClip that sits within a movieClip that sits within a MovieClip!
                            Shaneob78 Level 1

                            The player is an fla file which exports the swf which loads video clips into the player by XML, Is that what you mean?

                            It does work correctly when I testmovie it from its fla file. I can see the playlist thumbnails and choose which video I want, and all load and play in the player.

                             

                            Is the actionscript I am trying to use correct? I tried it attached to both the frame and movie clip but never saw the player??

                             

                            I changed the player's layer to be top of the stack of layers incase it was being hidden but this didn't work.

                             

                            All 17 errors are not to do with this though, and when I test now, there is only 3.

                             

                            Thanks

                            • 11. Re: Loading swf into a movieClip that sits within a movieClip that sits within a MovieClip!
                              Shaneob78 Level 1

                              I inserted the following actionscript onto the frame holding mc:

                               

                              mc.loadMovie(1.jpeg)

                               

                              But I can't see the image. Is that code correct?

                               

                              Thanks

                              • 12. Re: Loading swf into a movieClip that sits within a movieClip that sits within a MovieClip!
                                robdillon Most Valuable Participant

                                If you are getting errors, then these errors are probably preventing the movie from playing correctly. You will need to correct the errors first. This is why I asked if you were getting any errors in an earlier message.

                                • 13. Re: Loading swf into a movieClip that sits within a movieClip that sits within a MovieClip!
                                  Shaneob78 Level 1

                                  Hi Rob,

                                   

                                  None of the errors related to the player or mc.

                                  I have eliminated all of them now, but the player is still not visible.

                                   

                                  Any suggestions?

                                   

                                  Thanks,

                                   

                                  Shane

                                  • 14. Re: Loading swf into a movieClip that sits within a movieClip that sits within a MovieClip!
                                    Shaneob78 Level 1

                                    Hi Rob,

                                    Apologies if this is no longer of interest, but I've made some progress in seeing this video player within my page.

                                     

                                    I can now see the player and start jpeg when I do a publish preview from flash. The other elements such as playlist, 'i' and 'send to a friend' work too. However, the videos themselves do not play.

                                     

                                    But when I load this up to my site, I cannot see the player at all: www.milanjuniorcamp.co.uk (Click on videos).

                                     

                                    I know this is probably a file and folder issue, but the index.fla, video player fla and swf and video files, all reside in the same folder - so what else could it be?

                                     

                                    With regards to the actionscript, I have the following code placed on the frame which the MovieClip with loads the player sits on:

                                     

                                    mc._lockroot = true;

                                    mc.loadMovie("player.swf")

                                     

                                    I know you said this is wrong, but when I took my problem back to author of the player, they came back with this and said it worked whe they used it on my file which I sent them??

                                     

                                    Hope you can help.

                                     

                                    Thanks

                                     

                                    S

                                    • 15. Re: Loading swf into a movieClip that sits within a movieClip that sits within a MovieClip!
                                      robdillon Most Valuable Participant

                                      There's nothing intrinsically wrong with that loader code. The problem may be with the path to the movieClip mc. For this code to be correct, the movieClip mc needs to be in the same movie where the code is.

                                       

                                      If the people who made the template can make the movie work, then what is it that is different between the way that they are running the movie and the way that you are running the movie?

                                      • 16. Re: Loading swf into a movieClip that sits within a movieClip that sits within a MovieClip!
                                        Shaneob78 Level 1

                                        The template makers have sent me my file, saying that it works when they have tested it. I have asked them to upload it to a site and show me it working online.

                                         

                                        But they have now included this code on the frame where the primary MovieClip (Mask_) sits:

                                         

                                        Mask_._lockroot = true;

                                        Mask_.Pages._lockroot = true;

                                        Mask_.Pages.mc._lockroot = true;

                                        Mask_.Pages.mc.loadMovie("ProfessionalVideoPlayerV.3.swf")

                                         

                                        But its still not working. I can see the player and the start jpeg in publish preview, but no videos work and I get the following message:

                                         

                                        Adobe Flash player has stopped a potentially unsafe operation.

                                        The following local application on your computer or network:

                                        /Users/shaneob/VisionSportsMedia/SoccerSchools?Milan?...?player.swf

                                        is trying to communicate with the internet, click settings.

                                        You must restart this application after changing your settings.

                                         

                                        Could it be this at the bottom of the xml page? Should I change the URLs to mine rather than example.com??

                                         

                                        <settings>

                                        <setting swf_url="http://www.example.com/player.swf"/>

                                        <setting page_url = "http://www.example.com/page.html"/>

                                        <setting first_video_image = "thumb/start.jpg"/>

                                        </settings>

                                         

                                        Thanks,

                                         

                                        Shane

                                        • 17. Re: Loading swf into a movieClip that sits within a movieClip that sits within a MovieClip!
                                          robdillon Most Valuable Participant

                                          Yes, you will need to change the names of these files and, possibly, the path.