6 Replies Latest reply on May 19, 2014 1:04 AM by JohanGrip

    Play a movie in Flash CC

    JohanGrip

      Hi. I'm a beginner in Flash and english is not my native language, but i hope you can understand my question.

       

      I'm trying to create an iPhone app using flash. I have made a flash file containing two scenes. In the first scene there is a button, when you press it you go to the second scene. So far I manage to do it.

      When you come to the second scene I want a movie to start playing automatically and when the movie ends you automatically go back to the first scene. This part I cant figure out how to do!?

       

      Also I'm not sure what's the best way to make the movie. I would preffer to make it in Final Cut Pro or Premiere (programs that I am familiar with) but can I export a file that works for this purpose? I DO NOT want a video skin were you can change volume and paus and so on.

       

      All help is appreciated. Thank you!

        • 1. Re: Play a movie in Flash CC
          kglad Adobe Community Professional & MVP

          you can use any adobe product that creates and flv or f4v or mp4.  those can be played in flash using an flvplayback component.  you can select no skin for your component to meet your needs.

          1 person found this helpful
          • 2. Re: Play a movie in Flash CC
            JohanGrip Level 1

            Ok thank you for the answer.

            Do you (or someone else here) know what the action script code is to 1. make the video play automatically when you come to the second scene and 2. when the video has finished playing you automatically go back to the first scene?

            • 3. Re: Play a movie in Flash CC
              kglad Adobe Community Professional & MVP

              just navigate to your second scene in the ide, click file>import>video and select the options to play your video in an flvplayback component.

               

              once you navigate to your flv/f4v (which should be moved to the directory with your iphone file, or a subdirectory) and click all the ok/yes, you'll see an flvplayback component on stage in screne 2.  click it (to select it), in the properties panel assign an instance name (eg, flv_pb) and if a skin was used, select none from the flvplayback properties.  then click an empty part of the stage or back stage to de-select it and, in the actions panel use:

               

              flv_pb.autoPlay=true;

              flv_pb.addEventListener(Event.COMPLETE,completeF);

              function completeF(e:Event):void{

              gotoAndStop(1,"Scene 1"); //<-- use your desired frame number and your scene name and use gotoAndPlay, if that's what you want

              }

               

              p.s. when you publish your iphone app make sure you include your flv/f4v in the included files panel in the publish settings.  and if you decide to use an flvplayback skin, add it there too.

              • 4. Re: Play a movie in Flash CC
                JohanGrip Level 1

                Works like a charm! Thank you so much for your help!

                • 5. Re: Play a movie in Flash CC
                  kglad Adobe Community Professional & MVP

                  you're welcome.

                  • 6. Re: Play a movie in Flash CC
                    JohanGrip Level 1

                    I have encountered another problem. I wanted to add another movie to the same file. I created a scene 3 and placed it there. But there are a few things that confuses me:

                     

                    1. The second movie that I import replaces the first in the library!? BUT, when I publish the file both movies are there and work just fine, even though they have the same instance name!?! This is not really a problem as long as it works, but it seems weird (also, I will add more movies soon and afraid it will go wrong then!?)

                     

                    2. I used the exact same code (including same instance name) for the movie in scene 3 as the one in scene 2, and it works. But the code for going back to scene 1 when the movie has finished playing doesn't work. How do I get this code to work for scene 3 aswell?