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.

Similar Messages

  • How can i delete an icloud accout from iphone 5 (ios 7.0.4)and insert a new one ???

    how can i delete an icloud accout from iphone 5 (ios 7.0.4)and insert a new one ???

    You'll need to contact the previous owner to get them to remove the account.
    There is no way to bypass this security feature. If you can't contact the previous owner you have wasted your money and have a phone you'll never be able to use.

  • Why do my animated themes only work the first time I open the window? Every one that I have tried stops animating if I close the window and open a new one.

    The headline pretty much sums up my problem. Basically, I picked a few different animated themes to try out in the Add-Ons section to personalize my browser window. They look great initially, and in the window that is open when I actually enable the theme. However, if I close that window and open a new one, the theme is stationary and no longer animates.

    Sorry......I was just too impulsive. ( Maybe because it was 4 AM at Taiwan, and I was still trying to solve the problem= = )
    Although to install the add-on "Personas Shuffler" can solve the problem to me, I don't think it was the BEST solution. This evening, I read why the add-on "Personas Shuffler" was made, and found that the BEST solution is:
    1. Open a new tab, and type "about:config" at the URL bar, then search for "lightweightthemes" with the filter.
    2. Change the values of "lightweightThemes.persisted.footerURL" and "lightweightThemes.persisted.headerURL" from true to false( by double click on them).
    3. After doing so, restart Firefox and you will see it works! You don't have to install any add-on.

  • I have just upgraded from the old G5 to a new one, however I can't log and capture on the newest FCPs off my Sony Z1.. please help, deadline coming soon

    I have recently just upgraded from my old white powerpc G5 which did not allow me to edit in HD and I had to down convert all my footage to edit in DV. I have  bought the newest FCP studio, and I had to order a new firewire as my new desktop does not take the old one that I had before. The new firewire that I have which is the only one that fits into my iMac from my sony Z1 is a Firewire IEEE1394-B (800) 9 pin to 4 pin .
    My Mac : Processor- 2.8 GHz Intel Core i5
                   Memory- 4GB 1333 MHz DDR3
    All my settings are set to HD and the ilink convert is off, and VCR is set to auto. Why is it not reading my Z1???
    Please someone help me, i have been using FCP for years now and have not come across this problem before...

    camera not recognised in system profiler just says maximum speed up to 800mb/sec
    still says "unable to locate the following external devices:
                   HDV (1440x1080) 50i" in FCP when i try easy setup
    Try a different cable first ... it might be a connection problem
    VCR HDV/DV- Auto
    Component- 1080i/576i
    i.link convert- off
    down convert letter box
    A/V-DV OUT- off
    Bit of guesswork here - haven't used a Sony in a while - but try these:
    • HDV/DV to HDV
    • downconvert off/none?
    mish

  • Can you make a movie for more than 2 minutes on an ipad and save it on a flash drive

    Can you make a movie for more than two minutes on the ipad and sve it on a flash drive using windows XP

    Using Apple's camera connection kit, you can use a flash drive to IMPORT photos and videos. However, you can't EXPORT any type of file to the flash drive.
     Cheers, Tom

  • Why i can't make a normal video call over my cellular operator using by iphone 4s ????!!!! is it possible that if my mobile is iphone so i can not contact (Video Call - or Send Files over Bluetooth ) people do not have iphone ??????!!!!!!!!!

    why i can't make a normal video call over my cellular operator using by iphone 4s ????!!!!
    is it possible that if my mobile is iphone so i can not contact (Video Call - or Send Files over Bluetooth ) people do not have iphone ??????!!!!!!!!!
    i'm still looking for solution, but if i there is no solution so i will throw My Own iPhone 4S in the nearest Trash.
    (I had got a big problem and thanks for Nokia saved me. and if i don't care about apple products i will never send to you this, so kindly find solution or people in middle east will stop using iphone)

    No clue why you cannot make video calls over your cellular operator... have you tried contacting them?
    If you're referring to FaceTime, it is currently limited to Wi-Fi only.
    Sending files via Bluetooth is not a supported feature of the iPhone or iOS.  A simple search of the web or these forums would have made that abundantly clear.
    Threatening to throw away valuable items in these forums only serves to make you look less than intelligent.  No one here is an Apple employee, we are all users like yourself.  As such, we could care less what you do.  If you choose to be stupid, that's up to you.
    Educate yourself and stop whining.

  • How can I make my flash video load faster?

    How can I make my flash video created in Flash Pro CC load faster, as of now it takes 2 minutes to load?

    This is the source file for video.php:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
    <title> VOPVIU Video
    </title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style type="text/css" media="screen">
    <!--html, body { height:100%; background-color: #666666;}
    body { margin:0; padding:0; overflow:hidden; }-->
    #flashContent { width:750; height:600; }
    </style>
    </head>
    <body style="background-color:#6E9BD2;">
    <center>
    <div width="100%" height="100%">
    <h3 align="center"> Victims of Political Violence in Uganda <br/> (VOPVIU)
    </h3>
      <table border="0" width="52%">
       <td width="80%" align="center">
        <em>
         <font color="#FFFFFF">
      <strong>
      <p> Victims Of Political Violence in Uganda
      </p>
    Number of views 344       </strong>
      </font>
        </em>
       </td>
       <td width="20%" align="right">
        <form action="vopviu.php">
         <div>
      <input type="submit" value="Exit Video">
      </div>
        </form>
       </td>
      </table>
      <table width="70%" height="70%" border="0">
      <td width="70%" height="70%">
      <center><div id="flashContent">
    <center>
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="750" height="423" id="faddu_vopviu" align="middle">
    <param name="movie" value="faddu_vopviu.swf" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#666666" />
    <param name="play" value="true" />
    <param name="loop" value="true" />
    <param name="wmode" value="window" />
    <param name="scale" value="showall" />
    <param name="menu" value="true" />
    <param name="devicefont" value="false" />
    <param name="salign" value="" />
    <param name="allowScriptAccess" value="sameDomain" />
    <!--[if !IE]>-->
    <object type="application/x-shockwave-flash" data="faddu_vopviu.swf" width="750" height="423">
    <param name="movie" value="faddu_vopviu.swf" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#666666" />
    <param name="play" value="true" />
    <param name="loop" value="true" />
    <param name="wmode" value="window" />
    <param name="scale" value="showall" />
    <param name="menu" value="true" />
    <param name="devicefont" value="false" />
    <param name="salign" value="" />
    <param name="allowScriptAccess" value="sameDomain" />
    <!--<![endif]-->
    <a href="http://www.adobe.com/go/getflash">
    <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
    </a>
    <!--[if !IE]>-->
    </object>
    <!--<![endif]-->
    </object>
      </center>
      </div>
    </center>
    </td>
    </center>
    </table>
    </div>
    </center>
    </body>
    </html>

  • How can I make my Apple tv remote stop interacting with my MacBook and my iMac? Everytime I press the reote, the sound will go up or down on my computers or they will wake up.

    How can I make my Apple tv remote stop interacting with my MacBook and my iMac? Everytime I press the reote, the sound will go up or down on my computers or they will wake up.

    Welcome to the Apple community.
    If you don't want to use a remote with your computer the easiest thing to do is just to turn the IR off. (System Preferences/Security/General)
    If you still want to use your computer remote then you must pair your computers remote with the computer AND the Apple TV remote with the Apple TV.
    To pair a remote with a device hold down the menu and FF buttons together for six seconds or until you see a chain icon on screen (best take the computer into another room, or turn it off, when you do this)

  • Why are the video player change size when resizing the window a little?

    When I use the video player to show mp4 files, the "player window" changes size if I change the firefox window. Why and how do I do to get the correct size direct (640x480)

    Hi john3,
    This can be the resolution of the screen or the site detecting screensize, do you have a url we can take a look at to determine what's going on?
    Thank you!

  • Can a Lightroom adjustment brush draw a straight line by clicking the start and stop points?

    Can a Lightroom adjustment brush draw a straight line by clicking the start and stop points?

    studioMac wrote:
    I'm trying to selectively adust areas of an image in Lighroom. eg: a window frame in an architectural photo, and so being able to make straight lines with the adjustment brush would be very useful.
    I agree it would be useful. It's something that's been asked for. The best thing is to keep requesting at the Lightroom feature request forum

  • How can I make a intro page for my website, then after the intro has run make the page automatically change to my we site home screen

    how can I make a intro page for my website, then after the intro has run make the page automatically change to my website's home screen

    You can do this using a meta refresh but the problem is you have to add it to the html file for the page very time you publish changes.
    A better way is to create a splash page and upload it to the server outside of the folder produced by iWeb. Example HERE.
    The meta refresh is added to the head section of the html file...
    <meta http-equiv="refresh" content="32;url=http://www.domain.about.com/Page-Name.html">
    The delay time in seconds is marked in blue and the URL to the redirect page is in red.

  • Can i make a book in iPhoto without using any of the built in layout templates, which are too limiting when i have already cropped my pictures to show just what I want. Ideally I just want to drag and drop and arrange and size the pictures myself

    Can i make a book in iPhoto without using any of the built in layout templates, which are too limiting when i have already cropped my pictures to show just what I want. Ideally I just want to drag and drop and arrange and size the pictures myself

    If you have Pages you can create customs pages for your book as TD suggested. If you have Pages from iWork 09 or 11 this app will add 80 or so additional frames to those offered:  Frames and Strokes Installer. Don't use it on the latest Pages version, however.
    This tutorial shows how to create a custom page with the theme's background: iP11 - Creating a Custom Page, with the Theme's Background for an iPhoto Book.  Once the page is complete to get it into iPhoto as a jpeg file follow these steps:
    Here's how to get any file into iPhoto as a jpeg file:
    1 - open the file in any application that will open it.
    2 - type Command+P to start the print process.
    3  - click on the PDF button and select "Save PDF to iPhoto".
    NOTE:  If you don't have any of those options go to Toad's Cellar and download these two files:
    Save PDF to iPhoto 200 DPI.workflow.zip
    Save PDF to iPhoto 300 DPI.workflow.zip
    Unzip the files and place in the HD/Library/PDF Services folder and reboot.
    4 - select either of the files above (300 dip is used for photos to be included in a book that will be ordered).
    5 - in the window that comes up enter an album name or select an existing album and hit the Continue button.
    That will create a 200 or 300 dpi jpeg file of the item being printed and import it into iPhoto. For books to be printed choose 300 dpi.

  • How can I make albums from events then delete events without deleting the album?

    Hey, just need a little help!
    How can I make albums from events then delete events without deleting the album?
    Many thanks

    You'll be more likely to get help with this if you ask in the iPhoto forum:
    https://discussions.apple.com/community/ilife/iphoto
    You'll need to tell people what version of iPhoto you have so they can give you correct advice.
    Regards.

  • How can I make an external link (to a different folder) from the main menu?

    How can I make an external link (to a different folder) from the main menu?

    If the folder is outside the Muse page, you will have to insert manual HTML to define a more complex URL like e.g. ../_stuff for going one level up and then into a folder called "_stuff" The deeper you are in the hierarchy, the more ../ you will have to add to climb up.
    Mylenium

  • I purchased CS6 Design & Web Premium.  It appears it is the Middle East Hebrew English version???  How can I make it stay in ENGLISH.  It keep reverting to Hebrew and type runs right to left?  NOT what I asked to purchase?

    I purchased CS6 Design & Web Premium.  It appears it is the Middle East Hebrew English version???  How can I make it stay in ENGLISH.  It keep reverting to Hebrew and type runs right to left?  NOT what I asked to purchase?  [email protected]

    Try setting the text direction with no files open. It should stick for all new files.

Maybe you are looking for

  • CUP 5.3: risk analysis in workflow impossible due to web service performance?

    Hello experts, We are facing a huge challenge within a AC 5.3 implementation. Here, AC has been used successfully with CUP and RAR for quite some time now. However, the RAR analysis has not yet been integrated into the CUP workflow. We would like to

  • IPad 2 now only displays in landscape mode.

    My iPad 2 now only displays in one landscape mode. It won't change the screen when I rotate the iPad. Is this an iOS6 glitch?

  • 890GXM-G65 AMD-V missing from BIOS

    Hi Everyone, I have been trying to locate the option in BIOS to enable AMD virtualization on my CPU. My AMD Phenom II X4 965 supports virtualization but the option in BIOS is missing. Does anyone know how to get around this? or is there a BIOS update

  • How do I only export the latest version?

    Short of using keywords and shifting to albums, is there anyway I can export ONLY the latest version of the photos in a project? If I ask to export the version I get version and master (in fact I get all versions if I don't delete previous versions..

  • Where is Facebook on Mountain Lion?

    I got the new OSX Mountain Lion and i cant find Facebook on it, please help. <Edited by host>