A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Multiple JavaScript Pop Up Window Problem

  1. #1

    Multiple JavaScript Pop Up Window Problem

    Hello,
    I have a problem with multiple javascripts on one html page. I have one (multiple) javaScript opening the page fullscreen which works fine, but does not allow the second openWindow function to work when being called from flash. I know the pop up works because I tested it independently, and it worked fine. Can someone help me out, or lead me in the right direction. All code is below Thanks, Jacob.

    A couple of questions: forgive my ignorance:

    1. Does the compiling of the script not allow the function to be called?
    2. Would I be better off trying to use a .js file to call the function?


    Flash Code Calling JavaScript Function:

    mpic1.onRelease = function() {
    getURL("javascriptpenWindow('http://www.mishamusic.com/pics/mpic1.htm','mynewWindow','left=80,top=180,toolbar= 0,scrollbars=0,height=700,width=481')");
    }



    Html: JavaScript:

    <script language="JavaScript">
    //Fullscreen Code
    top.window.moveTo(0,0);
    if (document.all) {
    top.window.resizeTo(screen.availWidth,screen.avail Height);
    }
    else if (document.layers||document.getElementById) {
    if (top.window.outerHeight<screen.availHeight||top.wi ndow.outerWidth<screen.availWidth){
    top.window.outerHeight = screen.availHeight;
    top.window.outerWidth = screen.availWidth;
    }
    }

    function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features);
    }

    function MM_displayStatusMsg(msgStr) { //v1.0
    status=msgStr;
    document.MM_returnValue = true;
    }

    function MM_goToURL() { //v3.0
    var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
    for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
    }

    //Function being called from Flash

    function openWindow(URL, windowName, windowFeatures){
    newWindow = window.open(URL, windowName, windowFeatures);
    }

  2. #2
    Junior Member
    Join Date
    Apr 2004
    Posts
    4

    your popup function

    i'm assuming the function at the bottom is the one that is not working.

    to get javascript to work from inside the flash video you have to use either

    fscommand(); or getURL();

    otherwise nothing will happen. Veiw the reference included with the AS editor to get the syntax.

    i hope i answered your question.

  3. #3
    Senior Bumbler
    Join Date
    Dec 2000
    Posts
    522

    Re: Multiple JavaScript Pop Up Window Problem

    It sounds like the javascript is not in the html for each of the windows you have open. Including the .js page on each new window will probably help
    Easy Popup Windows 3.0 (For MX) Easy Popup Windows 2.5.2 (For Flash 5)

    Quit hassling with javascript popup windows. Basic, centered and fullscreen! Over 150,000 users.

  4. #4
    Official FK nice guy and MOD 3PRIMATES's Avatar
    Join Date
    Apr 2002
    Location
    Portland Oregon
    Posts
    1,645
    Hi,
    you will need to rename the window for each window you want to open.
    You have mynewWindow as the window name, so when you try to open a new window with the same code, mynewWindow is used again as the target.

    You can use _blank or create a random string for each window name...

    3PRIMATES

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