dcsimg
A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: javascript popup not working

  1. #1
    Junior Member
    Join Date
    Aug 2002
    Posts
    10
    hi i am trying to do a popup from a button on the page, and its not working

    i have tried with loads of different popup codes gathered from the net and none of them work -

    this is my current one:

    i have this in the head tags of the html page:

    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function NewWindow(url, windowName, w, h, scroll) {
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl +' --
    -- ,scrollbars='+scroll+',resizable';
    win = window.open(url, windowName, winprops);
    if (parseInt(navigator.appVersion) >= 4) {
    win.window.focus();
    }
    }
    // -->
    </SCRIPT>

    and then in flash, i make a button press ctrl+alt+a click on get url and put this code in:

    on (release) {
    getURL("javascript:NewWindow('http://www.flashpro.nl','name','400','400','yes')");
    }

    when i export and test it, nothing happens when i click the link

    can anyone help ?

  2. #2
    GAME ON!!!! megatoon's Avatar
    Join Date
    Jun 2001
    Location
    The Lonely End of the Rink
    Posts
    3,481
    Just use this generator:
    http://www.flash-db.com/PopUp/

    Fill out what ever you need in the fileds. Then paste the code into the get url of the button. Don't worry about any of the HTMl stuff.

  3. #3
    Junior Member
    Join Date
    Aug 2002
    Posts
    10
    thats great, thanks

  4. #4
    thats what ive been trying to use, but for some reason i get two windows????
    How do i change it for MX?

  5. #5
    Member
    Join Date
    Feb 2002
    Location
    ST PAUL
    Posts
    31
    I tried using this code from the generator and it worked in Netscape 4 and IE 5, but it didn't work in IE 4.5. Does that make sense?



  6. #6
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    Originally posted by wastethebunny
    hi i am trying to do a popup from a button on the page, and its not working

    i have tried with loads of different popup codes gathered from the net and none of them work -

    this is my current one:

    i have this in the head tags of the html page:

    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function NewWindow(url, windowName, w, h, scroll) {
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl +' --
    -- ,scrollbars='+scroll+',resizable';
    win = window.open(url, windowName, winprops);
    if (parseInt(navigator.appVersion) >= 4) {
    win.window.focus();
    }
    }
    // -->
    </SCRIPT>

    and then in flash, i make a button press ctrl+alt+a click on get url and put this code in:

    on (release) {
    getURL("javascript:NewWindow('http://www.flashpro.nl','name','400','400','yes')");
    }

    when i export and test it, nothing happens when i click the link

    can anyone help ?
    what are the -- bits in the code for?
    if I delete those from the function and then test it, the window opens fine in IE 5.5 and netscape 4.7.

  7. #7
    Junior Member
    Join Date
    Aug 2002
    Posts
    10
    ah, yeah, in the original code there were also some -- in the link part of the code

    its working now anyway

    cheers

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