5 Replies Latest reply: Jan 19, 2012 1:46 PM by kglad RSS

    Can I access a label inside of an MC and then go back to the main time line

    nikolaig Community Member

      Here is my current set up.

      I have a labeled section on main time line which has icons of 12 different videos. Each icon acts as a button and brings a user to a labeled section with a FLV Video Playback component impemented to play the corresponding video. These labeled sections are located on the main time.

      This methog makes my main time line very long. Is there a way to make an additional MC which will hold all the video buttons and then have this MC separated into labeled sections.

      In other words can I access a label inside of an MC and then go back to the main time line?

       

      My present code for accessing the label located on the main timeline is:

       

      HowTo_maininfo_mc.theArrangement_btn.addEventListener(MouseEvent.CLICK, theArrangement_btn_amimated_btnDown);

       

      function theArrangement_btn_amimated_btnDown(event:MouseEvent):void {

      gotoAndPlay("theArrangement");

      }

       

      How would it look if my label "theArrangement" would be located inside of an MC?

       

      Is there any specific code if I want to have a close button located on the label inside of an MC and it needs to fire out to a label located on the main timeline?

        • 1. Re: Can I access a label inside of an MC and then go back to the main time line
          kglad CommunityMVP

          you should have one frame with an  flvplayback component and have each button assign a source variable's value that's used by your component:

           

          var sourceVar:String;

          function theArrangement_btn_amimated_btnDown(event:MouseEvent):void {

          sourceVar="arrangement.flv";  // for example

          gotoAndPlay("flv_pb");

          }

           

          ///

           

          and in your "flv_pb" frame, use:

           

          yourflv_pb.source=sourceVar;  // where yourflv_pb is your component's instance name.

          • 2. Re: Can I access a label inside of an MC and then go back to the main time line
            nikolaig Community Member

            Looks like I am missing something.

            Here is my set up for my videos. I will use just two different once for an example sake.

             

            In my section where all the video icons/links are located here what I have assigned two two different buttons:

             

            BUTTON1:

            var sourceVarJTV_LampShade:String;

            function JTV_LampShade_btn_amimated_btnDown(event:MouseEvent):void {

            sourceVarJTV_LampShade="howto_popups/jtvs10w07.flv";

            gotoAndPlay("flv_pb");

            }

             

             

            BUTTON2:

            var sourceVarJTV_SubRose:String;

            function JTV_SubRose_btn_amimated_btnDown(event:MouseEvent):void {

            sourceVarJTV_SubRose="howto_popups/jtvs11w06.flv";

            gotoAndPlay("flv_pb");

            }

             

            Then in "flv_pb" frame I have this code:

             

             

            SWF_flv2.source=sourceVarJTV_LampShade;

            SWF_flv2.source=sourceVarJTV_SubRose;

             

             

             

            My FLV Playback component has an instance name of "SWF_flv2"

             

            In the component inspector dialog box I deleted the source path and it is now empty

             

            I am not sure where I went wrong.

             

            I am sure all the sourceVar have to have unique names as I was getting these errors?

            • 3. Re: Can I access a label inside of an MC and then go back to the main time line
              kglad CommunityMVP

              use the code i suggested:

               

               

              BUTTON1:

              var sourceVar:String;

              function JTV_LampShade_btn_amimated_btnDown(event:MouseEvent):void {

              sourceVar="howto_popups/jtvs10w07.flv";

              gotoAndPlay("flv_pb");

              }

               

               

              BUTTON2:

              function JTV_SubRose_btn_amimated_btnDown(event:MouseEvent):void {

              sourceVar="howto_popups/jtvs11w06.flv";

              gotoAndPlay("flv_pb");

              }

               

              //Then in "flv_pb" frame I have this code:

               

               

              SWF_flv2.source=sourceVar;

               

              • 4. Re: Can I access a label inside of an MC and then go back to the main time line
                nikolaig Community Member

                Oh, WOW! It is working perfectly now.

                My mistake was that I was specifiying the var sourceVar:String;

                for every single button. It was not clear to me from the first example that it has to be specified only once.

                I made a small test Flash file and everything works now. It still doesn't work on my big flash file, I guess some other code messes it up and I can' not figure what it is exactly.

                I would like to include the OUTPUT error message in hopes that you can spot right away what a mistake could be:

                 

                VideoError: 1000: Unable to make connection to server or to find FLV on server

                          at fl.video::VideoPlayer/stop()

                          at fl.video::FLVPlayback/stop()

                          at acolyteVideos_fla::mainsite_mc_2/stopF2()[acolyteVideos_fla.mainsite_mc_2::frame484:21]

                          at flash.display::MovieClip/gotoAndPlay()

                          at acolyteVideos_fla::mainsite_mc_2/onClick_GoBackToHowTo2()[acolyteVideos_fla.mainsite_mc_2 ::frame484:13]

                 

                If there is no immediate cure for it, I will go through code line by line. Since it is working on the test it must be something wrong with my main file.

                 

                 

                Additiona question (please let me know if I should paste it as a new thread)

                 

                I have similar set up with UILoader. Where different buttons set up to bring a user to individual labeled sections with individual UILoader. Should it be arranged in the same way that it is only one loader and "var sourceVar:String;" code is the one which brings up different content for each button?