Skip navigation
Currently Being Moderated

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

Jul 15, 2010 6:23 AM

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

 
Replies
  • Currently Being Moderated
    Jul 15, 2010 6:33 AM   in reply to TK_72

    Did you create the link in Flash or InDesign?

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 15, 2010 6:56 AM   in reply to TK_72

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 15, 2010 7:15 AM   in reply to TK_72

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 15, 2010 7:37 AM   in reply to TK_72

    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?

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 15, 2010 7:44 AM   in reply to TK_72

    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.)

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 15, 2010 8:03 AM   in reply to TK_72

    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.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points