Closing browser window from Flash movie on CD

I have to put a flash lesson I created on a cd for a client and while testing it I noticed that my exit button in the movie no longer seems to function.
This is my close window function
    function closeWindow(evt:Event)
        var url:String = "javascript:window.opener=self; window.close()";
        var request:URLRequest = new URLRequest(url);
        try
            navigateToURL(request, "_self");
        catch (e:Error)
            trace("Error occurred!");
Can anyone tell me why this wouldn't work when the movie is launched in a browser window from a CD?

Fi it is at all possible you cannot do that with url request.
Try using ExtrenalInterface class:
ExternalInterface.call("javascript:...");
It may not waork though depending on security settings and embed parameters.

Similar Messages

  • How do I open a new browser window from Flash

    I wish to open a new browser window from Flash and when the new window closes to return to the location from whence I started.
    ThomasChen

    The command to open a new window would be the "_blank" part of a command to link to a web page in the code below.
    navigateToURL(new URLRequest("http://www.anothersite.com", "_blank"));
    As far as the new window closing and getting back to where you were in the original window, I don't understand where that original window might have gone to... You should be wherever you last left it.

  • Closing browser window from an Applet?

    I've written a series of applets that perform different functions. I placed a button on each applet with the purpose to close the window in which that applet is running. However I don't even know where to start looking to find out how to make my applet close it's own browser window. I know how to open a new browser window from an applet but not vice versa.
    Can anyone help please?
    Mark.

    Right, I sort of tracked down some code that uses getMethods to allow me to invoke a Javascript command. It is not pretty and took a little bit of editing to get to work but it does the job without putting JS stuff into my HTML.
    However it is causing some problems. If I open one of my other applets it will only let me close that window and the previous applets ceases to respond at all. I think this may be because the invoke gets the JSObject which is the window and somehow having more than one applet open in different windows is causing it to get confused and is locking the first window and only responding to the second.
    I have seen a much simpler method that uses:
    import netscape.javascript.*;
    and JSObject to get the window but my compiler complains about the import. Any further suggestions or an example would be welcome as my current solution is a bit limited as you can effectively only have one window open at a time which doesn't suit my needs.
    Many thanks.
    Mark.

  • New browser window from single movie frame?

    Sorry but I am a total newbie>
    I have a 4 frame movie imported into one layer and want to
    specify a different URL to be opened in a separate window for each
    frame. So I have made each frame a keyframe and added from the
    behaviors a geturl event for each frame. When this is published it
    loops the movie and opens a new browser window for every frame for
    every loop, resulting in dozens of browser windows. How can I make
    this a mouse clickable event so only when I click on a frame will
    the new browser window launch?
    I am trying to use onrelease, but I am not sure how this
    should work as I can't find a good example.

    1) you can't 'click on a frame' in the SWF file when it's
    running, you must click on a 'button' or 'movieclip' instance the
    you construct ON a particular frame, or all in the same frame with
    different buttons on theStage.
    2) you need to add a 'stop()' action to your actions layer to
    stop the SWF from 'playing' which is why it continues to open more
    windows, MovieClip timelines play and loop by default.
    3) more information that you will ever need is located in the
    Flash Help files(F1) along with many tutorials to learn the basic
    concepts, open them and go to 'Getting Started in Flash' to learn
    some basics.

  • Opening a new browser window from flash

    Does anyone know of a method fo opening a link in a new
    window in firefox from within flash that isn't blocked by the popup
    blocker. It seems like the security in FF 2.0.0.6 (I'm on 2.0.0.11)
    has been tightened to prevent any _blank or window.open calls from
    flash getting through. I've tried the standard getURL, fscommand
    and ExternalInterface call to a javascript window.open method.
    Nothing now works.
    I understand the need for the popup blockers, but this is a
    legitimate popup only invoked on user interaction (click) - the
    same window.open call in an onClick event outside of flash works
    fine and I guess it is blocked from within flash because there is
    no way of knowing if the call is invoked from user interaction or
    automatically - but seems a shame.
    So any other way of getting a new browser window to open from
    within flash in firefox?

    Use target="_blank" in your form declaration.<FORM METHOD=POST ACTION="someAction" TARGET="_blank">The _blank keyword tells the browser to load the results in a new window.
    If you need more control over your window (size, address bar, etc.) you'll need to use javascript.<SCRIPT>
    function submitForm(windowName){
       newWin = window.open("",windowName, "menubar=no,resizable=no,...");
       document.myForm.target = windowName;
       document.myForm.submit();
    </SCRIPT>
    <FORM NAME="myForm" METHOD=POST ACTION="some.jsp" TARGET="">
    <INPUT TYPE=BUTTON VALUE="Submit" onclick="submitForm();">
    </FORM>

  • Problem in Closing Browser window from an Applet.

    I have wriiten a small Applet progarm that calls a Javascript function in the opening window, to close the window in which it is loaded.The Applet window is a PopUp window from one of my application's window.
    First time I start my application and load that Applet and then close the frame window,it works fine that the browser window will close, when the frame window is closed.It calls the window closing event in that applet stop method is called and In stop methd a closeLaunchedBrowser method will called this has a Javascript method and the Method closes the window using the self.close() method.
    But now if I continue this process of launching applet and then closing frame window, initial 1 or 2 steps it has know problem when I continue this, after 3 or 4 steps, it result in browser hang/crash.
    I am using java version 1.4.2_01 or higher and IE or Firefox(any other NetScape based) browser to load applet.It works fine with IE but getting problem in case of Firefox(any other NetScape based).
    The error dialog information and related event log generated is shown below :
    The dialog which is displayed before crashing of firefox has information :
    "firefox.exe has generated errors and it will closed by windows.you will need to restart the program.
    An error log is being created."
    The error log information :
    Source : Browser Event ID: 8032
    "The browser service has failed to retrieve the backup list too many times on transport \Device\NetBT_Tcpip_{611A64A2-8F4B-409E-9AB2-0D9BF741E791}. The backup browser is stopping.
    The code related to this is given below.
    import javax.swing.JApplet;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import netscape.javascript.JSObject;
    public class TestApplet extends JApplet {
    protected JSObject win = null;
    private JFrame frame = null;
    private boolean alreadyClosed = false;
    public void init(){
    this.win = JSObject.getWindow(this);
    frame = new JFrame("Test Frame");
    frame.setSize(300, 400);
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.out.println("windowClosing");
    TestApplet.this.stop();
    frame.show();
    public void stop() {
    if (!alreadyClosed) {
    alreadyClosed = true;
    closeLaunchedBrowser();
    System.gc();
    System.runFinalization();
    private void closeLaunchedBrowser() {
    final TestApplet thisObject = this;
    Runnable r = new Runnable() {
    public void run() {
    try {
    JSObject win = (JSObject)JSObject.getWindow(thisObject);
    if (win != null && win.toString() != null) {
    //win.eval("top.opener=self;self.close();");
    //win.call("close", null);
    win.eval("self.close();");
    } catch (Exception e) {
    Thread t = new Thread(r);
    t.start();
    }If any one know solution regarding how to aviod this crash of browser please let me know. I will be very thankful to you.
    Thanks.

    Right, I sort of tracked down some code that uses getMethods to allow me to invoke a Javascript command. It is not pretty and took a little bit of editing to get to work but it does the job without putting JS stuff into my HTML.
    However it is causing some problems. If I open one of my other applets it will only let me close that window and the previous applets ceases to respond at all. I think this may be because the invoke gets the JSObject which is the window and somehow having more than one applet open in different windows is causing it to get confused and is locking the first window and only responding to the second.
    I have seen a much simpler method that uses:
    import netscape.javascript.*;
    and JSObject to get the window but my compiler complains about the import. Any further suggestions or an example would be welcome as my current solution is a bit limited as you can effectively only have one window open at a time which doesn't suit my needs.
    Many thanks.
    Mark.

  • Can I open a new browser window from a movie clickbox

    Hi,
    This is a last question from me, I hope. (I'm within a month
    of delivery, and my boss keeps saying 'a user's asked for this or
    that', but I'm meeting many of their requests with technical
    obstacles. Oh dear.)
    Here's the question: From a caption clickbox within a movie,
    can I link to a new browser window? (I have a Help button at the
    top of my movie and a user tester rightly pointed out that it
    breaks them out of their movie and they can't get back. So my only
    solution is to open it in a new browser window, but as I'm within
    the movie, I need to link to the new window from a caption or
    button, not an html page.)
    If a Javascript command would work, could I get the exact
    code to put in the box? I haven't been able to get any
    Javascripting to work through Captivate.
    If nothing works out, I'll have to scrub the Help button from
    every page, but I'd rather be sure before I do it.
    Thanks in advance,
    Kim

    Hi and thanks for both of the replies.
    Phew! I love it when there's a way out of my problem! Is it
    my imagination or are the options: Current, New, Parent and Top not
    described in the Captivate help? What is the Parent? I would have
    thought a window would have spawned a child. And I guess Top is a
    new window that's always on top? Is it described in the help
    anywhere beside the page I found that doesn't describe it? (I guess
    so far, I've been blindly and successfully using Current.)
    I assume I can't remove the toolbars on my new windw without
    going through an extra link? If that's the case, I can live with
    that. I wouldn't want to make the user click two links just for a
    help page.
    Thanks again,
    Kim
    PS. No wonder my Javascript never works if I can't even
    notice the options!

  • Open specific sized browser window from Flash

    Can anyone tell me what the script is to make a button open a
    specific sized browser window with another flash file in it?
    http://www.partnerscreative.net/Test/BMS
    this link shows the banner that will be on the sites
    homepage, when you click on anything but the pdf link I want it to
    open the linked flash file into a browser window sized specifically
    to 720 x 600 pixels.
    Please help.
    Thank you.

    The command to open a new window would be the "_blank" part of a command to link to a web page in the code below.
    navigateToURL(new URLRequest("http://www.anothersite.com", "_blank"));
    As far as the new window closing and getting back to where you were in the original window, I don't understand where that original window might have gone to... You should be wherever you last left it.

  • Trigger Javascript when closing browser window from CP8

    I worry this isn't possible but here goes....any help would be incredible.
    Recently I was given some great advice on how to trigger a Javascript action in the frame on our LMS which the Captivate file plays in.
    It works perfectly and on the final page triggers the Javascript which send usage back to the LMS and forward the user to a page which allows them to rate the course.
    The code was as follows:
    top.code.closeSCOContent();
    closeSCOContent() is something written into our LMS.
    However the obvious issue occurs when a user just closes the browser window and for some reason our LMS doesn't record any bookmarking or any data.
    The only way it seems to do this is if that function is called.
    So using the window.onunload() or the DOFinish; function is there a way I can edit any file in the Captivate output to trigger this function when closing the browser?
    Long shot I know but currently the best I have managed is getting the course to trigger this as soon as it loads rather than closing the window?
    Massive thanks in advance for any advice.

    Any solution to ensure the data is written back to the LMS would solve the issue.
    Currently when the close button is pressed nothing happens at all and it's a big problem.
    Triggering this .closeSCOContent() function would be the ideal, but if it's not possible anything to write back would be best.
    When you say <body onbeforeunload="top.code.closeSCOContent();">
    Do you mean putting this in the HTML file of the output which currently is:
    <body bgcolor="#f2f2f2">
    and change this to:
    <body onbeforeunload="top.code.closeSCOContent();" body bgcolor="#f2f2f2">

  • Open a browser window from flash actionscript 2 in safari or firefox

    I am having a problem. I found the actionscript 2 code to open a browser window, but it is not working in Safari, or Firefox. I found an old action script 1 file version 5 for the flash player that works just fine, but I am using 8 and actionscript 2 so that doesn't work for me.
    Any body have any idea how I can do this?

    if you're testing locally, use:
    http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.htm l

  • Open browser window within flash movie

    I've read several GetURL tutorials. They all open a new
    window. I want to open the URL within the flash movie.
    I would also like to specify the size and location. Just like
    a photo gallery, but instead of loading an image (or movieclip) I
    want it to load the URL. Can Flash do this? Can some brave and
    generous soul show me the way? Thanks!

    Let's make it a 100%. It isn't possible - the way you imagine
    at least it isn't.
    You could try to work around with css-layers and flash
    javascript communication, but this wont be very reliable. Cotting
    up you flash and using an i-frame would be more reliable, but also
    not really fun to do.

  • Popup to confirm when closing browser window?

    Hi
    I want to display popup confirm window when closing browser window, "changes will be lost" yes or no. for this i searched forums got some idea, about "WORK PROTECT MODE". this will work only when our application running from portal. my doubt is where should i write code for this??? any help
    Thanks,
    kris.

    Hi Thomas,
    We are on ECC6.0 enph5.
    In system configuration in epc.loader(service) the value for work protect mode is set as 1 - Protect unsaved data (open page in a new window) 
    1)Is it possible to override this value within WD ABAP application? for example show popup window when there is unsaved data
    2)In this scenario what is the significance of L_PORTAL_MANAGER->SET_WORK_PROTECT_MODE
    and   L_PORTAL_MANAGER->SET_APPLICATION_DIRTY_FLAG
    3)Where exactly  L_PORTAL_MANAGER->SET_APPLICATION_DIRTY_FLAG has to coded. It does trigger modify method of the view.
    Thanks,
    chamu

  • Obtaining the full file path specification from Flash Movie and QuickTime icons?

    How do you obtain the full file path specification from Flash
    Movie and QuickTime icons? I want the path and the file name that
    is contained in these icons. I am using a "dive" to run through the
    icons of a file, and when I come upon these two types of icons, I
    want to obtain the above information that is contained in them. I
    certainly can look in the property dialog box to get this info, but
    there are many icons in these files, and I want to generate a list
    of info based upon the various types of icons that I am processing.
    Thanks

    > How do you obtain the full file path specification from
    Flash Movie and
    > QuickTime icons? I want the path and the file name that
    is contained in
    > these
    > icons. I am using a "dive" to run through the icons of a
    file, and when I
    > come
    > upon these two types of icons, I want to obtain the
    above information that
    > is
    > contained in them. I certainly can look in the property
    dialog box to get
    > this
    > info, but there are many icons in these files, and I
    want to generate a
    > list of
    > info based upon the various types of icons that I am
    processing. Thanks
    >
    For Flash
    Trace(GetIconProperty(iconID, #pathName))
    for QuickTime
    Trace(GetIconProperty(IconID, #filename))
    For full scripting reference for each of these sprites, open
    up the
    Properties panel for each sprite and press the Help button
    that appears on
    the properties page ... or else navigate to these folders for
    the Flash and
    QT help
    C:\Program Files\Macromedia\Authorware
    7.0\xtras\FlashAsset\Help
    C:\Program Files\Macromedia\Authorware
    7.0\xtras\QuicktimeAsset\Help
    You don't want to know how many times I asked Macromedia to
    stop hiding that
    Help!
    Steve
    http://twitter.com/Stevehoward999
    Adobe Community Expert: eLearning, Mobile and Devices
    European eLearning Summit - EeLS
    Adobe-sponsored eLearning conference.
    http://www.elearningsummit.eu

  • Launching FW from Flash Movie

    Is there a way to launch FW from Flash Movie when user
    presses a buttons?
    Bascially, when user clicks a button in Flash Movie, FW
    launches and execute some scripts.
    Thanks,

    Not a Flash expert, but I don't think so. Why do you want to
    do this?
    alex
    babo_ya wrote:
    > Is there a way to launch FW from Flash Movie when user
    presses a buttons?
    >
    > Bascially, when user clicks a button in Flash Movie, FW
    launches and execute some scripts.
    >
    > Thanks,

  • Open a URL in a new window from Flash

    Looking for the simplest way to open a URL in a new window from Flash using AS3-CS3, Thank you.

    The following line of code will do that...fill in the URL
    navigateToURL(new URLREquest("http://www....", "_blank"));

Maybe you are looking for