targeting links in flash

Discussion in 'Programming' started by mikemotorcade, Jun 27, 2007.

  1. #1
    I have a flash question.

    I have a site that uses flash for the navigation bar, and the content is in an iframe. I want to be able to click on one of the links in flash and have the iframe load the new page. basically a flash equivilent of this:

    <a href="newpage.html" target="iframe">Link</a>
    HTML:
    Does anyone know how to do this?

    Thanks in advance!
     
    mikemotorcade, Jun 27, 2007 IP
  2. ProgrammersTalk

    ProgrammersTalk Peon

    Messages:
    684
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    There's getURL on the actionscript
     
    ProgrammersTalk, Jun 27, 2007 IP
  3. mikemotorcade

    mikemotorcade Peon

    Messages:
    645
    Likes Received:
    49
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I know, I tried this

    getURL("newpage.html", "iframe")
    Code (markup):
    But it doesn't work.
     
    mikemotorcade, Jun 28, 2007 IP
  4. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #4
    in your flash call javascript that modifies the url of the iframe.

    getURL("javascript:iframeURLBounce('newpage.html')");
    Code (markup):
    then in your html, have a javascript function called iframeURLBounce

    
    function iframeURLBounce(url) {
      document.getElementById("iframeid").src = url;
    }
    
    Code (markup):
     
    ccoonen, Jun 28, 2007 IP