A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: [F8] Open url in new window from link in swf

  1. #1
    Junior Member
    Join Date
    Jan 2008
    Posts
    11

    [F8] Open url in new window from link in swf

    Hi, please help.

    I created a link menu in flash and want to have the flash button on press:
    1)open up a new html page in the same browser window, and
    2) Open an external link in a new browser window.

    Can't figure out why what I'm doing doesn't work. When I test the swf file, it works but from the html page where swf is embedded, no reaction whatsoever.

    I tried three different ways:

    on(press){
    getURL("http:www.regency.org", "_blank");
    }

    on(press){
    var myURL:String = "http://www.regency.org";
    getURL("javascriptpenNewWindow('" + String(myURL) + "');");
    }

    And the following javaScript: this in fla:

    on(press){
    getURL("javaScriptpenWin('http://www.regency.org',750,650)");
    }

    along with this in html page:

    <script language = "JavaScript">
    function openWin(sURL, iWidth, iHeight) {
    var n=open(sURL,'0','width=' + iWidth + ',height=' + iHeight + ',menubar=no,status=1,scrollbars=yes');
    }
    </script>

    Nothing works in browser. But opens quite well from swf.

    Help please!

  2. #2

  3. #3
    Junior Member
    Join Date
    Jan 2008
    Posts
    11
    Thanks for the ponter, but unfortunately didn't work. Any other ideas?

  4. #4

  5. #5
    Junior Member
    Join Date
    Jan 2008
    Posts
    11
    It's not live, I'm afraid. I freelance from home and have no way
    (that I know of) of testing it until I hand over site to web hosts.

  6. #6
    Junior Member
    Join Date
    Jan 2008
    Posts
    11
    Not live, unfortunately.

  7. #7
    AS3 Mod
    Join Date
    Sep 2007
    Location
    O-H-I-O
    Posts
    2,385
    Well I would say it should work online since flash has different security with local browser settings vs online.

    There is no reason your code shouldn't work.

  8. #8
    Junior Member
    Join Date
    Jan 2008
    Posts
    11
    Excellent, thanks :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center