Spacebar as pause button? (AS 2)

Hey guys, hoping someone can help me here. I'm trying to code the space bar key as a pause/play function in my flv player. I'm using Lee Brimlow's flv player tutorial as a model for my flv player so essentially it's driven via netstream coding. I've tried two different codes, code 1 being something I used a while back on another project and code 2 something I've been trying (hoping) would work better. If anyone has ANY advice please feel free to hit me up.
Thanks in advance!
Code:
//1)
onEnterFrame = function()
    check_keys();
function check_keys()
    if(!Key.isDown(Key.SPACE))
        ns.pause();
//2)
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown)
function keyDown()
    if (!Key.isDown(key.SPACE))
        if (ns.pause(false)
        ns.pause(true)
        else
        ns.pause(false)

The second bit of code appears to be AS3, so the first thing you'll need to determine is what version of code is your file using.
If the intent is AS2, then you can do a similar form of monitoring with the following code....
var keyListener:Object = new Object();
Key.addListener(keyListener);
keyListener.onKeyUp = function(){
if(Key.getCode() == 32){
     // process your ns command
I am unfamiliar with ns in AS2, so I didn't offer detecting between paused or not.  If detecting it is not an option, you could use a boolean variable to establish the current pause status and use that

Similar Messages

  • Dead spot on nano 7 the play/pause button on LCD non responsive

    non responsive/dead spot on nano 7 the play/pause button on LCD

    I was also experiencing this. I'm using a MacBook Pro, and iTunes 7.6(29) in Leopard. Clicking the pause button didn't work, but the spacebar does, as does the remote control.
    One thing that seemed to work was pressing forward / backward instead. After I did that, pause button in the mini player functioned as expected, even after expanding to full-size and back, and after starting and restarting iTunes. I have not seen what happens after starting / restarting my machine yet.
    Worth a shot, anyway.

  • How to hide only pause button on toolbar in run time

    hello,
    I had hide all the buttons like run, run continuous, abort vi and others by navigating to VI Properties and unchecking the corresponding options.
    when i run the vi, all becomes hide except pause button and i didn't find any option for hiding it manually as well as programatically.
    can any one tell me how to hide pause button. i have an urgent requirement for same.
    Thanks & Regards,
    Samriddh Sarbalhi
    Solved!
    Go to Solution.

    wprice wrote:
    I just found that the option called "Show Toolbar When Running" is located under VI Properties > Windows Appearance > Customize. I disabled it and it worked. Thanks!
    So, the option I mentioned is still available, but only at a different place.
    I was shocked on seeing your earlier reply, "There is no such option in LabVIEW 9.0 or higher.". 
    - Partha
    LabVIEW - Wires that catch bugs!

  • My ipod nano 6th generation does not start on pressing the sleep/pause button  or pressing both sound low and sleep pause button.it starts while connected to power it is fully charges

    i have an ipod nano 6th generation .version 1.2 yesterday i  restored it on i tunes  using my system window 7. for the last few days it does not start when the sleep/pause button is pressed.or even by pressing the both button sleep/pause and sound minus..It starts while connected to power. and then continues working. I can not put off it and it automatically goes off after some time its performance is ok  after starting by connecting to power and then disconnecting the cord.
    what would be the reason and what to do?>

    Call Apple Care as you are still under warranty.  

  • ITunes won't play song, even though pause button appears

    Recently my iTunes has stopped playing songs. If I click the play button, the pause button appears but the progress bar does not move and no sound is made. The volume on my computer is fine as I can still watch videos on youtube and such. I've recently updated to the lastest iTunes and am not sure whether the songs played find after that or not. I read that it could be a probably with quicktime but I've deleted that and downloaded it again but that did not help.
    Please help me!

    I noticed today I am having the same problem. Song would not play in Ver. 9.1.0 and 9.1.1. Same song plays fine in another media player. Also seeing the same that al0022 is seeing, my play button changes to a pause button, and my progress bar does not move. I am able to navigate around iTunes until I try to play a song then I have to kill the task.
    I had a Windows update performed yesterday, and believe the windows update is the cause of the problem.
    Anyone else unable to play after Windows updates were performed?
    Collin

  • My apple wireless keyboard is not responding on all the buttons starting from esc up to the play and pause button,please can u help me on how to solve this problem

    The mission control,launchpad ,two brightness button,reverse & play & pause button are not working on my apple wireless keyboard,please help me

    Try resetting the PRAM (if you are able to do so).
    Otherwise, I would take it in for diagnosis.
    Barry

  • Add a play/pause button on old Macbook

    I got pretty used to have a play/pause button on my new iMac. But as I still have an old Macbook Pro (the first Intel core duo 2006 model) Apple didn't make buttons on the keyboard to navigate through your media in iTunes or Spotify or whatever media program is active.
    I'd like to add a play/pause functionality to my F11 and a forward functionality to my F12 button. I've managed to do so in system preferences > Application Shortcuts. But the thing is that the buttons only work if the program (I'm mainly using Spotify at the moment) is active. I want to make these buttons in all other programs (just like the play/pause buttons on new Macs). How can I do that?
    PS: I don't mind using terminal for this.

    Does anyone know if it's impossible?

  • 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

  • Pause button not available in camera for videos

    In xperia z2 pause not avaliable while recording videos. Due to which I am forced to record many clips. Other wise I have to record even not required seens to record in single clip. Even the low end phones are having camera pause button while recording videos and it is surprising to me that z2 not having it. I request sony not to forget some of the old features given in old phones carrying to the new phones.

    I am sorry,contact xperia care about this:
    http://www.sonymobile.com/global-en/support/contact-us/
    All we have to decide is what to do with the time that is given to us - J.R.R. Tolkien

  • Pause button for Captivate 4

    I've done a lot of work for a customer, originally I used a shortened playbar with next/back and play/pause.  Now with issues in Captivate 4 (The playbar appears below the course instead of on top) I need to import a Pause button as I cant use the skin anymore.
    I downloaded the Pause/Play button from Raising Aimee which was excellent (Great site by the way) but if the course is paused and you move on the graphic still shows that it is paused but the button acts like its defaulted back to the other state.
    How do people here pause (and resume) their courses effectively ?  The pause in the playbar was excellent but I cant seem to recreate it in a standard Captivate course.
    I just want to have a button which pauses the course and obviously when you press it again it moves on.  If you pause the course and then press the button for the next page the course is unpaused (and the button resets).
    I'm hoping its something easy ?!

    Hi there
    I thought that Paul's gizmo did change state when you paused. I'm probably wrong about that. You may wish to contact him and see if he has changed it or is willing to modify it.
    As for the playback controls and positioning. Please submit this as a bug to the Adobe Captivate team. While I'm sure they won't view it as a bug, it actually is because they decided to change from something you were used to and introduce something that no longer works for you. Thus forcing you to change your workflow in search of something that works.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Pause button problem while recording audio

    Someone talked about that problem on another post but I think
    that problem deserve a post for it...
    We have a probleme when using the pause button while
    recording audio on a slide.
    If we hit the pause button, it completely deletes all
    previous recording in the slide.
    If someone have a long text to read for a slide he cannot
    take a break and think if everything is ok. Our clients are
    disappointed and calls this function.
    Do you have an idea when that problem will be solved ?
    Thank

    Hi Edji, I could not agree more. We reported this to Adobe
    months ago and it has been acknowledged, but no information will be
    made availlable about any fix release date. We have over 500 staff
    users making recordings using Presenter and have trained the
    majority on version 6. Imagine the number of supports calls we have
    had to deal with when suddenly the pause button deletes all
    previous slide recordings in version 7.
    Depsite many attampts to get a resolution for this we have
    had nothing aside from the suggestion above which certainly does
    not fix the issue. It is a significant bug in the program that has
    caused us endless hours of support work.
    We are quite dissappointed at present with the lack of
    reponse to the need for a fix and are currently evaluating a number
    of other products.
    Pityful but true.

  • I was playing Angry Birds and had to hit the pause button to listen to something.  When I hit the pause/play button again to resume, I heard talking that sounded like a talk-radio program and I couldn't turn it off, even when I turned off my iPad.

    Does anyone know what would cause me to start hearing a talk program of some type after hitting the play button after it had been on pause.  Hitting the pause button shuts off the talking, but hitting the play button starts it up again.  The strange thing is that the talking continues even after I turn off my iPad. The talk program was about silly or trendy news items, not regular news.  It sounds like it could be a talk-radio program, but there were no call letters or information on where it was coming from or who was talking.  The person doing all the talking is a male and sounds like he could be in his 20's.  The only way I could turn it off was to hit the pause button and then turn off my iPad. I just got my iPad last week and had not had any problems with it until this happened.  At the time this happened I was playing a version of Angry Birds that kept being interrupted by t-mobile commercials from time to time, which I had never experienced before. either.

    Well, shut my mouth!  There was a similar question over to the right about a 6th generation nano repeating over and over again -- I read the answer to that one, followed the instructions, and holy crap, it's back to normal.
    Is there a name for this when you end up replying to your own aggravating question?  That's what I did.  Now I can go out and listen.  It's only 91 degrees.  Heaven. Thanks, Apple. 

  • 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.

Maybe you are looking for

  • Column alias works in MySQL, but not in cfoutput

    I have the attached query that works fine in MySQL, but throws an error "1stpay not a valid identifier name" - like it doesn't recognize the aliases. However, it's recognizing my 2 aliases above. So is it the "if" lines that it's not liking? Ultimate

  • Need to create new users in Office 365 with custom attributes from a csv file

    I am exporting users from an active directory environment and then deleting them from AD. They are Alumni and will no longer be in AD. I have a csv file with the following fields that I need to use to create new Alumni email boxes in Office 365 for.

  • Mass check scale price of info record

    Hi there: Is there any transaction or table to mass check scale price of info record?

  • Date parameter used in report selection

    Post Author: calj CA Forum: Upgrading and Licensing In CR XI, is there an option to convert date/time fields to date that was under Report Options in 8.5?  In the Select Expert date/time fields display the time, and date parameters are not listed unl

  • Chinese Internationalisation

    I need to save Chinese Characters through java application to database. USing Java InputMethod Framework i was able to type chinese in textarea. I also changed database field type to nvarchar2 and tried saving. The data got from the textfield or text