Play / pause problem

if i click 'Play' Button video playing normally, after i click 'Pause' button video pause,  next i click 'Play' Button video playing from starting point.
what is the problem
solution pls......
Code:
var video:String = "http://www.hagane.us/as/flv/video.flv"
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
theVideo.attachVideo(ns);
ns.play(video);
ns.onStatus = function(info){
          if(info.code == "NetStream.Play.Stop") {
                    ns.seek();
                    ns.close();
                    mid_play._visible = true;
//Button Control Functions
play_btn.onRelease = function () {
                                                  ns.play(video);
                                                  mid_play._visible = false;
mid_play.onRelease = function () {
                                                  ns.play(video);
                                                  mid_play._visible = false;
pause_btn.onRelease = function (){
                                                  ns.pause();
                                                  mid_play._visible = true;
stop_btn.onRelease = function (){
                                                  ns.close();
                                                  mid_play._visible = true;

You should look in the help documentation regarding both the pause and the play methods of the NetStream class.  You can probably solve this yourself in doing so if you take the time to read what they involve.
The pause method info indicates:  "The first time you call this method (without sending a parameter), it pauses play; the next time, it resumes play. You might want to attach this method to a button that the user presses to pause or resume playback."
That says you might try using pause() again in your mid_play button instead of play() because calling it a second time will resume play.
If you need to use the play method for some reason (I don't see why you would), the play method has more arguments it can take, one being the "start" time (at what time into the video to start it playing).  The class also has a time property that you can read and assign to a variable to help remember where you stopped it.  So if you save the time value when you pause the video you can restart it using that time value as a secong argument.... ns.play(video, atTime);

Similar Messages

  • Toggle button (play/pause) problem when using smart shape

    Hi,
    I am utilizing smart shape as button. I have one play button, and pause button, on top of each other. When "play" is clicked then I display "pause" button, and hide "play" button. Vice versa for pause button. And, I set the buttons to be displayed in the rest of the project. The problem is that buttons are working so irregularly. In some slides they may stop toggling, and when I do go back to previous or next slides, they may start working again, but they may mul-function in other slides then.
    Did anybody run into this problem? How can I solve it?
    P.S. I cannot user widgets, because of incompatibility with html5.

    Thanks for sharing your blog. I actually did whatever you explained in your blog. I created advance actions. I labeled the buttons, btn_Play, btn_Pause, respectively. And, in "Play" advance action, I added the following command "Show -> btn_Pause", "Hide -> btn_Play", and vice versa for "Pause" advance action. It is working, but irregularly.
    As the example in your blog, If I test it in the single slide, it is working great. However, if I do consequetive transitions to other slides fastly, it sometimes stops working (for example, when I click "Play" button, the "play" button does not disappear, and "pause" button does not show up). I know this sounds so weird!
    Also, another point is that I did not use master slide, I just put them in the first slide, and set them visible for the rest of the project. I see that you did not recommend this practice.

  • ITouch play/pause problem, really confused

    Hey everyone, I need some help here. I have a 3rd gen Touch (no longer under warranty by the way). The thing is so wierd playing music. Depending on the source it may or may not play correctly. Now I have to mention that it does have an apparent faulty headphone jack, which may need replacing, but maybe not. Here's a few examples: #1. If it's playing through it's own speakers, it is perfectly fine playing music. #2. If it's playing through headphones, the music runs fine, but sound will come out all messed up, only through one side, sounds like it's in the background, etc. Obviously a headphone jack issue. #3. If I put it on a small portable iHome speaker or anything running off batteries it sounds and runs perfectly fine. And here's where it gets wierd for me, #4. In my car, when I put it through a cassette adapter the thing sounds perfectly fine, but after 10 seconds or so it will randomly pause itself. Then I hit play again and it goes for 2 or 3 seconds and pauses again and again. I have no idea what it going on. I don't know if that pausing could be contributed to the headphone jack?? Other than these music issues, the Touch runs perfectly. I have iOS 5.1.1 running on it, as updated as it can be. I'm insanely confused, if anybody could help or recommend a solution it would be extremely appreciated. Thanks everyone for reading.

    Hi Thomas,
    I am confused; what are you asking? Is this a statement or is there a question behind it. Did you try resetting (Knowledge Base Document #300595 on Resetting iPod Shuffle). Playing Songs on Your iPod shuffle says
    "Using the switch on the back
    On the back of your iPod shuffle, you will find a switch with 3 positions: Off, Play in order, and Shuffle songs. If you want to play the songs as they appear in iTunes, choose the Play in order position. To have them shuffle, select Shuffle songs. When you are done, turn your iPod shuffle off by moving the switch to the off position. You will know your iPod shuffle is off when the green stripe is not visible."
    Try updating you iPods Software. You may also want to upgrade your system software to 10.3.9 (Mac OS X 10.3.9 Combo Update).
    Jon
    Mac Mini 1.42Ghz, iPod (All), Airport (Graphite & Express), G4 1.33Ghz iBook, G4 iMac 1Ghz, G3 500Mhz, iBook iMac 233Mhz, eMate, Power Mac 5400 LC, PowerBook 540c, Macintosh 128K, Apple //e, Apple //, and some more...  Mac OS X (10.4.5) Moto Razr, iLife '06, SmartDisk 160Gb, Apple BT Mouse, Sight..

  • A problem with the Play/ Pause control button in a quiz project

    Hi,
    I have a probem with the play/ pause button in this project,
    it is a quiz project, the problem is when I click the pause the
    project does not pause and keep working ? Any idea why?
    http://www.megaupload.com/?d=995I8WX9
    Thanks

    If you have bought you Macbook within 90 days or have bought AppleCare you can call them for free and ask them what you should do. 1-800-MY-APPLE

  • Play/pause button problem on

    So sometimes the button just doesnt work. I finally figured out when and why. It only happens when I have my Belkin FM tunecast 2 transmitter plugged into it. Once I take that out and put the headphones back in, the play/button works just fine. Why that happens you ask? I have no idea!!!

    I also have a TuneCast II and have no issues with it. That is unless I unplug it. Then I get the same result as unplugging the headphones.
    Here is what I posted a couple days ago in a topic titled.
    [Micro] Back Button Only Works w/ Headphones Attached
    OK. Here is what I have noticed as of late regarding this issue.
    . If I turn on the Micro WITHOUT anything plugged into the headphone jack I get this. All buttons are NON responsi've for a couple of seconds. Then All but the Play/Pause button become responsi've but at a lesser level than my prefs are set for. The Play/Pause button WILL not do anything. It is not recognized.
    2. If I plug something into the headphone jack all buttons then become fully responsi've at the level I have set in the prefs. Play/Pause functions normally.
    3. If I then remove the cable from the headphone jack the Play/Pause button once again becomes NON responsi've and the other buttons return to a less responsi've state.
    4. Reinserting a cable results in full responsi'veness again.
    Is this intentional in the firmware? It seems to make sense that if nothing is connected to the headphone jack then there realy is NO reason for the Play/Pause button to function or any button for that matter. Is this possibly a measure to preserve battery life incase of accidental power on?
    Oh. I have done similar tests while connected to my PC via only USB and had similar results. It seems that the Micro is only fully responsi've when a cable of some sort is connected to it.
    Anyone have any ideas? I would especially like to hear from Jeremy or Cat.Message Edited by MicroZealot on 04-2-2005 :5 PMMessage Edited by MicroZealot on 04-2-2005 :53 PM

  • ?ipod no longer turns off by pressing and holding play/pause on click whee

    ipod had turned off before, but now cannot turn it off. It continues to stay on. I've tried to use hold switch to see if that helps, but ipod still won't turn off, and it uses up my battery. hold play/pause button doesn't seem to work?

    Did you try resetting it? I had the same problem with my 30gb video and it worked.

  • IPod 5.5G Video, 30GB, No Sound Audio, Play/Pause Won't Shut Down, etc.

    Even though I have marked this topic as a question, it is more of a heads up for those having problems with Sound and Audio on the 5th Gen (Video) iPods.
    I was having audio problems like many others are describing and took it upon myself to look into the cause. I found that there is a problem with a flat ribbon cable that connects to the main board of the iPod. The issue is that there are very thin, gold plated traces of copper on a somewhat thin plastic backing which fits into a ZIF (i.e. Zero-Insertion-Force) connector.
    At issue is the amount of bending of the plastic cable when a clip on this ZIF connector is 'locked'. It seems that on some of these plastic ribbon cables, these small gold plated copper traces will crack and break, causing sound to come only from one channel or the other, or for scratchy sound, and even possible problems with the Hold switch. (I removed my Hold/Headphone Jack cable assembly and confirmed this under a microscope.)
    I don't know if the cracking is immediate upon the connector being locked, or if there is some length of time before cracking will occur. I also cannot say if this is truly a problem with the ZIF connector force, or the copper on the ribbon cable. There are different problems if the copper is too thin or too thick. Other problems can cause the copper to break, have problems adhering to the plastic 'ribbon', etc.
    Since this cable not only includes Left/Right Audio, but the Hold switch, units with this problem may not only have audio problems, but apparently have problem with the Hold switch not functioning properly and issues with Holding down the Play/Pause part of the Click-Wheel to power down an iPod. Another issue appears to be that the 'Clicking' noise of the Click-Wheel either becomes quiet or disappears altogether.
    Ok, here's the question part...
    Apple, do you have any knowledge of this issue? Is it systemic, or just several isolated units? Since the 5.5G is not in production, is it out of the question to hope to get a discounted repair or replacement part? What would your typical response be?
    (Note: I had an AppleCare contract that apparently doesn't run out until October of this year, but because I took it upon myself to open the unit I understand that this is now voided.)
    At this point I am thinking of buying a replacement Hold/Audio ribbon cable to install myself, but am very concerned that the part I purchase may also have these issues.
    Sincerely,
    Nobuo

    After all my worry, concern, and consternation, I took my own advice and went to see the Genius Bar at the local Apple store this afternoon on my way home from work, just to see if they knew about this issue. At least I was expecting they would tell me I was out of luck for opening the iPod, at most I thought they would take it in for service and then let me know they found I had opened it and that I'd have to either pay for service, buy a new one, or that they'd simply be returning it as is. Instead they offered to replace my iPod.
    I don't know if this was because I was starting to make other customers nervous (talking loud is a habit when I get anxious), and they said they don't work in individual parts like the flex ribbon cable which I told them in detail was defective - I even mentioned that I had tried to fix it by applying solder to fill in the breaks in the gold traces. But after 20 minutes of them listening to me and continually offering to exchange the iPod (not one, but two Genius' at the Genius Bar were offering me an exchange) - I gave in.
    I have to say parting with it was a bit of an emotional thing - I still had all my podcasts, songs, photos, etc, on the iPod (I would have wiped it, but I really didn't expect much - I don't know what I was expecting). Maybe I was thinking of all the Smart Playlists I would loose (again), and have to recreate (again), or maybe it wasn't wanting to part with it because I figured it would be my mod-ing unit (I had seen what some did to add 32GB Compact Flash to their iPods and was tempted to do this myself). It was a very lonely 30 min drive back home.
    I am still a bit gob-smacked with a 'New' 5.5Gen Video iPod. Part of me wants to thank Apple, and part of me wants to cry at loosing an old friend. (And I am sure there is a part that is sad that it wasn't me that fixed it.) I was also pretty well put in my place by the Genius when she said not to open the replacement. (If you've ever seen those TV shows where the actor becomes smaller and smaller when being scolded, that was me in the store.)
    The moral of my story is - *do not hesitate to take your product to Apple if you think it needs to be fixed!* It all definitely made me feel like Apple employees really do understand the value of 'Customer Service', even when the customer isn't always right. I hope others will learn from my mistakes.
    Sincerely,
    Nobuo

  • How to stop the iTunes launching when play/pause is pressed? PLEASE HELP

    I have a macbook pro 13 inches. When I play computer game, during an intense battle, I always accidently press the play/pause button.
    Immediately, the iTunes launch, which will make my game go frozen and I would always lose the battle. This make me extremely frustrated, I have lose so many battles cause of this problem. I know that I could turn the top row of my action keys to Fn keys. That would solve my problems, right? But no. Becuase I use those keys very often. It would be awful without them. For example, the screen brightness, the mission control, the keyboard back-lit light, the volume adjust. Without all these, my mac experience would be awful. Im just wondering if there are other solution beside for turning the Fn keys on.
    PLEASE HELP ME

    This has fixed it for me
    http://redth.codes/itunes-media-hotkey-disabler/

  • Mini's Play/Pause Button

    Hello I was wondering if anyone else has had such an issue. It's not a major problem but it does bug me sometimes.
    I have a 2nd generation Ipod Mini that's still under warranty. I usually turn off my Ipod by pressing and holding down the play/pause button. Lately however, I've noticed that this doesn't always work. Somtimes I have to try a couple of times for the Ipod to recognize that I'm actually holding down that key for it to turn off and not just pressing it to enable pause or play mode. The problem isn't always consistent but this was definitely not an issue before.
    Now my question is, is it really worth it to send it back to Apple? I understand that all Mini's that they send back now are refurbished..but is it worse to get a refurbished one back? Also, my warranty is expiring in November. If I do send my current Ipod back and get another one back does my warranty still only go until November? What if something is wrong (or goes wrong) with the one that they send back after the November deadline? Am I screwed?
    Thanks for any answers!

    Don't keep postiong with nothing else to say...saying "anyone?" is not going to make us answer any faster.
    Try this:
    when you go to turn it off, don't touch any buttons for a couple seconds before hand. I seem to have the same problem with my nano and I think the problem is just that the processor can't keep up.
    I hope this helps!

  • 30GB Play/Pause button won't work.

    Yes, another iPod Classic's play/pause button is messed up. I got it in March '09 so I believe that's over the 90 day fixing range. I've tried resetting, holding the menu & center button, & all of the suggestions on the Mac site, but it still won't work.
    Any ideas what could be wrong & how to fix it?

    Besides resetting the iPod, have you attempted restoring it? You can do that by clicking the "Restore" button on the the iPod's Summary page in iTunes.
    Assuming that doesn't work, you can check your [warranty status|https://selfsolve.apple.com/GetWarranty.do] to see if you are still covered for hardware repair. I doubt any 30GB iPods are still under warranty, since they were discontinued over two years ago, but you said you got it in March 2009 - did you purchase it used?
    Whether it's under warranty or not, you can always make a Genius Bar appointment at your closest Apple Store and see if they have any other suggestions, free of charge. If it's a hardware problem, they can replace the iPod for you, but there would be a charge to do so if you're out of warranty.
    Shawn

  • F8 (play/pause) Key running real time player

    Hi
    I have just brought a new mac wireless keyboard for my mac mini.
    I am having problems with one of the shortcut keys F8, to play/pause media. Once pressed itunes playes which is generally the main idea but it also causes realtime to start up and play the last film shown.
    Can anyone tell me how to stop this from happening?
    Regards
    Kash

    Hello,
    and please excuse my English   :-)
    I was surprised too when I saw that in my IdeaPad Y530 isn't possible to set other application for "Play/Pause" button than WMP :-(
    Like you wrote, "utility.exe" is searching registry for path to WMP and then launch it.  There is a "wmplayer.exe" string in "utility.exe" file so it is unchangeable, I think . I can't understand it.
    Is possible to patch "utility.exe" but this is Lenovo job - to give customers good working app.
    I think changing registry key is now only one fast method.
    One question: I see in "utility.exe" string "Right-click the icon to select the program or file that you want assigned to the hotkey". When/where app shows this text ?

  • Trouble playing/pausing with Zen Micro touch

    I am having a fairly peculiar (and frustating) issue with my new Zen Micro's touchpad. For me, the Play "button" (area) works only sporatically. Here's the symptoms: I can reliably press the Play/Pause button with my thumb, but I can't reliably press play with the tip of my finger. I NEED to be able to do this since I set the player on my desk at work and will need to quickly hit the Pause button if something comes up (read: if I actually have to work).
    I have the latest firmware, so that isn't a solution for me and I have tried playing with different sensitivity settings. After playing around quite a bit, I have determined that the button requires something wide pressing down on it to work. The narrow tip of my finger doesn't work, but the (wider) side of my thumb or even 2 finger tips work great.
    Has anyone experienced something similar to this? Is my player functioning normally? Any help is much appreciated.

    i have the same problem. back, forward and volume control works fine. sometime much too good
    but play, back and menu is only reacting sometimes for me.
    and thats the second player i have. had the same prob with the first and got a new one from the vendor.
    someone here could help out a little plz? can you all use the play button with the tip of your finger ?Message Edited by washi on 02-23-2005 0:47 AM

  • Removing client's ability to use play/pause button

    Hi all
    I am keen to use Presenter to put together a language listening test for some clients. My clients want their students to not be able to pause the presentation so, say, they can't pause, translate word, pause, translate word and so on. In order to do this, I need to remove or lock the Pause/Play button that appears in the skin of a Presenter module.
    I realise I can completely remove the Player bar by opening up the vconfig.xml file and changing the value next to <uishow name="playbar"> to false. This is a quick and dirty solution and may do the trick. However, I would like the students to still be able to see the time count down for each slide in the player bar. Why? Well, because my clients want their students to listen to an audio track, receive one minute's thinking time and then go on to answer a question about the track. The students should know how much time they still have available. This means somehow either removing the Play/Pause button or at least locking down its functionality.
    I'm not a Flash wiz (though I do have it) but I don't mind making changes to a few codes here and there. I just need to know which file/s and which code.
    Your thoughts/expertise would be greatly appreciated. Thanks in advance
    Peta

    Hi Peta,
    You're right...you could hide the playbar by setting that value to "false", but as you have no doubt already seen, that modification eliminates everything, which won't totally solve your problem.
    Since you have Flash, I'd recommend that you create a simple .swf file that will ultimately hide the Play/Pause button in the playbar area of Presenter content.  I'll be honest...I haven't "locked" the Play button, but that might be something to investigate IF what I'm proposing here doesn't do the trick for you.
    So here we go....
    In Flash, create a small stage area and on frame one in your timeline add the following:
    this.onEnterFrame = function () {
    _root.m_controlBar.m_playBtn._visible= 0;
    Save the Flash file as "playBtnKill.fla" and then publish it.  Then head back to PowerPoint and add the swf to the first slide in a presentation using Presenter's Import Flash function.  Publish the content and the Play button should be gone!
    Programming NOTE: because Presenter is set up for Flash Player 6/7/8, its best to code everything using Flash Player 6 / Actionscript 2.0 as the coding environment.
    A couple of things to keep in mind about this:
    First, by placing the swf file on the first slide of your PPT deck, the Play button will be affected for the entire duration of your presentation.  If you need it to show / hide / show /hide periodically throughout the deck, then you might want to think about how you want to handle the overall stucture of your course.  Meaning, that what might work is to kill off the Play button entirely, but use a PowerPoint graphic (that looks like a Play button) and then time that object to appear after a certain amount of time.  Of course, then you'd have to hyperlink the PPT object to the next slide in your deck so that folks will be given an opportunity to advance to the next slide.
    Second, since your intention is to remove the Play button, you should probably leave the "Advance by user" feature set to "NO", otherwise you will ahve to provide some mechanism of navigating from slide to slide (as mentioned above).  At least this way, by the time you've reached the end of the audio for a slide, the presentation will automatically advance.
    Hope that helps!
    Rob
    http://www.robrode.com/yabb/

  • Is it possible to add audio with a simple play/pause button and also have a clickTag attached to the full stage?

    my client wants to add audio to their banner ad (which always has a full stage clickTAG set). I'm trying to figure out a way to just use a simple play/pause button and attach a toggle action to it. Problem is when the user clicks it's going to the clickTAG URL that's attached to the full stage. Is there any way around this?
    Please advise and thank you in advance.

    I have the same issue. It is pretty annoying but at least the audio remains within the motion project. It just isn't accessible it seems as an FCPX template. So what I'm doing is this:
    I still use the video within FCPX's generator section so that you can edit the parameters as you need to
    For the audio, open the project in motion then under Share, click 'Export Audio'. Select 'CAF' format and save to your hard disk
    I then import the audio file into an event I set up specifically for this purpose (per BenB's suggestion).
    When I need it, I then insert the generator from the generators section and then attach the audio file below the primary story line for the audio track
    It isn't pretty but it works.

  • Play & Pause buttons work...but not with each other

    V!P and dzedwards were a big help to me yesterday but now
    I've come up against something else...
    I've got 3 music buttons on a page. The code that I have
    plays and pauses each button perfectly. But if I have Button 1
    playing and I click on button 2 (without stopping button 1
    manually), and button 1 is still playing...both play at the same
    time. Which, I understand why it's doing that but I'm not sure how
    to fix it.
    What do I need to add to the code so as to stop the first one
    from playing if I don't manually click it to stop? The first
    button's instance is monkey7, the second button's instance is
    iBelieve and the third button's instance is Perfection.
    monkey7 = new Sound();
    monkey7.attachSound("monkey7.mp3");
    monkey7.start(0);
    var elapsedTime:Number;
    var played:Boolean = false;
    pauseButton.onRelease = function() {
    if (played) {
    monkey7.start(monkey7.position/1000);
    played = false;
    } else {
    monkey7.stop();
    played = true;
    Thanks. And I apologize to V!P and DZ in advance.

    Well..not exactly. Crap, how do I explain this? The
    pauseButton is where you're applying the stop commands but from
    what I can tell, it's not doing anything because the play/pause
    button (pauseButton) isn't the problem, it's the button for the
    next song.
    My problem is when they don't click the play/pause button and
    go directly to the next button with the next song.
    If it makes it easier to see what I'm talking about, you can
    go to
    http://www.monkeypunk.com/,
    click on the music button, click on Monkey #7 button and you'll see
    the layout. It takes a couple of seconds for the preloader to
    appear.
    The arrow button on the right of the songs is the
    pauseButton. My problem is, when they don't click that but click
    the next button beneath, the button previous to it continues to
    play.
    Again, I apologize if I didn't explain it better
    originally.

Maybe you are looking for

  • Logic behind MC46 & MC50

    Hi Everybody, I want to know the logic behind 1)MC46 i.e. Report for Non moving & slow moving stock 2)MC50- Report for Dead stock My client wants to know the logic behind these reports. What i need to explain them exactly? Please guide.

  • Get name of XI System in mapping

    Hi, we have a three system landscape, i.e. we have an XI installation for development, test und production. In a mapping program, is it possible to retrieve dynamically the name of the XI system, on which the mapping is running? I need this to replac

  • What is error code 5105 when downloading free apps?

    what is error code 5105 when downloading free apps?

  • Why won't Flash player install on my windows vista?

    After downloading and installing Flash player several times on my computer the installation fails in spite of the message reading that it has successfully installed. As a result I am unable to view videos from my favorite photo sites. Using internet

  • Where can I get the Adobe AIR extension for Dreamweaver CS5.5 ??

    I am either going insane or all the links I can find are broken. http://www.adobe.com/products/air/tools/ajax/ redirects to http://www.adobe.com/devnet/air.html, which has no apparent download link. Any help most welcome.