Stop flv when leaving a frame

i want to stop a video from playing,when leaving a frame
i tried to use SoundMixer.stopAll(); but it only stops the sound,
i think my video is still streaming in the background because im starting to notice performance problems when i go back and open the video again
the website gets very slow.
please help

I am sorry, my answer may be too late.
Anyway, I guess you have to stop streaming by calling close() method.
Have a look at
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/NetStream.html#include ExamplesSummary
Then you can call stream.close() to stop it.
Or if you have a flvPlayBack component on stage then you have to call stop() on that.
For an example, if flvPlayBack component on stage has been named as "myVideoObj" then you have to call myVideoObj.stop();
Also may be you have to set
myVideoObj.autoPlay = false;
Good luck
getnaleen

Similar Messages

  • Make video stop video when leaving a frame = problem as not all frames have this video

    I know how to make a video (instanced as showreel) stop when clicking on a button that that navigates to another section/frame, since otherwise I would still listen to that video while not visible. The problem is when I'm in another frame that doesn't have that video, when clicking on the menu to go to whichever other frame, it looks for that it to stop if it's playing and it and doesn't find it, and so there's an error.
    How can solve this? Maybe I should put an order saying something like if there exists a video in that frame instanced as sowreel, stop it, otherwise don't do anything as there is nothing to be stopped. Or assign the order to the frame (which is called motion), but I don't know how to do that, can someone help? The code I have is:
    import fl.video.VideoEvent;
    function onClick(evt:MouseEvent):void {
        if( showreel.playing ){
            showreel.stop();}
        gotoAndStop(evt.currentTarget.name);
    motion.addEventListener(MouseEvent.CLICK, onClick);
    web.addEventListener(MouseEvent.CLICK, onClick);
    logo.addEventListener(MouseEvent.CLICK, onClick);
    photo.addEventListener(MouseEvent.CLICK, onClick);

    all assets, as far as possible, should be removed from the display list and readied for gc when no longer in use.  that includes flvplayback instances.
    and yes, when you return to a frame or situation where you create an flvplayback instance, it will be created.  the removedfromstage event doesn't do anything except detect when something is removed from the stage:
    flv.addEventListener(Event.REMOVED_FROM_STAGE,f);
    function f(e:Event){
    flv.stop();
    that's it.
    for a typical beginner to intermediate coder, flv will be on one frame of the main timeline.   adding those lines of code will ensure that when you move from a frame that contains flv (and that code), any video playing in flv will be stopped so you won't hear it when you navigate to another frame.

  • Stopping .flv when user exits frame

    I know the solution to this is probably amazingly simple, but
    I've had very little experience using video in flash.
    I have a flash movie that allows the user to watch a video,
    but can skip it by pressing a button, moving them to another frame.
    The problem is, the video continues to play while the user is
    on a different frame, and the user can hear the audio from the
    video clip. Is there a way to stop the video when the play head
    moves into a different frame?
    I looked a the clear method, but that doesn't seem to do what
    I'm looking for.
    Any suggestions will be most appreciated.

    Not to be ungratful or anything, but the nature of this
    problem is time sensitive. I really don't have time to watch an
    eight part vid tutorial, otherwise I'd be doing so with my
    Lynda.com account. Plus after downloading the .flv it won't play
    after I've loaded it into a Flash file. Thanks tho Nick, this looks
    like a resource I will be checking on in the future.
    If anybody can just offer me a suggestion to my problem that
    would be great. Much thanks.

  • Remove MC when leaving the frame

    Hi I have a frame that AS this:
    this.createEmptyMovieClip("news",1)
    news.loadMovie("news.swf")
    when i click on a btn and gets to another frame this news.swf
    file still stays on top of other elements.
    is there a way to remove it when i'm leave the current frame?
    (thanks in advance)

    heheh kglad, thanks again. that's what i thought and it's
    good to have you to back that up.
    actually i decided to load movie into a pre-created empty mc
    instead of using createEmptyMovieClip
    then the swf disappear after changing frame. guess that
    solved the problem.

  • Listeners - Entering a Frame and leaving a Frame to Call a function

    OK, I am trying to get the following functions to load and unload the video to my main timeline when I go in and out of a frame. I tried on Enter_FRAME but it is now working properly and load many instances.
    What are the listeners I need to do to call the functions of oCoach when enetering a frame and fclickCV when leaving a frame? Many thanks in advance!
    //========Scenario Movie===================
    var pCoach:coach_mc = new coach_mc();
    var spriteCoach:Sprite= new Sprite();
    spriteCoach.x = 5;
    spriteCoach.y = 30;
    //----------open scenario---------
    function oCoach(myevent:MouseEvent):void{
         stage.addChild(spriteCoach);
         spriteCoach.addChild(pCoach);
        pCoach.myVideo = myVideo1;
         pCoach.my_ns.play(myVideo1);
         coach_btn.visible = false;
    //     pCoach.scenario_txt.htmlText = myScenario;
    stage.addEventListener(Event.ENTER_FRAME,oCoach);
    //coach_btn.addEventListener(MouseEvent.CLICK,oCoach);
    function fclickCV(myevent:MouseEvent):void{
         coach_btn.visible = true;
         pCoach.my_ns.close();
         stage.removeChild(spriteCoach);
         pCoach.removeChild(videoVO);
         pCoach.clearInterval(loaded_interval);
    pCoach.closeCoach_btn.addEventListener(MouseEvent.CLICK,fclickCV);
    forward_btn.addEventListener(MouseEvent.CLICK,fclickCV);
    back_btn.addEventListener(MouseEvent.CLICK,fclickCV);

    enterframe and exitframe are loops.  they aren't one time events like their names suggest.
    to execute code upon entering a frame, attach the code to the frame or, better, create a function containing the code and call that function from the frame.  to execute code upon exiting a frame, create an object that is removed from the display list when you exit the frame.  you can then apply a removedfromstage listener to the object to call a function that will execute when exiting the frame.

  • Stop FLV from playing upon leaving frame.

    Maybe someone has some insite on this before I open an artery. I have a timeline, seperated into sections. The navigation targets frame labels. On one of those keyframes there is a flv. When you play that video and then navigate to another frame without stopping the video, it continues to play. I've tried giving it an instance name and adding a stop action to it that resides in the button functions so when it navigtaes to another frame it would stop. However, when  I click on any button and the movie is not currently playing, I  get a error message that reads TypeError: Error #1009: Cannot access a property or method of a null object reference. I assume it is looking for something that is not currently there. It has been suggested that I use the SoundMixer.stopAll() but that removes any background music currently playing.
    Do I need some kind of conditional statement that detects if the flv is currently playing?
    Can FLV be controlled with a simple instancename.stop() ?
    Dazed and confused

    use that instance name (eg, flv) and in the frame where flv exists, use:
    flv.addEventListener(Event.REMOVED_FROM STAGE,f);
    function f(e:Event):void{
    flv.stop();

  • 2 out of 6 imported flv files pausing on frame 1 when published

    Hi,
    I have six Scenes, each scene has an imported FLV file.
    I have a 6 button menu that works fine when clicking from one scene to the other.
    The problem is is that videos 1 to 4 play fine when I switch to the scene, but FLV files 5 and 6 just stay paused at frame 1.
    If I test the Scene using Ctrl+ALT+Enter, the Scenes work fine.
    But Only if I either hit Ctrl+Enter to render the whole project, or if I publish the file, do the FLV files pause on frame 1.
    All 6 videos are coded exactly the same way.
    Any suggestions please?

    I'm wondering now if it some sort of memory thing or SWF limitation thing
    The Scenes are Lessons 1 to 6
    If I publish the SWF, then Lessons 1 - 4 play fine, 5 and 6 just sit at their frame 1 as if paused.
    If I move the scenes around to say: Lessons, 5, 6, 1, 2, 3, 4
    then 5, 6, 1 and2 play but now 3 and 4 are paused.
    so it seems it affects the last 2 of the six scenes.
    any one got any idea on why this might be happening?

  • Why do I get the 'critical stop' sound when I leave the firefox browser - doesn't happen with explorer?

    Why do I get the 'critical stop' sound when I leave the firefox browser. This doesn't happen when using internet explorer?

    Do you mean that there is a problem with closing Firefox?
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    Try to use "Firefox > Exit" (Windows: Firefox/File > Exit; Mac: Firefox > Quit Firefox; Linux: Firefox/File > Quit) to close Firefox if you are currently doing that by clicking the close X on the Firefox title bar.

  • Detecting when you leave a frame

    How can i detect when a particular frame is left? i.e. The
    user is viewing fram x, they click one of several buttons or
    perform a particular action which causes the swf to move to a
    different frame how can i detect when it exits the original frame
    x?

    I'm not sure I quite understand your question ... if the user
    clicks a button that will move the playhead ... the playhead will
    leave the frame then, at that time, playhead gone ...?
    unless you have something else that runs before it moves the
    main timeline's playhead ... but in that case then, at the end of
    that action is when the palyhead will leave the frame, place a call
    there to the item that needs notification ...? You don't really
    need anything to detect it.

  • Stop videoplayback in flash on frame exit?

    Is there a way to stop video playback from a video when I leave the frame?
    On the first frame a video plays, but I when click the button to goto the second frame, it stills plays sound. I can't add a stop action like flv_mc.stop because on the next frame there is no video so the flv_mc does not exist. I tried putting it on the frame but outside the stage but it disrupts the tweens I have on the stage. I even tried putting the video player inside a movie clip with two frame, one with the vido player and a blank one, to see if I could rig it to exist on both main frames but on the one it would be stopped and set to a blank frame but the video player doenst work when nested 2 movieclips deep. The video player is not on the main timeline but inside of a content_mc and it works put putting it inside of its own movieclip broke it.
    I have also tried REMOVED_FROM_STAGE and that works but give me output errors. I have buttons (with gotoandStop actions) and only two of them have videos. At first I used removed from stage and copy and pasted on the frames the buttons navigate two, but it gave me and error of duplicate function, so I have three functions for REMOVED_FROM_STAGE. And they seemingly work and then I get output errors saying:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
              at Woomer_DisneyCruiseUPDATE_fla::content_mc_12/frame2()
              at flash.display::MovieClip/gotoAndStop()
              at Woomer_DisneyCruiseUPDATE_fla::MainTimeline/goOne()
    The file name is Woomer_DisneyCruiseUPDATE_fla.
    BTW the buttons are on the main timeline and they control navigation on the inside of a movieclip called content_mc

    That gave me errors because is said it was duplicate function even though it was on different frames, and also o nthe frame without the video it didn't know what to stop.
    I found away around it though. I set variables for each button command and then on added and extra frame inside the content that function as a navigation. On this frame it stops the video and the checks boolean variables on the main timeline set by the buttons. It basically checks to see which button was pushed and then finishes the button command by going to that frame. Basically it takes a detour rather than going directly to the disired frame, on that detour frame it stops and videos that are playing and uses if/then statments to check for boolean that alternate based on the button that was pressed in the main timeline.
    this is an example:
    Main time line-->
    var my_btnOne:boolean=true;
    var my_btnTwo:boolean=false;
    my_btn.addEventListener(MouseEvent.CLICK, buttonGo);
    function buttonGo(e:MouseEvent):void{
         my_btnOne=true;
         my_btnTwo=false;
         content_mc.gotoAndStop(nav);
    my_btnTwo.addEventListener(MouseEvent.CLICK, buttonGoTwo);
    function buttonGoTwo(e:MouseEvent):void{
         my_btnOne=true;
         my_btnTwo=false;
         content_mc.gotoAndStop(nav);
    inside content_mc:-->
    if(my_btnOne){
    gotoAndPlay("two");

  • While trimming a clip in my timeline, the entire timeline moves with my trim. How can I stop that and leave a gap in-between clips?

    While trimming a clip in my timeline, the entire timeline moves with my trim. How can I stop that and leave a gap in-between clips? Also when I use my blade it only leaves a dotted line in the clip. How can I make that a solid line? I do a lot of flickering in my videos and don't need that some what of a snapping effect while I edit. Please help me someone. I believe i upgraded from FCP 10.0.1 to 10.0.3 and before it never did this.

    Mark an In point and an Out point (which creates a Range) and hit the forward delete key (Replace with Gap.) On a MacBook, you'll probably need to hold down the Fn key and type the Delete key (or, I think you might be able to use Shift-Delete as the same command). On an iMac/Mac Pro keyboard, it's the key just to the left of 'end' or the next key above the left arrow key.
    You can use the Range tool (hold down the R key and click drag over your clip) or the Blade tool to cut at the in and out (then select the cut and replace with gap).
    You can also go into Commands > Customize (command-option-K) and assign a different key to Replace with Gap.
    If you need to ripple edit the ends (cut), create a small section that is Gap, and hold down the T key while you use the mouse to click drag both ends (double sided trim cursor) of the cut.
    Don't worry about the dotted line blade... That just lets you know that the frames on either side of the cut are continuous, or sequential — nothing has been moved yet. Once frames from either side of the mark have been cut, it becomes a full fledged cut resembling a separate clip.

  • Removing event listeners on leaving a frame

    Hi team,
    I am having a bit of trouble, I have l modded some code that I am really happy with, it makes buttons bounce around for the user to try to click on when entering a certain frame...
    Problem.. I notice tha the code adds eventlisteners ENTER_FRAME to make this work, when you leave that frame there are now problems with null objects becuase the listeners are still on but the objects are not there anymore..
    Ok so attempted solution - I can use a currentLabel on the main timeline to check if the correct frame is reached then use a function if (label is x) put listeners on else take them off... works but then I have to have these objects hidden on the timeline  and then add visible=true/false to my framelabel listener.. This works but part of my functionality here is that these movieclips that move are buttons that the user clicks on and they explode and dissapear- but now they dont because I have a code that says on that frame they should be visible..
    The only thing I can think of is to have a blank frame at the end of the explode and put a stop on it.  Then add a gotoAndPlay(1) into my frame label code.  Seems very ugly, you guys got a better way?  Can I remove eventlisteners on leaving a frame?  Is there a code like LEAVE_FRAME????
    cheers
    sub

    yes, it goes in the keyframe where those movieclips exist.  if the movieclips exist on a main timeline frame, that's where that code should be placed.
    that code should execute when the movieclip exists.  the listeners wait for the movieclips to be removed from the display list.  that happens when you navigate away from the frame that contains those movieclips.

  • Can I make a dynamic video player stop just by exiting the frame and entering a new one?

    Ok so I have a flash presentation with a video clip which I am playing dynamically using a URL netStream. The problem is not getting it to play but rather getting it to stop playing. If I click the stop button, it stops, But if I just navigate to  a new frame, the video disappears but I can still hear the audio. (the only reason it disappears is because i used "video.visible = false" on all other frames other than the one I need it to play on. Additionally, If I navigate to a new frame while the video is playing, I cannot stop it or restart if I return back to the frame that the video is located on. Its like all my video control buttons are rendered useless if I leave the frame while it is playing. Do I need some sort of eventlistener or custom function? I hope I explained that well enough.
    Here is my code if anyone has any suggestions.
    Thanks!
      //video code
      var video:Video = new Video(480,204);
      video.y = stage.stageHeight / 2 - 278 / 2;
      video.x = stage.stageWidth / 2 - 290 / 2;
      addChild(video);
        var nc:NetConnection = new NetConnection();
      nc.connect(null);
      var ns:NetStream = new NetStream(nc);
      ns.addEventListener(NetStatusEvent.NET_STATUS, onStatusEvent);
      function onStatusEvent(stat:Object):void
      trace(stat.info.code);
      var meta:Object = new Object();
      meta.onMetaData = function(meta:Object){
      trace(meta.duration);
      ns.client = meta;
      video.attachNetStream(ns);
      btn_playvid.addEventListener(MouseEvent.CLICK, playFunction);
      function playFunction(evt:MouseEvent):void
      ns.play("assets/movie.mp4");
      btn_stopvid.addEventListener(MouseEvent.CLICK, stopFunction);
      function stopFunction(evt:MouseEvent):void
      ns.pause();

    You need to call your stopFunction if you leave the frame as the video will continue to play. When you come back to this frame, you're creating a new video instance and NetStream, etc... If you place your video at a random x,y you should see that you have multiple video instances. You need to separate your init code from your control code.

  • Stop Video when moving to another "state"?

    Hello,
    I am not sure if this is a Flash Builder topic or a Flash Catalyst topic or I am guessing it is both.
    I  have a Catalyst that contains multiple flv clips. I am discovering that  when you play a video and then you decide to navigate to another  "state" or "location" in my case, that the video pauses. If you then  return to that state the video will start back up where it was paused.
    I am trying to figure out how to tell the program to stop all or any flv when moving to another state.
    Any help here would be great.
    Thank you.

     

  • Working alternating with iPhoto and FCE tgrying to import pictures from iPhoto into FCE suddenly all my 22300 pictures disappeared leaving empty frames. Does somebody know where the pictures could have gone and how can I get them back into iPhoto? Lothar

    Working alternating with iPhoto and FCE tgrying to import pictures from iPhoto into FCE suddenly all my 22300 pictures disappeared leaving empty frames. Does somebody know where the pictures could have gone and how can I get them back into iPhoto? Lothar

    The ! turns up when iPhoto loses the connection between the thumbnail in the iPhoto Window and the file it represents.
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

Maybe you are looking for

  • Path Finding Question

    Im re-familiarizing myself with Java and have decided to crack at the Knights Tour puzzle. Now my code already finds one path (if possible) for every starting path, or returns nothing if it hits a dead end. However id like to expand it to find all pa

  • Production order current status

    Hi All, Could any one of you let me know where can I know the current status of a produciton order, like if it is in release status or technically completed, I remember the there is function module to read the status but I do not remember it now. Kin

  • HATE The new Verizon front page on Firefox

    WHY WHY WHY have you made it so I can't log in to my email account from webmail.verizon.net without having to go through this other page that makes me log in a second time????  I don't want to see this other stuff, I just want to go to my email accou

  • Which release is better for Spain

    Hi everyone, I´m going to flashing my N900 and I want to know with release is better for Spain, the Global or the UK? Thanks

  • Why does adobe camera raw keep saving images with the incorrect white balance?

    I am having an issue when I edit images.  here is the scenerio: I choose 50 Raw files and open them in Camera Raw. I edit each individually - many of them have different white balances. Once I have each image how I want them, I select all and click d