9 Replies Latest reply: Jul 15, 2010 8:03 AM by markerline RSS

    open a URL link in the same window as SWF file in indesign CS5

    TK_72

      Hello,

       

      I am trying to create a SWF file using indesign CS5.  I have created buttons and placed in URL links but they always open another window.  I would like to know if there is a way to have the URL open in the same window that the SWF file has been created.  I tried, putting "_self" to target it in the URL bar, but nothing works.

       

      Thanks in advance

      TK

        • 1. Re: open a URL link in the same window as SWF file in indesign CS5
          markerline Community Member

          Did you create the link in Flash or InDesign?

          • 2. Re: open a URL link in the same window as SWF file in indesign CS5
            TK_72 Community Member

            I created everything (including the link) in indesign because I don't know flash at all.  Is there a work around if I export it to flash or something?

            • 3. Re: open a URL link in the same window as SWF file in indesign CS5
              markerline Community Member

              Well, for troubleshooting purposes you might try to design the link in Flash to see how it works.  It would be done in ActionScript 3.0 .  You can export your InDesign file to Flash Pro via XFL (I think that's the extension) and then work in Flash Pro--use the help documentation to get the link syntax.

              • 4. Re: open a URL link in the same window as SWF file in indesign CS5
                TK_72 Community Member

                Like I said I know nothing about flash and when I bring the exported file to flash I can't even find where the links are located within the document.  I also don't have the ability to select each individual item in flash... it seems like its one big graphic all of a sudden.  I was hoping there was a setting or something I could add to the link in indesign to accomplish this.  Thats why I bought cs5 was to create little flash bits since I know nothing about flash but its frustrating to have 17 windows open if I were to create a menu system through indesign.

                • 5. Re: open a URL link in the same window as SWF file in indesign CS5
                  markerline Community Member

                  Each page of the InDesign file will reside on its own frame in Flash Pro.  You don't have to have different windows open simultaneously--just one.  In Flash, look for the TimeLine panel and you will see rectangles with black dots inside indicating the frame has data.  if the dots are empty circles then there is no data on that frame.  (Sometimes though there is a bug in Flash which displays data-containing frames as empty ones).  But if you click on that frame and see there is something on the stage then you will see where your link is.  It will be on the frame number corresponding to your InDesign page where the link is there.

                  • 6. Re: open a URL link in the same window as SWF file in indesign CS5
                    markerline Community Member

                    Sorry.  I'm troubleshooting the steps between InDesign and Flash and the Flash code is a bit involved.  I will try to get it working for you but it involves something called "navigateToURL" which takes a "_self" argument or "_blank" or other argument optionally.  I don't know how to apply a "_self" argument to a URL in InDesign--can you explain?

                    • 7. Re: open a URL link in the same window as SWF file in indesign CS5
                      TK_72 Community Member

                      Thats what I'm asking! ha ha! I was wondering if there was a way to put that argument in the URL in indesign but I can't seem to find it in a setting or anything. Also I tried placing something like that in the link bar in indesign and nothing seems to work right.  Thats why I posted here to see if I was missing something.

                      • 8. Re: open a URL link in the same window as SWF file in indesign CS5
                        markerline Community Member

                        Ok, that's why I thought taking it to Flash would solve the problem.  Which it will.  I'm just not that experienced in Actionsript 3.0 .  It's a bit involved but I know that it can work.  (I will be taking a Flash class coming up in the Fall so I would be better equipped to help you in the future--as for now I am referring to books.)

                        • 9. Re: open a URL link in the same window as SWF file in indesign CS5
                          markerline Community Member

                          Okay, I found the code but I can't get it to work locally.  If you have a web server maybe you can upload the files (swf and html) after you Publish them:

                           

                           

                          import flash.net.URLRequest;
                          import flash.events.MouseEvent;

                          var myURL:URLRequest = new URLRequest ("http://www.google.com");
                          testlink.addEventListener(MouseEvent.CLICK, clickText);
                          function clickText(myevent:MouseEvent):void {
                          navigateToURL(myURL, "_self");
                          }

                           

                          you have to have on the stage a link element called "testlink" (see the code above) which would be a Movie Clip with the label testlink.  It can be anything from InDesign:  a button, a rectangle, a circle, a graphic, you get the idea.  Just select that object in Flash and label it testlink or anything you choose but if you change the name from testlink also change the name in the code snippet where the line "addEventListener" is.