Close Window When MP3 Ends Play

I'm trying to create a webpage that will close itself when an mp3 audio file finishes playing.  Right now I'm trying to do this simply by playing the mp3 from a keyframe in the timeline as an event.  On the timeline I've placed a blank keyframe with an ActionScript attached to it that looks like this:
import flash.external.ExternalInterface
ExternalInterface.call("closeWindow");
stop();
The HTML page that embeds the Flash running the mp3 has a Javascript function called closeWindow that looks like this:
<script language="JavaScript">
function closeWindow(){window.close();}
</script>
Very simple very easy.  But WHY DOESNT THIS WORK?  The ExternalInterface call should fire off the Jscript on the HTML but it's not doing it.
Any suggestions out there?

Ok so this does work after all.  First I had to create an HTML page from which to open a window containing the Flash mp3 audio using a window.open Javascript.  Then, it was really important to test the whole thing on an active webserver and not just on my workstation.  The webserver enabled the ExternalInterface call to connect to the window.close Javascript in the HTML page containing the Flash.  So it is pretty simple after all.

Similar Messages

  • Close Windows when quitting.... Full screen

    Hey all!
    Has anyone figured out how to default to open apps in full screen without useing the "Close Windows when quitting...." option in preferences. I'd love to have my apps default to full screen when opening without opening every tab I had open previously in safari, or every image I've looked at going back whos knows how long in Preview. The past 5 documents I worked on in InDesign. I could go on. You get the point. Its a cool feature but defaulting to full screen and reopend ll previous windows have no realation and should be two different settings/features. Its really annoying.
    G

    Hmmm.... It already tells you exactly what it does.
    What more do you want to know?

  • Close window when command(9i): exit_form;

    Hello all.
    How close window when command(9i) exit_form; ?
    Thanks.
    Martonio.

    Is this what you are talking about:
    Closing brower window

  • How can I close windows when quitting an application - but leave desktop windows open?

    In Mavericks...
    Is there any way to close the windows of application (when quitting - ie System Preferences => General) BUT not have this affect the finder application.
    I want the windows I have opened in the finder to remain opened, but everything else to close upon quitting

    Well, for some time now (since I upgraded to Mavericks) my startup goes on and on.
    It will, on occasion, finish correctly and I can go on with my work, but usually, it hangs.
    I can restart the finder 2 or 3 times and get it to finish loading.
    If I go into System Preferences => General => and turn “Close windows when quitting an application” on, then restart, the finder usually starts up faster and does not hang
    Obviously, there is some operation that is running in the background that is trying to restore itself to some unknown state that is holding up the finder application.
    I have uninstalled and turned off all sort of applications that run in the background, but have not yet been able to locate the culprit.
    So, I’d like to be able to have “Close windows when quitting an application” on because everything else on the machine can revert to a clean start-up state -- but I want the windows I leave opened in the finder to remain opened and where I put them.

  • Auto Close window  when finished

    Does anyone know how to auto close the window when the last
    frame is finished.

    Hi krisTM
    Try clicking Edit > Preferences... > Project node >
    Start and End node. Look at the Action configured in the Project
    end options area. If you click the drop-down, you should see an
    option labeled "Close project". Try configuring that and
    re-publishing.
    Cheers... Rick

  • ITunes closes itself when trying to play TV shows

    When I try to play a TV show, the window goes green and then iTunes stops working and closes itself. Songs all play fine, it seems to be just TV shows. Is there any reason for this? How do I stop it?

    There's a link in that article to another article about updating Windows drivers:
    http://support.apple.com/kb/HT1768?viewlocale=en_US
    wiki on ready boost

  • When to call to close account when contract ends

    My contract is up on October 15 i want to close my account when contract ends since my  account manager no longer wants to use the account any longer. so i  wanted to know when do i exactly call Verizon to cancel before the date  or the same day ? and how will the process of closing the account will  be?

    Call the day the contract ends MODERATOR COMMENT: The previous sentence is incorrect. if you cancel the day the contract ends, there will be an early termination fee assessed.< If you do it before they will charge you the an early termination fee. I swear that I was told if I did it even one day before the end of the contract I would pay a prorated etf. Also, if he wants to keep the number then I would port it out first the final day of the contract or he will loose the number. Make sure it is completely transferred and working before canceling. If that's not important to him then just call to cancel it when the time comes.
    Normally, the service cancels with the port process, but I wouldn't trust them not to charge you an extra day or two.
    Message was edited by: Verizon Moderator><

  • Close Window when done?

    I am making little interactive quiz files in captivate. They
    will be called via a link in an online training course. I want to
    figure out a good way to transition from the text (html) page with
    the course content to taking the .swf quiz, and then back to the
    web page. In the past I have just had a link on the page that opens
    a new window.
    1. If I have a link open a new window with the .swf in it,
    how do I get it to automatically close when the quiz is done?
    2. How do I get it to open a window that is the exact size of
    the .swf file?
    3. Is there a way to embed it in the web page in such a way
    that it is very small until someone clicks on a play button and at
    that point it scales to full size?
    thanks in advance.

    Does it work if you put any other JS in there? What if you
    put in a
    custom function (whether it actually exists or not) - like
    Finish();
    It's odd that the lesson won't load at all...
    E
    wiesec wrote:
    > I used a button and select execute javascript. Then I
    use the code:
    > top.window.close();
    Erik Lord
    http://www.capemedia.net
    Adobe Community Expert - eLearning
    http://www.adobe.com/communities/experts/
    http://www.awaretips.net -
    Authorware Tips!

  • Close Window when Back Button is Clicked on Movie Presentation

    I have a .swf movie that is accessed through a link on a website. At the end of the movie are two buttons: one for "Back" and the other for "Replay." Thanks to the helpful people on the forum here, I have the buttons working so the Back button goes to the previous URL and the Replay button, well, replays.
    However, the Back button opens a new window. Is there a piece of Action Script 3 that I can add to the following to close the window in my .fla Action Script Window to close the window as it jumps to the URL? Here is the script.
    stop();
    var link:URLRequest = new URLRequest("urlgoeshere");
    bck_btn.addEventListener(MouseEvent.CLICK, onClick);
    function onClick(event:MouseEvent):void
    navigateToURL(link);
    play_btn.addEventListener(MouseEvent.CLICK, playMovie);
    function playMovie(event:MouseEvent)
    play();
    I don't have access to the full HTML page, so I can't use javascript. I'm working through a CMS application to add content to the website, so I need to make this window close using Action Script 3 as part of the .swf file.
    Thank you,
    Marilyn

    does it matter if you close the window?....how about just opening the page in the same page....
    use
    navigateToURL(link, "_self");
    thelegendaryghost

  • Pages won't close windows when I quit it since I upgraded to lion.

    Ever since I upgraded to lion, whenever I open pages all the previous pages i was working on opened. It won't allow me to close them before quitting out of it, whenever I try to close them the system just ignores it.
    Also the mouse cursor has been disappearing on pages.
    I don't have this problem with numbers

    Ever since I upgraded to lion, whenever I open pages all the previous pages i was working on opened.
    The Resume feature in Lion opens the documents left open when an app was last quit. You can turn this feature off in System Preferences. See the General pane and its "Restore windows..." checkbox.
    It won't allow me to close them before quitting out of it, whenever I try to close them the system just ignores it.
    Does anything at all happen when you close a window in Pages using either the mouse or the File > Close menu command? eg a beep, a box appears, etc. It reads like you cannot close any Pages window, ever.

  • Exit button won't close window when course is completed. tried javaScipt

    I tried a short test (without JavaScript) and set the Project End preference to Stop Project. It didn't work when viewing locally but when it was published to our web server the exit button worked.
    Has this issue been resolved?  I find threads from 2011 with many people frustrated over the exit button not working; haven't found the resolution.
    Message was edited by: MN Jean

    Can you close Firefox via Firefox/File > Exit?
    That is usually a better way to close Firefox.

  • How do I enable "reopen windows when logging back in" in OS 10.8.5?

    I am one of the few people who actually liked that when I shut down at the end of the day I could go back to the same state when I logged back in.
    Is there an option to restore the "reopen windows when logging back in" in OS 10.8.5?

    The exact item you asked for,  [√] Re-Open windows When logging back in ...
    ... is on the Logout screen. Logout and make sure that box is checked, then log back in again.
    A related item is in
    System preferences > General ...
    [√] Close windows when quitting an Application
    --When selected, open documents and windows will not be restored when you re-open an Application

  • My pointer arrow is jumping around.  my windows flip.  i can't close windows--there are no 3 colored dots.i don't use a mouse.  i just downloaded Lion and my mac has been acting weird since.

    ALL OF A SUDDEN , MY POINTER ARROW IS OUT OF CONTROL OR WON'T MOVE.  I DON'T USE A MOUSE.  THE WINDOWS SHAKE LIKE WHEN I'M TOLD I HAVE THE WRONG PASSWORD AND THEN THE WINDOWS FADE, SWITCH AND/OR  FLIP AROUND.  THERE ARE NOT THE 3 DOTS IN THE LEFT-HAND CORNER SO I CAN'T CLOSE WINDOWS WHEN I FINISH WORKING WITH SITES.  MY MAC HAS STARTED ACTED WEIRD SINCE I STARTED USING LION.  HELP!!!!!!!!!!!!!!!

    Hi,
    I work for Dr Pod, an iPod repair company. This sounds to be that the hard drive is dying in the iPod. As it is an older iPod it is out of its one year warranty, the iPod won't be repaired for free by Apple, and you'd need to consider wether it'd be better to have the iPod repaired by an iPod repair company such as my own, or to purchase a new one from Apple.
    If you did choose to purchase a new iPod from Apple, then they do provide 10% off the cost of a new iPod if you exchange in your old one. I'm not sure if this applies to faulty ones though (I have heard of some people being turned away for having a faulty device).
    Hope this helps,
    Mark Sweeney
    Dr Pod Founder

  • How do i end a sub vi when the close window control is clicked?

    Hi,
    I have a sub vi that sits in a while loop until a 'Done' button is pressed but sometimes the user clicks on the close window control in the top left of the window (MacOS) instead.
    After this has happened I would like control to return to the calling vi but it's as though the sub vi is still waiting for someone to click on the done button and the any user actions in the calling vi are ignored.
    How do I wire the close window into my program so as clicking on either it or the Done button will end the sub vi and pass control back to the calling vi?
    Thanks,
    Dave.

    The "event structure" can capture events for "this VI" that include "panel close". If you are using an event structure to look for the push of the Done button, just add another event that will catch the panel close as well (you can even configure the stucture to not pass on the close event). If you are not using the event structure to watch for the done button, perhaps you should. If you cannot use it in the same loop, you can put it in a parallel loop and use any of several signaling mechanisms to communicate between the loops.

  • Force end of session when user closes window without logging out

    I want to protect sensitive employee data. Does anyone know how to force a user's portal session to be terminated after a user closes a window with the "X" instead of logging out?

    Web application is connectionless. So there is no way to tell if a user has disconnected. If the user diligently logout, then invalidating a session is no problem. However, if you wish to invalidate the user upon closing of window, I suggest you drop that idea and change to different approach.
    1. If you are trying to impose single logon policy, you may consider invalidate an existing session if the same user login again.
    2. If you really need to invalidate a user session as soon as he is inactive (or closes window). I suggest you set a very small timeout interval (maybe 3 minutes). Then for all the pages, implement a simple invisible IFRAME that will keep refreshing itself (say every 2 minutes) on a dummy JSP/servlet URL. The fact that this IFRAME always hit the URL at 2 mins interval will keep the user session valid. Once the browser window is closed, the session will be invalidated in max 3 mins time.
    The final suggestion is to drop that idea altogether, the point is ... implement such feature is like twisting web application to do something that it is not design to do naturally.

Maybe you are looking for