9 Replies Latest reply: May 27, 2012 1:18 PM by Mihkeldesign RSS

    help me out guys

    Mihkeldesign

      So i am trying to make a flashbook like this one here -> http://arendus.mihkeldesign.com/flashbook/flashmaster.html .  Only I want to have 5 videos in there. So I added my 5 videos and added some more stop functions for every video, so they wouldnt start playing as soons as you open the videobook. But right now they start all playing at the same time when you open and, the prev and next button arent working either anymore. I get this error in output.

       

      TypeError: Error #1009: Cannot access a property or method of a null object reference.

          at mayabasics_fla::MainTimeline/frame5()

       

      Here'd the folder the stuff is in. http://i49.tinypic.com/zn530j.jpg

      Here's the layers & stuff.  http://i46.tinypic.com/vmszlf.jpg

      And here's the code.

       

       

      import flash.events.MouseEvent;

       

      /* Stop a Movie Clip

      Stops the specified movie clip on stage.

       

      Instructions:

      1. Use this code for movie clips that are currently playing.

      */

       

      movie1.stop();

      movie1.stop();

       

      movie2.stop();

      movie2.stop();

       

      movie3.stop();

      movie3.stop();

       

      movie4.stop();

      movie4.stop();

       

      movie5.stop();

      movie5.stop();

       

      stop()

       

      btn1.addEventListener(MouseEvent.CLICK,backward);

      btn2.addEventListener(MouseEvent.CLICK,forward);

       

      function forward(event:MouseEvent){

                                         if(this.currentFrame == this.totalFrames){

                                         gotoAndStop(1);

                                                         }

                                         else{

                                              nextFrame();

                                          }

                                          }

                                        

                                         function backward(event:MouseEvent){

                                         if(this.currentFrame == 1){

                                         gotoAndStop(this.totalFrames);

                                                          }

                                         else{

                                              prevFrame();

                                              }

                                         }

       

      All help is appreciated!!

        • 1. Re: help me out guys
          Ned Murphy CommunityMVP

          The 1009 error indicates that one of the objects being targeted by your code is out of scope.  This could mean that the object....

           

          - is declared but not instantiated

          - doesn't have an instance name (or the instance name is mispelled)

          - does not exist in the frame where that code is trying to talk to it

          - is animated into place but is not assigned instance names in every keyframe for it

          - is one of two or more consecutive keyframes of the same objects with no name assigned in the preceding frame(s).

           

          If you go into your Publish Settings Flash section and select the option to Permit debugging, your error message should have a line number following the frame number which will help you isolate which object is involved.

          • 2. Re: help me out guys
            Mihkeldesign Community Member

            at mayabasics_fla::MainTimeline/frame5()[mayabasics_fla.MainTimeline::frame5:13]  - Does the 13 mean anything? Instance names seem fine.

            • 3. Re: help me out guys
              Ned Murphy CommunityMVP

              If that is the first occurence of a " : # " after a frame number, then it is telling you line 13 is where the problem is.

               

              If you put traces of the instance names involved before that line you should be able to see which is coming up null, either by the trace showing null or the error indicating the line.

              • 4. Re: help me out guys
                Mihkeldesign Community Member

                Thanks for advice, looks like one the problem(s) is in the actionscript.

                In this part:

                 

                import flash.events.MouseEvent;

                 

                stop();

                 

                movie1.stop();

                movie1.stop();

                 

                movie2.stop();

                movie2.stop();

                 

                Im again using only 2 videos and frames to figure out the problem. It is not stopping the videos when I open it.

                 

                If i have just stop(); then it stops atleast the other video, but always the one you just moved to starts playing.

                 

                movie1.stop();

                movie1.stop();   should stop the movie1 from starting to play the second I open it, but doesnt seem to anymore. Tho it's still a movieclip and has an instance name movie1.

                 

                movie2.stop();

                movie2.stop();  If I add this then the prev and next button stop working and both videos play at the same time, one is just on background i cant see but i can hear.

                • 5. Re: help me out guys
                  Mihkeldesign Community Member

                  Anyone know a better way or a code how to stop a video that is automatically starting to play??

                  • 6. Re: help me out guys
                    Ned Murphy CommunityMVP

                    How have you implemented these videos?  Are you using the FLVPlayback component?

                    • 7. Re: help me out guys
                      Mihkeldesign Community Member

                      Yeah, specifically using the skin SkinOverPlaySeekFullscreen. The other one that worked nicely was using another skin.

                      • 8. Re: help me out guys
                        Ned Murphy CommunityMVP

                        You should be able to set the ' autoplay ' property to false in the Properties panel.

                        • 9. Re: help me out guys
                          Mihkeldesign Community Member

                          Man, you are awesome!:)