Results 1 to 6 of 6

Thread: Opening links in new window

  1. #1
    Join Date
    May 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Opening links in new window

    Hi, I have found a script that enables me to open my links from a button in flash to a new chromeless window. My question is...what if I have several buttons all going to other urls. Does anyone know how to do this?? thanks heaps.

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    I'm not sure I understand what you're trying to do. Do you want to open a new window for each of those links?

  3. #3
    Join Date
    May 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Medyman View Post
    I'm not sure I understand what you're trying to do. Do you want to open a new window for each of those links?
    This is the code i found
    function Launch(page) {
    OpenWin = this.open(page, "My HomePage", "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=yes,width=550,height=250");
    }
    I have put the appropriate actionscript into flash. But what if i had several buttons on my flash page that all led to different url's and I wanted them to open in chromeless windows.
    Sorry this may seem like a complicated way to explain. I'm obviously a novice trying to do weird things!!!

  4. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Assuming that you've written your ActionScript correctly, you would just pass a new URL to the Launch() function.

    The page paramater of the launch function would be the URL of the page you're opening. So, if you have multiple buttons you can call them as such:

    Code:
    button1.onRelease = function() {
       page = "http://www.google.com";
       Launch(page);
    }
    button2.onRelease = function() {
       page = "http://www.dynamicdrive.com";
       Launch(page);
    }
    You are using AS2, right?

  5. The Following User Says Thank You to Medyman For This Useful Post:

    maebeeso (05-29-2008)

  6. #5
    Join Date
    May 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Okay now I am totally confused. You have given me what looks like a very simple explaination and I still don't get it. I have used the getURL in actionascript 2 on my button and the above script in my html. Where am I putting what you have just given me and should I just forget the whole idea and open in a blank window!!! ?>@#

  7. #6
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Ahh, no wonder you didn't post the ActionScript. I was going to ask you what you were using to link the buttons via ActionScript.

    The code I provided above is all ActionScript. It belongs in Flash. I was assuming that you had turned that Launch() function into an AS function.

    You could add that JavaScript (the code you posted) into your HTML and via the External API in Flash, control which buttons show up to which page. But that's a totally unnecessary and overly complicate route to take.

    Instead you could, as I had wrongly assumed that you had done, convert the javascript into ActionScript. Perhaps with something like this:

    Code:
    function Launch(page) {
    	getURL ("javascript:NewWindow=window.open('" + page + "','newWindow','width=500,height=350,left=0,top=0,toolbar=No,location=No,scrollbars=No,status=No,resizable=Yes,fullscreen=No');  NewWindow.focus(); void(0);");
    }
    Then you'll be able to use the code that I previously posted within the Flash file and it should all work well. Again, all the code that I'm posting should be within Flash.

Bookmarks

Posting Permissions

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