dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: getURL("",""); huh, i thought this was easy?

  1. #1
    absent
    Join Date
    Aug 2000
    Location
    NB, Canada
    Posts
    155

    getURL("",""); huh, i thought this was easy?

    Hello! (it's been a while)

    i though i'd drop by to try to get this minor problem cleared up
    once and for all....

    i'm opening a new browser window from my flash, nothing special
    or hard really, and it works just fine.

    However when i click another link in the flash it opens a whole
    new window rather then targeting the already opened one. So now
    instead of 2 windows (flash and link) we have 3 (flash, link, and
    link).

    My code is just:

    on (release) {
    getURL("link.html", "win");
    }

    As well i have some dynamic text getting loaded in from outside the
    flash, it also is having the problem of constantly opening a new
    window

    The text links use HTML:

    <a href="link.html or link.jpg" traget="win">link</a>

    For the life of me i can not get these to just open one window and
    continue to use it...

    Thanks in advance for any help!
    - g

  2. #2
    Junior Member
    Join Date
    Mar 2001
    Posts
    1
    Hello...

    If you use javascript to open the window, and use the same window name everytime, the new content will use the window already open with that name. Here is an example of how you will set up the link:

    Code:
    on (release) {
    getURL("javascript:NewWindow=window.open('http://www.yourdomain.com/yourfile.html','windowName','width=100,height=100,left=100,top=100,toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No');NewWindow.focus();\r\nvoid(0);\r\n");
    }
    I have used this many times before and the results were exactly what you are looking for. So anyways, hope that helps!

  3. #3
    Major Flash Newb
    Join Date
    Sep 2003
    Location
    Melbourne, Australia
    Posts
    40
    umm, i don't think "win" is a valid target

    use "_blank" or "parent"

    "_blank" opens a new window, that is what you want

    hope that fixed your problem
    There are 10 types of people in the world, those who can read binary, and those who don't

  4. #4
    Senior Member
    Join Date
    Apr 2001
    Location
    saskatoon, canada
    Posts
    147
    dkeegh is right. If you want it to open in the same window use this:
    code:

    getURL("http://www.google.com", "_self");



    I don't know if this is bad code but this will open in the same window too.
    code:

    getURL("http://www.google.com");


  5. #5
    absent
    Join Date
    Aug 2000
    Location
    NB, Canada
    Posts
    155
    It's been a while since i've been on but i figured i should reply with this correction.

    djcordel was on the right path.

    When i called "win" it had nothing to reference like dkeegh said, "win" is not a function for a window. (eg: open a new one or open within itself)

    What i was mistaken on was thinking that by calling "win" i'd be naming this window "win" and the other links refering to "win" would know, if it's already open, to display the content in this window.

    My solution was to send my getURL(); to a .php with different content, the .php then displays the page with the content provided from the link and included this within the <head> tags.

    <script>
    <!--
    window.name="win";
    //-->
    </script>

    From then on any link refering to "win" would not open a new window, but instead display our new content in the already opened window named "win".

    Thanks for your help!
    - g

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