Getting a video to stop playing when user clicks on another button to navigate

Hello,
I am trying to create a little website in flash.. I have some video that plays automatically once the user goes to that section (I am using frame labels to navigate from section to section of the site).
But, when the user clicks another button to go to a different page, the video is still playing because I hear it..How can I stop the video from playing once another button gets clicked?
thanks
babs

All's you should need, if the video starts playing on its own, is...
function clickSection(evtObj:MouseEvent) {
     if (this.currentLabel == "about") {
          about_mc.vid_mc.gotoAndStop(1);
     gotoAndStop(evtObj.target.name);
If the video needs to be kick started because it was sent back to stop at frame 1 due to a previous navigation, then place that kick start in the about frame itself... about_mc.vid_mc.play();
If that's not working, be sure to check that your instance names are assigned.  Also, I have been assuming that the video is embedded into the timeline of the movieclip, so if that's not the case, then some other solution may be needed.

Similar Messages

  • Getting FLV to stop playing when user clicks on nav button

    I have a portfolio_mc that is inside of a content_mc (stage->content_mc->portfolio_mc). There are 3 buttons that take the user to an appropriate frame designated by a frame label and this loads up an FLV. The problem is that when I click on any of the navigation buttons on the main timeline, the FLV that is currently playing, is still playing (I can hear the audio). So I need to figure out how to stop this.
    Here is the code used for controlling the buttons in the motion_mc timeline:
    stop();
    var naviArr:Array = new Array(btn01, btn02, btn03);
    btn01.addEventListener(MouseEvent.CLICK, navigate);
    btn02.addEventListener(MouseEvent.CLICK, navigate);
    btn03.addEventListener(MouseEvent.CLICK, navigate);
    btn01.buttonMode = true;
    btn02.buttonMode = true;
    btn03.buttonMode = true;
    function navigate(event:MouseEvent):void
    switch(event.target){
       case btn01:trace("video01");
       gotoAndPlay("video01");
       handleBtn(btn01);
       break;
       case btn02:trace("video02");
       gotoAndPlay("video02");
       handleBtn(btn02);
       break;
       case btn03:trace("video03");
       gotoAndPlay("video03");
       handleBtn(btn03);
       break;
    function handleBtn(btn:MovieClip):void
       for(var i:uint = 0; i<naviArr.length; i++){
          if(naviArr[i] == btn){
             naviArr[i].removeEventListener(MouseEvent.CLICK, navigate);
             naviArr[i].buttonMode = false;
          }else{
             naviArr[i].addEventListener(MouseEvent.CLICK, navigate);
             naviArr[i].buttonMode = true;     

    I really like your layout it is very cool looking.
    You have it all set up just right. KGlad is right you don't even need to embed the flvplayback controls in another movieclip. I think the reason I had them in movieclips was another designer had them all set up that way and at the time I didn't want to mess with them. =P
    At the beginning of your navigate function before you drop into the switch statement just put this in.....
    function navigate(event:MouseEvent):void
        if(movie != null) //anytime there is something called movie on in scope when we navigate tell it to stop.
            movie.stop();
    switch(event.target){
       case btn01:trace("video01");
       gotoAndPlay("video01");
       handleBtn(btn01);
       break;
       case btn02:trace("video02");
       gotoAndPlay("video02");
       handleBtn(btn02);
       break;
       case btn03:trace("video03");
       gotoAndPlay("video03");
       handleBtn(btn03);
       break;
    That should do it for you.

  • When user clicks on "Like Button," the counter increases but nothing shows up showing the user recommends my site to their friends. What did I do wrong?

    When user clicks on "Like Button," the counter increases but nothing shows up showing the user recommends my site to their friends. What did I do wrong?
    I used the iframe code from Facebook's "Like Button" site; and inserted the code in the html widget popup box, then positioned it where I wanted it on my page and published. It looks fine (though I had to add "http" before my url to get it to show up).
    So, when a user clicks on button, a pop-up opens asking for Facebook password. When I (the user) enter a password, nothing happens after that. I thought the idea was that a user would be able to show their friends that they like my website. After I entered my password in pop-up after clicking on "Like" I went to my facebook page (a company page) to see if it showed that I (the user that clicked on "Like" on iweb) recommended the website. But nothing showed up. I thought maybe it was because Facebook associated my password as the admin for the Facebook page so didn't count it. But a friend tried it and same thing happened. I went back and on one page I put in another facebook code for a combo Like/Send button. It shows up but acted the same as the regular Like button.
    Questions:
    1. Is this the way the Like Button is suppose to work? Only benefit of Like button being that it just counts the clicks on the Like button and does NOT let users share their recommendation with their friends?
    2. If it's suppose to let users share their "Likes" with their friends, what did I do wrong? There were three types of code but in reading discussions, they all say to use iframe. (I used the first choice which I think was html for Javascript SDK and put that in my HTML Snippit box and the Like/Share button showed up on my iweb page next to the facebook icon and the words "likes this" but when I click it, I don't see instructions that it's sending my recommendation to my friends.)
    I must have done something wrong, but can't figure out what. Does anyone know? If the only benefit of the Like Button is the counter, it doesn't seem worthwhile.
    Thanks to anyone who can figure this out!  My website is couponsforfun.com

    You want something like this?
    http://home.wyodor.net/demoos/facebook/
    The send button sends the link to their friends in the address field with a message.
    They recieve a message in the inbox.
    There's no post on a page.
    If they want that, then they should share the link themselves.
    Perhaps it's best to study what facebook has to offer and how it works instead of guessing what it is supposed to do and be disappointed.

  • I recently purchased songs from itunes via my pc and I dont know how to get them onto my iphone? When I click the sync button it says I will lose all the music currently on my iphone.. Help :(

    I recently purchased songs from itunes via my pc and I dont know how to get them onto my iphone? When I click the sync button it says I will lose all the music currently on my iphone.. Help

    If you're syncing with a different iTunes library than the one you previously synced with, then there is no way around it. You're gonna loose the old data. The only way round it would be to make sure that all the music files on your iPhone is also in your iTunes library. If you still have access to the computer with the old library, you could copy the files on to an external harddrive, and then import them into your new iTunes library.
    If it is in fact the same library, then the music currently on your iphone, is also in your itunes library. Just make sure that the artists/albums/playlists, or whatever you sync contains these tracks, that you allready have on your phone and don't want deleted. What i do is, i create a playlist specifically for my iPhone, and i set it up to only sync with this playlist. Whenever i hear a track from my iTunes library or buy a new track that i want on my phone, i just drag it to this playlist and next time i synchronize, it's there without deleting anything else.

  • Sounds stop playing when user locks screen on iOS with AIR 3.9 Beta

    We built a simple application that should play sounds when in background and when the screen is locked.
    Since we updated to the latest AIR 3.9 Beta SDK, all sounds stop playing when the user locks the screen on iOS.
    The sounds resume when the screen is unlocked.
    - it works on Android
    - we use renderMode : cpu
    - we use UIBackgroundModes : audio
    - we use NativeApplication.nativeApplication.systemIdleMode=SystemIdleMode.KEEP_AWAKE;
    - sounds play when the app is in background
    - was working great with AIR 3.8 SDK
    Any help would be greatly appreciated.
    Thanks!

    Thanks for reproting the issue, we have an internal already logged bug for this, which is under investigation at the moment.
    -Nimit

  • Issue of data getting wiped out when user clicks on back button..

    Hello Gurus,
    I have a selection program which displays ALV on execution. Now I have programmed the "Back" Button of standard toolbar so that when comeone clicks on it, it should leave to selection screen.
    WHEN 'TBACK'.
          LEAVE TO TRANSACTION SY-TCODE.
    But when I do that, the values entered by user during execution of selection screen wipes out and all the selection fields become empty. How can I make sure that when sure clicks on 'Back' button, the selectiuon screen is presented but with values in which user put during execution.
    Regards,
    Rajesh.

    Hi Rajesh ,
    Leave to transaction sy-tcode is as as good as call transaction...so basically using this statement will start the transaction afresh..and give a new selection screen....
    Better option would be to leave to screen 0 (preferaby used for a report )which will take you back to the previous screen processed or leave to screen XXXX for a particular screen( in case of a module pool )
    Hope it helps
    Regards
    Byju

  • Glass Pane( preventUserInput when user clicks on Search button in af:query)

    Hi,
    We are using glass pane implementation on a search screen.
    When I click on Search button in af:query component (having selectInputDate (Date Picker) components)., glass pane is firing correctly,
    but second time when I am trying to select date using Date Picker (and Change the Month), glass pane is fired (entering into handleBusyState function) and calendar popup is not opening.
    I folled the below article for implementation.
    url: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/27-long-running-queries-169166.pdf used for glassPane implementation.
    Can any one help me for this issue.

    Hi am using the following code (javascript) -- Jdev(11.1.1.3)
    function preventUserInput(evt){   
    var eventSource = evt.getSource();
    var popup1 = eventSource.findComponent("showGlassPanePopup");
    if (popup1 != null){
    AdfPage.PAGE.addBusyStateListener(popup1,handleBusyState);
    evt.preventUserInput();
    //JavaScript call back handler
    function handleBusyState(evt){ 
    var popup = AdfPage.PAGE.findComponentByAbsoluteId('r3:0:r1:0:showGlassPanePopup');
    if(popup!=null){
    if (evt.isBusy()){
    popup.show();
    } else if (popup.isPopupVisible()) {
    popup.hide();
    AdfPage.PAGE.removeBusyStateListener(popup, handleBusyState);
    ... End of Code..
    This line .. (popup.isPopupVisible()) removes the Popup , if popup is visible...
    If u want the view am using..
    SELECT EMPNO , DEPTNO , HIREDATE FROM EMPLOYEE (sample Application i have created), created a view criteria for this..
    ( (EMPNO = :empNum ) AND (DEPTNO = :deptNum ) AND (TO_CHAR( TO_TIMESTAMP(HIREDATE), 'yyyy-mm-dd hh24:mi:ss.ff') = :hireDts ) ) (View Criteria)
    .. <af:clientListener method="enforcePreventUserInput" type="query"/> (added for af:query)
    Popup Used: <af:popup id="showGlassPanePopup" contentDelivery="immediate">
    <af:dialog id="d2" type="none" closeIconVisible="false">
    <af:panelGroupLayout id="panelGroupLayout1" layout="vertical">
    <af:outputText value="Processing......Please Wait.." id="ot97"/>
    </af:panelGroupLayout>
    </af:dialog>
    </af:popup>
    1. When i click search for first time.. it is showing like -- Processing .. Please Wait'
    2. When i click select Date picker it is show -- Processing .. Please Wait'
    and show a calender popup window.. If we change the month ... it will again show like -- Processing .. Please Wait'
    and it will not open calender window.
    Please Help me on this..Am facing trouble due to this.
    Thanks in Advance.
    Edited by: user10115793 on Nov 15, 2011 12:58 AM

  • How can I get an flv video to stop playing when I exit the page it's on?

    The audio continues to play no matter where I navigate on the site.
    Thanks

    You want to stop the audio from playing and also downloading more video/audio if it is still downloading when you go to a new keyframe where the video display/component or mp3 player is removed from the stage because it's keyframe ended or do not exist anymore but you still hear the audio.
    Add an event listener to your video playback component that calls a function when the flash player tries to remove the video plaer from the stage that stops the netstream or at least stops/pauses the video playback.
    [link removed]
    //sample NetConnection and NetStream classes when the video player is removed from the stage tell the NetStream to stop playing or downloading the content with .close();
    var connection:NetConnection = new NetConnection();
    connection.connect(null);
    var stream:NetStream = new NetStream(connection);
    addEventListener(Event.REMOVED_FROM_STAGE, videoRemovedFromStage);
    function videoRemovedFromStage(e:Event){
       stream.close();

  • How to stop the Flex application when user clicks on Cancel button from JS-confirm message?

    Hi All,
    I use the next code when a user clicks on a link:
    private function clickHandler():void
          ExternalInterface.call('confirm', 'Of course you want to go to the Adobe forums!');
          navigateToURL(new URLRequest('http://forums.adobe.com'), '_self');
    This will show up the javascript confimation box. But when the cancel-button is clicked, the user goes straightly to http://forums.adobe.com...
    How to stop Flex performing the next code when a user clicks on the Cancel button?
    Or, how to catch which button is clicked by a user in Flex?
    Thanks!

    I agree with Mr. Hall that using mx.controls.Alert in Flex may be a better route.
    Show the Alert like this:
    // show an alert with a question and yes and no choices
    Alert.show( "Would you like to go to the Adobe Forums?", "Question",
         Alert.YES | Alert.NO, this, closeHandler, null, Alert.YES );
    Then handle the response in the closeHandler() function:
    protected function closeHandler( closeEvent:CloseEvent ):void
    if( event.detail == Alert.YES )
         navigateToURL( new URLRequest('http://forums.adobe.com'), '_self' );
    else if( event.detail == Alert.NO )
         // they chose no
    The following documentation on Alerts may be helpful:
    http://www.flexafterdark.com/docs/ActionScript-Alert
    Let me know if that helps...
    Ben Edwards

  • Trigger a process chain when user clicks on save button in web interface

    Hi All,
    This is a issue I'm facing with the BW BPS web interface.
    BPS web interface generates a BSP application so thought posting this question in BSP forum might get some responses.
    The issue is I have to trigger a process chain when the user clicks on the save button on the web interface.
    I have no clue how BSP works. So if anybody has any ideas or suggestions I would greatly appreciate it.
    Thanks,
    Harini

    Hi Dhanya,
    This is the code i have in the ABAP program in the process chain. I just included the API_SEMBPS_POST part, but still it doesn't work. Please give me your email address so that i can send some screenshots.
    REPORT  ZHTEST.
    DATA: l_subrc TYPE sy-subrc.
    DATA: ls_return TYPE bapiret2.
    CALL FUNCTION 'API_SEMBPS_POST'
    IMPORTING
       E_SUBRC         = l_subrc
       ES_RETURN       = ls_return.
    CALL FUNCTION 'RSAPO_CLOSE_TRANS_REQUEST'
      EXPORTING
        I_INFOCUBE               = 'ZMAP_TAB'
    EXCEPTIONS
      ILLEGAL_INPUT            = 1
      REQUEST_NOT_CLOSED       = 2
      INHERITED_ERROR          = 3
      OTHERS                   = 4
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Calling external url like 'GOOGLE'  when user clicks on toolbar button

    Hi All,
           I have done the following steps for url creation:
       1. I have created an event and assigned it to newly created toolbar grp.Then in 'Define Application Layout' I have created an entry specifying name of application, toolbar, event, tab grp and version.
       2. Then in navigation for url generation I have created a method with blank object name. This method I have then assigned to a role.Here i have specified path for extenal link say 'google'.
       3. I have assigned same role to me in su01 transaction.
       4. when i run my application ,toolbar is getting displayed but when I click on toolbar nothing is getting open up.
               Is this the correct way for url generation or do i need to do something else?Is there any coding needs to be done?I have provided with steps done by me.Please help me further.
    Regards,
    vikas

    Hi.
    That's not possible in the PCUI since when the button is pressed a PCUI event is triggered and handle by the PCUI framework and we don't have access to the layout in order to react to such event (like placing javascript windows.open or kind of). The events defined in the PCUI are only supported by the PCUI framework. You could create an HTML container and then start the external web application (www.google.com or whatever) in this container (there is a good blog written by Gregor Wolf at <a href="/people/gregor.wolf3/blog/2005/05/27/use-crm-pcui-html-viewer-to-call-a-custom-url:///people/gregor.wolf3/blog/2005/05/27/use-crm-pcui-html-viewer-to-call-a-custom-url) or as Raj said you can use "Object Link Navigation" in order to start a new window with the PCUI layout where you can create another container with the web application you want to display (for more details have a look to the PCUI cookbook).
    Best regards.
    Armando Rodriguez.

  • Selection screen to appear when user clicks on radio button

    hi
    i have severla radio buttor in a radio button group
    i want that whne user clicks on first radio butter selection scren 1 eg as below to apper
    when use clicks on radio buton2 selection scree2 will appear please suggest
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE
    text-008
    PARAMETER : fyr2_fy type FIMC-RYEAR default 2008,
                 fyr2_cg type FIMC-CGYEAR default 2008,
                 fyr2_bk type FIMC-PERID default 7.
    SELECTION-SCREEN END OF BLOCK B1.
    regards
    arora

    Hi,
    At selections screen on that radiiobutton group.
    if radio_button1-status = 'X' (Active)
    call screen 'scereen number' or set screen 'nuymber'.
    else.
    call screen...
    endif.
    Reward if helpful.
    Best Wishes,
    Chandralekha

  • BDC - How to ignore skipped screens when user click on back button

    Hello all,
    I am working on a module pool program. From this custom transaction I am calling a standard SAP screen using BAC call transaction. I am calling this screen by skipping 2-3 screens and user can directly see the 3 screen on an event on my custom transaction.
    Now my issue is whenever the user want to back, he clicks on back button then user have to back from all the screens that I skipped.
    Is this any way by which if user click on back then he can directly go to my custom transaction.
    Please suggest.
    FYI..
    I am calling IA06 - Inspection characterstics screen from my custom screen using BDC.
    Thanks,
    Sanket Sethi

    Hi Jovito,
    I also think the same that it's not possible. Now my issue is how to get my requirement.
    FYI..
    To open Classification screen directly we have a function module CLFM_OBJECT_CLASSIFICATION. But if I want to open IA06
    Inspection characterstics screen we don't have any FM or API to do the same.
    So how will I get my requirement done. That why I use the BDC call transaction to open IA06 Insp. characterstics screen but here I am facing this Back issue.
    Please advice if there is any suggestion.

  • I am trying to update my itunes, but the internet stops responding when i click the download button??? Can anybody help????, I am trying to update my itunes, but the internet stops responding when i click the download button??? Can anybody help????

    I am trying to update my itu nes program, but the internet stops responding every time i click the download button???? Can anybody help???

    Did you ever figure out the problem? "Contact Software Manufacturer"?? That sounds ominous... I've got the same issue and I'm pretty durn aggravated right about now....
    Thanks!

  • Midi instrument stops playing when I move the mouse button

    Hi. Weirdest thing. All of a sudden, I started noticing some strange behavior with my midi input. 1) I can play a selection for a given software instrument, but, if I move the mouse, the midi input freezes (for lack of a better term). I am using logic 9, and it happens with whatever instrument I open.
    Bottom line, its as if touching/using the mouse freezes the midi input for about 3 seconds, as if the midi got interrupted by the mouse movement. This hasnt alwatys happened, and the midi output region, when I record, the midi region has a big 'X' in the display of the region. What is that, and what does it mean?
    Thanks.

    Hi, thanls for your response, and I looked into the event list, but, I dont have a graps of what it is you are suggesting I do. I am a newbie at this, so please bear with me, and break down that answer into a little bit more simplistic terms.

Maybe you are looking for

  • IIS Reverse Proxy with URL rewrite.

    Hi all, hoping to leverage the wealth of knowledge contained here. Any assistance would be very welcome. I'm having an issue getting a reverse proxy and URL rewrite working in IIS 7.0. I need to redirect all requests with a specific virtual directory

  • Links in iframe won't work

    I have iFrames in a number of my pages that have been working fine but now all of a sunnden none of the links or scrollong will work in Safari or Firefox. Any suggestions http://condosofclearlake.com/condos-for-lease-over_1000.html

  • How to make pictures on the iPhone 5 in full screen?

    Photograph on the iPhone 5. When viewing the photos on the iphone 5 at the bottom and top of the screen black bar. How to make photos to be full screen?

  • Placeholders in adobe forms

    Hi, We have placeholders in smartforms or scripts i.e &mara-matnr&.. in the same way do we have anything similiar like that in adobe forms? presently i'm doing that using drag and drop functionality, but that is giving some format problems.. points a

  • In Mail, where have the pull down menus gone?

    On the previous Mail, I would use the pull down menu to access "Take all accounts Offline", for example.  Now, after a recent update, there are no pulldown menus.