12 Replies Latest reply on Apr 8, 2009 10:25 AM by stusicci

    Creating links to movie clip frames

    Level 1

      Hello All,

      I have a page that's separated into two areas, one with links for services (Link1-8), one for descriptions to those services (Scroll_Page), with a default description, before a link is clicked. I'd like to have each link change the description area to an overview of that specific service. I'm not sure how to create these internal links.


      Currently, I have the frames set up, but I don't know how to connect the link with the frame of the movie clip. I've tried using this to connect them, but it only opens up a browser window saying it can't find "undefined":

       

      link1.onRelease=function(){
      this._parent.gotoAndStop(this.name);
      }

       

      I don't know how to tell it to link to Frame 2 in the "Scroll_Page" clip (yes, Link1 should link to Frame 2, Link2 to Frame 3, etc.).

       

      I wish I could attach the .fla so someone could actually look at it -- I'm afraid I'm not being very clear. I have attached the .swf from a test preview, but I don't know that it'll be much help. If you'd like to look at the .fla,let me know and I can email it to you.

      Any help would be greatly appreciated. Please let me know if any more info is needed.

      Thanks,

      Phillip

        • 1. Re: Creating links to movie clip frames
          kglad Adobe Community Professional & MVP

          you have timeline labels that match your link instance names?  ie, "link1" etc?

          • 2. Re: Creating links to movie clip frames
            Level 1

            Uh, I'm not sure...

             

            By timetable labels, do you mean layers? If so, then no.

             

            *EDIT* Actually, I do have layers for each link.

             

            Here's a few screenshots of what I'm looking at. Let me know if you'd like to see anything else.

             

            Thanks for your help, I really appreciate it.

            • 3. Re: Creating links to movie clip frames
              kglad Adobe Community Professional & MVP

              is "exterior/interior renderings" a movieclip with instance name link1?

              • 4. Re: Creating links to movie clip frames
                Level 1

                Yes it is.

                 

                It (they) was previously a link to an external website. I deleted that, added the ActionScript as described above, then added 8 keyframes to the "Scrolling_Page" clip, one for each of the links.

                • 5. Re: Creating links to movie clip frames
                  kglad Adobe Community Professional & MVP

                  var tl:MovieClip=this;

                  for(var i=1;i<=8;i++){

                  tl["link"+i].ivar=i;

                  tl["link"+i].onRelease=function(){

                  Scrolling_page.gotoAndStop(this.ivar);

                  }

                  }

                  • 6. Re: Creating links to movie clip frames
                    Level 1

                    Sorry, I couldn't get it to werk. Firefox stills pops up with the undefined/"Page Load Error". I really wish you could post .fla files. I really thought the official Flash forum would allow that. Is there some security reason they don't? Can you request that? Anyways, I've posted exactly what I have below. If you need more, or a screenshot, just let me know. Thanks.

                     

                    Under "Link1", Frame 1 (the link for interior/exterior renderings", I've put

                    stop();

                    and

                    var tl:MovieClip=this;

                     

                    for(var i=1;i<=8;i++){

                     

                    tl["link"+i].ivar=i;

                     

                    tl["link"+i].onRelease=function(){

                     

                    Scrolling_page.gotoAndStop(this.ivar);

                     

                    }

                     

                    }

                    for Frame2.

                     

                    I also tried it with

                    stop();

                    in the second frame and your code in the first.

                     

                     

                    I should also mention that I have

                    stop();

                    under "Scrolling_Page" (the area that contains the content of the links). I did this to keep it from animating at the beginning.

                     

                     

                     

                    I apologize for all the hand-holding; I have almost no knowledge in Flash, just DW. I do appreciate your patience.

                     

                    Thanks Again,

                     

                    Phillip

                    • 7. Re: Creating links to movie clip frames
                      kglad Adobe Community Professional & MVP

                      the code i gave will work if:

                       

                      1.  Scrolling_Page is the instance name of the movieclip you want to control.  (ie, you click on the movieclip that should go to it's frame 1,  oops, i need to change that code so link1 directs Scrolling_Page to its frame 2, and it says Scrolling_Page in the properties panel)

                       

                      2.  you click on interior/exterior renderings and you see link1 in the properties panel.   and that code should be:

                       

                       

                      var tl:MovieClip=this;

                      for(var i=1;i<=8;i++){

                      tl["link"+i].ivar=i;

                      tl["link"+i].onRelease=function(){

                      Scrolling_page.gotoAndStop(this.ivar+1);

                      }

                      }

                      • 8. Re: Creating links to movie clip frames
                        Level 1

                        I gave it a whirl and still no-go. Yeah, the link is not a part of "Scroll_Page" (or vice-versa). I assumed I replace "link" with each link's name ("Link1", "Link2", etc.), right? It tried it both ways. Can you think of anything else? I'm at a total loss. If you'd like to take a look at it, I've placed it on my ftp here.

                         

                        Thanks for your help,

                         

                        -p

                        • 9. Re: Creating links to movie clip frames
                          kglad Adobe Community Professional & MVP

                          nothing should be changed in the code i posted.  it encodes 8 movieclip buttons:  link1, link2, ...,link8.

                          • 10. Re: Creating links to movie clip frames
                            kglad Adobe Community Professional & MVP

                            oops,

                             

                            Scrolling_page in my code should be Scrolling_Page.

                            • 11. Re: Creating links to movie clip frames
                              Level 1

                              I pasted the code, but I get two similar errors: "Statement must appear within on/onClipEvent handler". One for Line1 and one for Line2.

                               

                              I clicked once on "Interior/Exterior Renderings", then hit F9, then pasted the code. It said "Instance of Link1" in the properties panel, but it looks like it just put it in the Scene 1 area. I tried it by double-clicking the "Interior/Exterior Renderings" link, and got inside of that, but it still gave me the same error.

                               

                              What am I doing wrong?!?! Ack!

                               

                              This is frustrating, but thank you very much for your help -- we're going on two days now. Thank you.

                              • 12. Re: Creating links to movie clip frames
                                Level 1

                                I've messed around and figured out a few of the things I was doing wrong. I have figured out how to create instances (easy enough once someone shows you), so I've created instances for all applicable items (Scrolling_Page, Link1, Link2, etc). I've placed your code in each instance of the "Link" clips. It still opens up a browser with an unknown page and gives me the "on/onClipEvent Handler" error.

                                 

                                Thanks for any help you can offer,

                                 

                                -p