Detecting navigation away from a screen

To play mp3 files in my web application, I've a  simple audio player with play/pause buttons, progress bar, etc. Just the way  VideoPlayer stops playing video when user of the application switches to some  other screen, I would like my audio player to stop playing audio when the user  switches to some other screen. What event can I use to detect that the audio  player (s:VGroup) isn't 'visible'?
Although this question is framed around stopping an  audio player, the same applies to a situation where user is navigating away from  a form without saving modified data.
Thanks,
Dilip

Hey Dilip,
You need to include Javascript here. What you need to do is put an event on window.blur and on window.blur call a code of Flex application to make the audio player mute.
I think that make sense to you still if you have any question let me know.
Thanks & Regards
Ankur Arora
Project Leader(Flash and Flex)
http://flashdeveloper.blogspot.com
http://www.ankur-arora.com

Similar Messages

  • How to Prevent Navigating Away From a Page?

    Hi all,
    I�m developing a JSF application using IBM Rational Application Developer v6.0 and have this scenario:
    Background:
    I have a page that acts as a 3 step wizard. It also contains links to other pages. The page has a corresponding �pagecode� bean with a request scope and another managed bean with a session scope and basically everything happens here, all the action and action listeners. Also this managed bean handles three important events the �page load�, �page load ends�, and �page post�.
    Desired Behavior:
    I want to enforce the user to complete all three steps of the wizard without navigating away from this wizard like page by displaying a message �hey you must complete all three steps� or something like that :).
    Problem:
    The user can click on other links on the page and navigate away from the wizard without completing all three steps.
    Any suggestions to this issue would be of great help.
    Thanks in advance.

    First: how do I change my stupid screen name? :)
    Thanks for your solution. Would this also work for normal html navigation? My understanding that this may only work for the JSF framework navigation rules. On the other hand I also have plain html links on the page and not really sure if the JSF framework also handles these types of navigation.
    This maybe a partial solution though and I really appreciate this.
    Thanks.

  • Can we stop user navigating away from Block in an Error condition?

    Hi all,
    I am writing validation code in custom library attached to an Oracle Form. Is there any way to stop
    the user from navigating away from a Data Block if there is a validation failure?
    Many Thanks,
    Prathima.

    it depends. some triggers fire, before validations are complete, e.g. when-button-pressed. there is also a difference between navigable and non-navigable buttons/items.
    better you check it out by putting messages inside your code.

  • All my caption text went away from full screen in organizer pse 10

    all my caption text went away from full screen in organizer pse 10

    Use the menu Preference/General.
    You have a button to press on the bottom of the screen : 'reset all warning dialogs'.
    Then start the full view (F11); you'll get the popup menu to set the preferences for the full view; check to show captions.

  • My top shell is pulling away from the screen on the bottom corner.  Is this repairable?

    My top shell is pulling away from the screen on the bottom corner.  Is this repairable?

    MBP 15.4/CTO Purchased Nov 2008
    2.8GHz Intel core 2 duo, 4gb 1066MHz DDR3 SDRM- 2x2GB
    320GB Hard Drive Serial ATA @720
    Optical Drive Super Drive 8XDL
    Never been dropped - never been out of the home - Original battery
    Original Price £1442
    Quoted £744 for repair
    Works OK but just concerned that it will fall to bits

  • Drag and Drop - detecting drop away from a component

    Flex 4, AIR 2.0 app
    I have a drag and drop detecting a Button drag away from a Group1 into Group2.
    When the user drops into a Group2, the Button is added to it, which obviously removes it from Group1.
    I would like it that if the user drags away from Group2 and drops it randomly on the screen, the Button will be added back into Group1.
    Does anyone have any ideas as to how I might go about detecting the end of a drag when not over a component, so I can add the button back into Group1 again?
    Hope that makes sense!!!

    Thanks Ronnie,
    I'll have a look at gthis as it looks a bit more efficient than the solution I have come up with.
    The only thing I'm not sure about is at what point my Button gets put back into Group1.  In my current movie, I have a function which handles the dragDrop event.  But if I drop outside a component, I don't have an event from which I call the handleDrop(dragEvent) function.
    I'll have a look.
    In the meantime, what I'm doing is Making my drag item a custom component, passing a reference to it's default container (Group1) and its Default X and Y co-ordinates.
    Then, I have a dragComplete handler which is called whenever the drag item is released - I then check the action property of the event and if it is "none" I know it has been dropped outside a recognised target and I can add it back into its default group and set its default x and y coordinates.  This seems to work quite nicely at the moment.
    so, my code in the Drag Button looks like this:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Button xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx"
        mouseDown="mouseDownHandler(event)"
        dragComplete="dragCompleteHandler(event)">
    <fx:Script>
      <![CDATA[  
       import mx.core.DragSource;
       import mx.core.IUIComponent;
       import mx.events.DragEvent;
       import mx.managers.DragManager;
       public var _defaultParent:Object;
       public var _defaultX:Number;
       public var _defaultY:Number;
       protected function mouseDownHandler(event:MouseEvent):void
        // the drag initiator is the object being dragged (target of the mouse event)
        var dragInitiator:IUIComponent = event.currentTarget as IUIComponent;
        // the drag source contains data about what's being dragged
        var dragSource:DragSource = new DragSource();
        // ask the DragManger to begin the drag
        DragManager.doDrag( dragInitiator, dragSource, event, null );
       protected function dragCompleteHandler(event:DragEvent):void
        // TODO Auto-generated method stub
        //trace("Drag complete!");
        //trace("target = " + event.target);
        //trace("action = " + event.action);
        if (event.action != "none"){
         trace("woo!");
        }else{
         trace("put the drag label back into its original position");
         if (event.target.parent != _defaultParent){
          trace("put it back, you monster!");
          _defaultParent.addElement(event.target);
          event.target.x = _defaultX;
          event.target.y = _defaultY;
         }else{
          trace("ah... it's already in the right place... actually!");
      ]]>
    </fx:Script>
    </s:Button>

  • Navigating back from a screen

    Hi all,
    we have creaed a hiring action in HR. i have to check whether a user came to a particular screen by navigating backwards from the next screen in the hiring action. i have to write some code if the user navigates backwards from a screen. can anyone tell me how i can check if a user pressed the back button on the previous screen to come to the current screen.
    regards,
    Hamza

    In the PAI of the previous screen,
    Add following code.
    CASE V_OKCODE.
    when 'BACK'.
      V_FLAG = 'X'.
    ENDCASE.
    In the current screen,
    check if the flag is 'X', he has come from previous screen.

  • Navigating away from phone call

    Hello. I want to love my new Q10 as I loved my bold, but some seemingly simple things are frustrating me!  And I am not technical, so help appreciated.  Can anyone tell me if I can navigate away from a phone call to go into another area (for example my calendar) while staying on the call?  Used to be so easy and allowed me to check my calendar or even send a bbm if I was stuck on a long speakphone call.  Thanks!

    Hey nottechnical,
    Welcome to the BlackBerry® Support Community Forums.
    To minimize the phone application Swipe up from the bottom of the screen.
    Let me know if you have any other questions.
    Thanks.
    -HB
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • Navigating away from a quiz

    In the course I am creating I have quiz questions to test understanding that I am not scoring.  At the end of the course I have quiz questions that will be scored for a final grade.  Here is a problem that I am facing.  You start the first of two quiz questions, you answer the first, correctly or incorrectly it does not matter.  On the 2nd quiz question you navigate away from the quiz to reference the course for the answer.  When you come back to the quiz I can no longer answer the question or any questions in the rest of the course.  What am I doing wrong here?

    I will ask this question another way:
    I have 4 modules in a course.  I present content in module one and I pose 2 quiz questions that are not graded, just testing understanding and keeping the student engaged and give feedback using the quiz tool (Correct, Incorrect).  I present content in module two and pose more quiz questions again part of the final grade.  This patterns continues until the end of the course where I have several quiz questions that are given point totals and graded for a final grade.  The problem I have is that when the student starts the quiz all is fine until the student navigates back or forward in the course other than slide by slide one after the other.  When the student navigates away either using TOC or the playbar, the course thinks the quiz has ended and does not allow for the student to take anymore quiz questions.  I do want to have TOC available for course navigation.  This course will be launched from an LMS.
    Has anyone else created a course like this?  Can this be done another way?

  • Multiple Audio CD Burn, Navigation Away from Playlist Breaks Things...

    Wonder if anyone else has noticed this behavior:
    I was burning a playlist to Audio CDs. It was a 2 disc set. While iTunes was busy burning the first disc, I navigated to another play list, and looked at some stuff. Then I went to my Party Shuffle to see what was coming up (as this was already playing before I started the burn of the other playlist).
    Then, the first disc completed and ejected itself. At this point, iTunes usually asks for another disc. But not this time. I put in another CD, but I was prompted by the system for action. It appears that if one navigates away from the playlist that you are burning, it breaks like this. In a previous 2-disc set I burned, I did not change the source (navigate away) and all operates as it should.
    Anyone else experience this? Do you think it warrants a bug report?
    Beavis2084

    I think this is worth a bug report - unless there's a
    way that you can start burning from the second CD
    again
    I looked and looked for a "resume" function, no joy.
    Beavis2084

  • SWF in PDF stops playing after navigating away from page

    I have a PDF ebook with SWF movies embedded each movie is a music track controller that plays a track from a soundtrack to the book.
    I want readers to be able to play the tracks while they read the book.
    This works fine in Acrobat. But in Digital Editions, as soon as I navigate away from the page showing the track controllers/SWF movies, the movie/track stops playing.
    Is there any way around this? Perhaps there are technical limitations to a Flash-based app. at play here.

    Arthur, this sounds like content you've created yes?
    If it's content you're creating then I'll have to send you to Engineering via the Digital Publishing Center at
    http://www.adobe.com/devnet/digitalpublishing/.
    There's a feedback form on that page (we don't currently do any ebook dev support on this forum.. there might be a forum unique to that at some point in the future). It's not very clear, but if you send a dev question to that feedback form you should get an answer from engineering. This ONLY applies to questions about creating content for consumption in ADE 1.5.... (end user questions regarding ADE 1.5 still go through web case support at http://www.adobe.com/support/digitaleditions/)
    Regards,
    Bentley Wolfe
    Senior Support Engineer, Flash/Flash Player/Digital Editions
    Adobe

  • Executing ABAP on Navigating away from BSP

    Hi All,
    I would like to know if it's possible to execute a piece of ABAP code when the user navigates away from a BSP page.
    I have the necessary ABAP clean-up code that I need to execute if the user decides to quit the BSP page (that includes closing the browser window, going to another website like cnn.com, or hitting the "Back" button).
    Can anyone think of a possible solution? I tried to use javascript function on page "unload" property, but it appears it is not possible to restrict ABAP statements by enclosing them in javascript tags.
    Thanks in advance!
    Roman D.

    Hi Thomas,
    Thanks for the quick response. No, the application is stateless.
    Due to the programming design, the person who developed the application created a certain document on the "OnInitialization" routine. What I need is to delete that document unless the user hits the Save button...sounds absurd, but it's more of a workaround than a real solution.
    So, in other words, if the user enters the page and hits "Save", everything is OK. But if the user doesn't hit "Save", but instead just quits the BSP application, I need to make sure that the document is deleted.
    Is this problem more clearer now?  Let me know if I can provide more details.
    Thanks!
    Roman D.

  • Navigating away from current page

    I have an annoying problem that hopefully someone will possibly have a solution to with there browser knowledge. I have an account with a music promotional company they service me with music from their site. There are clickable links that download a .zip file when clicked on or CTL clicked on. The problem is when I select a file to download Safari (and FF) doesn't let me navigate away from the page it seems stuck and the blue 'loading' box appears and I can go to any other web pages whilst the download is in progress. Has anyone any ideas what this could be? I have Click to Flash installed but I can't see that being the problem? This also happens with FF so its not necessarily a Safari problem but nevertheless I'm sure someone will have an idea whats going on?
    Many thanks

    HI,
    From the Safari Menu Bar, click Safari / Empty Cache. When you are done with that...
    From the Safari Menu Bar, click Safari / Reset Safari. Select the top 5 buttons and click Reset.
    Click to Flash I doubt has anything to do this download issue.
    Try emptying the cache and resetting Safari and see if it makes a diffeerence.
    For Firefox ...
    1. From the Tools menu, select Clear Recent History... .
    2. From the Time range to clear: drop-down menu, select the desired range; to clear your entire cache, select Everything.
    3. Click the down arrow next to "Details" to choose what history elements to clear. Click Clear Now.
    Firefox 3 for Mac OS X
    1. In Firefox, from the Tools menu, select Clear Private Data.
    2. Make sure Cache and Cookies are checked, and then click Clear Private Data Now.
    Carolyn

  • The shell on my 3 year old Macbok pro 15" is coming away from the screen, the battery is also swollen, is this a design flaw?

    The shell on my 3 year old macbook pro 15" is separating from the screen is this a design flaw?

    MBP 15.4/CTO Purchased Nov 2008
    2.8GHz Intel core 2 duo, 4gb 1066MHz DDR3 SDRM- 2x2GB
    320GB Hard Drive Serial ATA @720
    Optical Drive Super Drive 8XDL
    Never been dropped - never been out of the home - Original battery
    Original Price £1442
    Quoted £744 for repair
    Works OK but just concerned that it will fall to bits

  • I had a disc of pictures in my imac and tried to update the software to 10.9, after realizing the disc was in there i ejected it and now its stuck on the os x page. any info of how to get away from that screen and onto my normal pages?

    i tried to update my software to 10.9 and forgot i had a disc of pictues in the computer. i stopped the istall as it was trying to go onto the disc of pictures. now its stuck on the os x page and i cant get it to my home screen. can anyone help?

    I'm not really sure what you mean by "the os x page". It sounds like the installation did not complete.
    I would try this:
    hold down the power button until the computer shuts down
    take out the disk with the pictures!
    restart and see if it will boot up
    if it boots up normally, I'd probably try to repair your HD: Boot into your recovery partition (hold down ⌘R at restart until you see the Apple symbol), go to Disk Utility, and repair your hard drive. While you're there, repair permissions too. OSX Tips Using the Recovery HD
    Then I'd try to reboot and run the installer again. I think it's a good idea to do the installation in safe mode : Mac OS X: What is Safe Boot, Safe Mode? .
    if it won't boot up normally, I'd try booting from the recovery partition and repairing your HD.
    if it won't boot into the recovery partition, your options are:
    Try to repair your hard drive with internet recovery: OS X: About OS X Recovery
    If you have access to another (working) Mac and a USB thumb drive, download Recovery Disk Assistant, which you can use to repair your hard drive or reinstall OSX: OS X: About Recovery Disk Assistant
    Try to boot into single user mode and repair your hard drive: Repair Your Hard Disk in Single User Mode | Everything Macintosh

Maybe you are looking for

  • What are the different methods to find the user-exit for any requirement?

    Hi Everybody, What are the different methods to follow to find the user-exit for any requirement? Thanks & Regards, Nagaraju Maddi

  • I can't get bitlbee to connect to gmail in irssi

    I've been going round in little circles trying to get bitlbee to connect to gmail in irssi. I've followed numerous tutorials, seen a bunch of different sites, and everything fails at an Authentication Failure message. I can connect to gmail from cent

  • Using the - key to stand for a string of characters

    If I am seraching for all the words that start with V,v and end with C,c. What is the best way to do this? I want to make - stand for [a-z and A-Z] so that the user could just enter something at the command-line such as V-C. But, I know if I do this

  • Flash CFGRID Skipping Every Third Column

    I can't figure out why this is doing this... I have a cfform that contains a cfgrid. When I make that cfgrid an applet, all my columns show up just fine, and as I expect them to. However, I like the flash form a lot better, so I converted my code to

  • Buying a MacBook Pro - Help Suggestions

    Hi, I'm looking to get a new computer. I'm considering a MacBook Pro and could use some advice. I'm a front-end web developer, who primarily works from home. In the instances in which I work for a client on-site, I usually use their equipment/softwar