A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Controlling the opening of a browser window w/Actionscript

  1. #1
    Junior Member
    Join Date
    Nov 2003
    Posts
    29

    Controlling the opening of a browser window w/Actionscript

    Is there way to insert code that will control the opening of a browser window within Flash using Actionscript?

    In Javascript, it would look something like this:

    window.open theURL,winName,"width=480,height=480,status=no,scr ollbars=no,res
    izable=no,menubar=no");

    Thanks in advance for your help!



  2. #2
    ActionScript Insomniac
    Join Date
    Jan 2003
    Location
    43d03.21'N, 89d23.65'W
    Posts
    1,173
    Use getURL to call your javascript code, and return void to keep from opening a new window:

    code:


    getURL('javascript:myJSFunction(); void(0)');




    Edit: Why does the PHP put a space in between java and script????

  3. #3
    Junior Member
    Join Date
    Nov 2003
    Posts
    29
    Isn't there a way to do this right in the getURL code?

  4. #4
    ActionScript Insomniac
    Join Date
    Jan 2003
    Location
    43d03.21'N, 89d23.65'W
    Posts
    1,173
    Put the code in where my example has a function call. Of course, this won't work in test mode, only in a JS browser.

  5. #5
    Junior Member
    Join Date
    Nov 2003
    Posts
    29
    So, something like this?

    getURL('java script:window.open theURL,winName,"width=480,height=480,status=no,scr ollbars=no,res
    izable=no,menubar=no")');

  6. #6
    ActionScript Insomniac
    Join Date
    Jan 2003
    Location
    43d03.21'N, 89d23.65'W
    Posts
    1,173
    Approximately like that. You seem to have more right parentheses than left ones, and keeping the various levels of quotes stright is always a pain. But that general approach will work., as this simple working example illustrates:
    code:

    myButton.onRelease = function() {
    getURL('javascript:window.alert("Sent from Flash"); void(0);', "_self");
    }


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