Skip navigation
Currently Being Moderated

Coding to move from one site to specific part of another site?

Jul 28, 2011 7:28 AM

Forgive if I am not explaining this very well- here goes. I have one major site with three other gallery sites that are related. From one of the gallery sites I need to create a button that takes you back to a specific page on the major site. Playing with the coding has not resolved the issue so appreciate any help in finding magic:

 

on (press) {
    getURL("http://www.client's main site.net","_blank");
       
}

 

gets me back to the beginning of the major site but I need to get to a certain page within the site. Is this possible? Thank you! All coding is AS2, Mac platfom, FlashCS5.

 
Replies
  • kglad
    62,219 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 28, 2011 8:28 AM   in reply to Katharine Gilbert

    if you're loading an html file, you can append a query string in flash that indicates the frame you want to play, parse the query string using javascript in the html file and use the as2 externalinterface class to retrieve that query string and find the frame that should be displayed.  finally, you must ensure that frame is loaded before executing a goto method.

     
    |
    Mark as:
  • kglad
    62,219 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 28, 2011 5:51 PM   in reply to Katharine Gilbert

    if you want to load frame 22, use:

     

    on(press){

    getURL("http://www.yoururl.com/page.html?framenum=+22","_blank");

    }

     

     

    then within the head tags of page.html in yoururl.com, use:

     

     

    <script type="text/javascript">

    function urlF(){

    return location.href;

    }

    </script>

     

     

    and in the swf that's embedded by page.html, add the following to frame 1:

     

    import flash.external.ExternalInterface;

    stop();

    trace(ExternalInterface.call("urlF"));

     

    //  upload that to your server, post the url to the flash containing the getURL() and indicate which button needs to be pressed.

     
    |
    Mark as:
  • kglad
    62,219 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 29, 2011 7:17 AM   in reply to Katharine Gilbert

    you're welcome.

     

    p.s.  to debug that, use the trace() function in the swf that's the target of the getURL().  once you confirm you're getting the full url into that swf, you can complete the coding needed.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 30, 2011 12:20 AM   in reply to kglad

    If you are using frames, just use the name of the target instead "_blank".

     

    on (press) {
        getURL("http://www.client's main site.net","content");
           
    }

     

    voila!

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 1, 2013 12:45 AM   in reply to Katharine Gilbert

    Thanks too!

    This topic save-me!

     

    Regards,

     

    Rodrigo A. Rodriguez

    Criação de Sites

     

    Message was edited by: rodrigo.rodriguez

     
    |
    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