Start and stop movie with key press

Can anyone please tell me how to do this?
I'm very new to flash.
Thankyou

Place this code in the timeline that you are trying to control--pressing and releasing a key will play/stop depending on which mode it is currently in.
stop();
var isPlaying:Boolean = false;
stage.addEventListener(KeyboardEvent.KEY_UP, keyUsed);
function keyUsed(event:KeyboardEvent)
if (isPlaying){
          stop();
     } else {
          play();
  isPlaying = !isPlaying;
If you have other questions, try to anticipate what you might be asked and include those details.

Similar Messages

  • I want cRIO to start and stop acquisition with push of physical button on cRIO, is that possible?

    When using my cRIO 9024 on the field, I prefer  to be able to start and stop acquisition with push of a physical button on cRIO. 
    I mean I don't want it to be "as start-up," I don't want cRIO to start acquisition as soon as the power is supplied. 
    Is that possible?
    Solved!
    Go to Solution.

    Hi Cashany,
    you surely can read that switch status. But there are easier (but more expensive) ways to switch a button. Fiddling with a pen or small screwdriver to switch USER1 isn't what I call "user friendly"...
    - You have atleast 2 voltage inputs on your module available. Use a switch to supply voltage to those inputs. Use a "real" button!
    - You have a serial port available. You could set some pins to GND or voltage and check their status inside cRIO/RT target...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • EXS24 : how can I launch and stop sound with key (instead of holding key)

    Hi,
    I'm using EXS24 to launch sounds (like pads) : I've created a specific instrument with one sound on each note (with differents zones). I've checked the box "One-" to have the sound that continues without holding the key, but I would like to be able to stop the sound with the same (or an other) key.
    WIthout stopping the other sounds.
    How can I do this ??
    Thanks for your help !
    Etienne

    You can make groups, have your "sample off" key assigned to a short audio file of silence (or just turn the volume parameter of that sample to -96 in the zone editing area of the EXS.
    Make the polyphony of the groups to 1. So you hit your one shot and it is playing through, when you hit the 'blank' key it plays instead - which is playing nothing.
    Depending on what you need, you can copy the blank sound into different groups (hold option and drag) - but this would stop all groups with one key. So if you need independent control, you can copy the same blank sample to different keys, and then group those individually with the different sample triggers.

  • Starting and stopping composites with ant

    Hi All,
    I am receiving the below error when I try to stop/start a composite using ant script.
    export ORACLE_HOME=/apps/oracle/product/fmw/soa
    export ANT_HOME=$ORACLE_HOME/../modules/org.apache.ant_1.7.1/
    export ANT_BIN=$ORACLE_HOME/bin
    PATH=$ORACLE_HOME:$ANT_HOME:$ANT_BIN:$PATH
    +$ ant -f $ANT_BIN/ant-sca-mgmt.xml stopComposite -Duser=qetst1user -Dpassword=welcome1 -Dhost=qetst1.corp.netapp.com -Dport=9200 -DcompositeName=ProcessSalesOrderEbizFfmtEventConsumer -Dpartition=Q2I -Drevision=1.0.0+
    Buildfile: /apps/oracle/product/fmw/soa/bin/ant-sca-mgmt.xml
    [echo] oracle.home = /apps/oracle/product/fmw/soa/bin/..
    stopComposite:
    [input] skipping input as property host has already been set.
    [input] skipping input as property port has already been set.
    [input] skipping input as property user has already been set.
    [secure-input] skipping secure-input as property password has already been set.
    [input] skipping input as property compositeName has already been set.
    [input] skipping input as property revision has already been set.
    [echo] oracle.home = /apps/oracle/product/fmw/soa/bin/..
    compositeMgrTask:
    [java] Connecting to: service:jmx:t3://qetst1.corp.netapp.com:9200/jndi/weblogic.management.mbeanservers.runtime
    [java] connection initiated
    _*[java] Cannot find composite lifecycle mbean.*_
    BUILD SUCCESSFUL
    Total time: 12 seconds
    Thanks,
    Harsh Bansal

    Hi user11274260,
    Thanks for the reply. Can you direct me a way on how to achieve that using wlst as well. Any snippet of code or some other info would be very useful.
    Thanks.

  • Windows script to start and stop jobserver only, with BOXI31

    hi,
    my question is easy but i have found nothing : on BOXI31
    how  to start and stop jobserver (adaptive...) automaticaly with windows script ?
    in tasklist command, jobserver have no services name...
    thank's

    In XI R2 you can stop & start job servers by their types, but in XI 3.1 I don't think you can do that, b'cos it doesnt list by server type just shows jobserver for crystal, webi & deski.
    Thanks,
    Hari

  • Tree node images changes.. with start and stop button

    I create the animator extends JPanel, which start and stop can be controlled with Swing Timer. It works fine with animation control over the panel.
    Now, I have a tree with each image at each node.
    when the start button clicks, one node image should be animated.
    It is implementable. If animation.gif would have worked, I did't have to do this, but animation gif has fatal error with time interval.
    any words would be appreciated. Thanks =

    Damn !
    With version 1.2.1 I think you'll have to create a new class that extends PositionPathInterpolator and add a pause() anr resume() method to it.
    i suggest something like:
    public class MyPositionPathInterpolator() extends PositionPathInterpolator {
    // add some constructors if necessary
    private float pauseAlphaValue = 0;
    // override computeTransform method
    public void computeTransform(float alphaValue, Transform3D transform) {
       float newAlphaValue = alphaValue + pauseAlphaValue; // calculate new alpha value
       if(newAlphaValue > 1)  // modify it if it is out of bounds
          newAlphaValue -= 1;
       else if (newAlphaValue < 0)
          newAlphaValue += 1;
       super.computeTransform(newAlphaValue, transform); // computeTransform with the right alpha value
    public void pause() {
       this.setEnable(false); // it won't compute transform anymore
       pauseAlphaValue = this.getAlpha().value(); // retrieve current alphavalue
    public void resume() {
       pauseAlphaValue -= this.getAlpha().value();
       this.setEnable(true) // restart computing transform
    }Now you invoke pause and resume methods on your myPositionPathInterpolator object when user clicks on the buttons.
    Of course it is a trick and it will work only with increasing alpha.
    c ya
    GnG

  • Control DC Motor (start and stop) with LabView

    I never used Lab View before. For a project, we have to use Lab View to make a small dc motor (HP:1/2, RPM 1725) start, and stop. I have no idea how to do this. Any advice/help anyone? Any tutorial or vi. would help!

    Hi there,
    Search for “H-bridge” for a common DC motor control circuit, the input terminals from the bridge can be controlled using any DAQ device with digital output lines from LabVIEW. For example: https://decibel.ni.com/content/docs/DOC-17062
    Regards,
    Alejandro | Academic Program Engineer | National Instruments

  • The "Enter" key keeps starting and stopping itunes songs...

    Hey, everytime I hit the enter key for example in Safari to enter a webpage, my itunes songs keep starting and stopping like I have the itunes window active... Does anyone know a solution for this? I tryed reinstalling and no luck...
    Thanks

    What are the system specs for your pc? It seems it's to slow to play iphone's 720p HD videos. QT 7.7.3 is the latest for windows but VLC Player will play these videos too.

  • Just rented a movie on apple tv and it keeps starting and stopping every few minutes. have restarted in settings. have unplugged and replugged apple tv. any other suggestions?

    Just rented a movie on apple tv and it keeps starting and stopping every few minutes. have restarted in settings. have unplugged and replugged apple tv. any other suggestions?

    The first thing to check would be your internet download speed, you can do this at www.speedtest.net.
    1080p HD movies require a recommended speed of 8 Mbps, 720p HD movies require a recommended speed of 6 Mbps, while SD movies require a recommended speed of 2.5 Mbps.

  • With apple pages - how do I start and stop the correction system/ spell and grammar, etc proof reader?

    How do I start and stop the corection system - das Korrektursystem/ the program in pages where one mark a text while proff reading it?

    Pages version?

  • Starting and stopping timer using external inputs interfaced with labview

    hello,
    I have trouble finding how to start and stop the timer using external voltage or current pulse. we are interfacing a circuit to labview. so for that we need to count the time it takes between the two external voltages. We have to keep on comparing the voltages to some reference voltage. And when the external voltage crosses the reference voltage we have to start the timer and again we have to stop the timer using tha same logic. We need it for time calculation between the triggers.
    hope you can help.

    https://decibel.ni.com/content/docs/DOC-23334 is agood example to start. You need to modify it to include stop trigger.

  • My MacBook Pro, does not start after pushing start button. The side bar starts and stops at half way.

    My MacBook Pro, does not start after pushing start button. The side bar starts and stops at half way.

    Hy myneck,
    Happy Holidays!  The resource below may provide some steps to try if your MacBook Pro won't start.
    Troubleshooting: My computer won't turn on - Apple Support
    http://support.apple.com/en-us/TS1367
    This article discusses what to do if your Mac won't turn on. To differentiate this from a display issue, be sure that when you press the power button:
    You don't hear a startup chime.
    You don't hear any fan or drive noise.
    There is no video on your built-in or external display
    If your computer has power but doesn't display any video, it may have one or more of these similar symptoms when you press the power button:
    You may hear a startup chime.
    You may hear fan or drive noise.
    You may see a light from the Sleep LED (if your Mac has one).
    Pressing the Caps Lock key on the keyboard causes it to light. 
    If any of these display-related conditions occur, see Troubleshooting: My computer has no video instead. Otherwise, continue with this article.
    If your computer won't turn on, try each of these steps:
    Verify you have a good connection from your Mac to the wall outlet by confirming the power cord and adapter if present are securely connected and plugged in. To check if the wall outlet is working, plug in a lamp or other electrical device.
    If the wall outlet is working and you continue to have no power try another power cord or adapter if available. If it works you may need a replacement cord or adapter. 
    Note: See Apple Portables: Troubleshooting MagSafe adapters for further troubleshooting with MagSafe adapters.
    Disconnect all accessories that are plugged in to the computer, such as a printer, hub, or other mobile device.
    If your Mac supports user-installable memory, solid state drive, or hard drive, and you recently installed any of these, make sure they are installed correctly and are compatible with your computer. If possible, reinstall the original memory or drive into the computer to find out if the behavior persists afterwards.
    MacBook Pro: How to remove or install memory
    MacBook: How to remove or install memory
    Mac Pro: How to remove or install memory
    Mac mini: How to remove or install memory
    iMac (27-inch, Late 2012): Installing or replacing memory
    iMac: How to remove or install memory
    Reset the SMC.
    If you are still unable to start up your computer after trying each of these steps, visit an Apple Store or Apple Authorized Service Provider (AASP) for further diagnosis. If you plan to visit an Apple Retail Store, make a reservation at the Genius Bar using http://www.apple.com/retail/geniusbar/ (available in some countries only).Note: Diagnostic fees may apply for issues not covered under warranty or the AppleCare Protection Plan (APP).
    I hope this information helps ....
    - Judy

  • Itunes is stuttering -starts and stops at random intervals

    Hi there-
    I have a 5yr old emac. I am running OSX 10.4.8 and itunes 7.02. I have not had any problems for 5 years,
    Today my itunes started stuttering - it starts and stops at random intervals and it takes forever to start playing again, to shuffle songs, etc... I restarted and it did not help.
    Can you advise me on what I could do next?
    Thanks so much,
    Kathleen in Minneapolis

    Kathleen ~
    It's possible it could be one of several or combination of many things. I'll list the potential problems, and ways to determine if you have the problem.
    First off, restart and do not run any other applications when you run iTunes, and don't run any applications after iTunes is playing music? Does the problem go away? If so, you may not have enough physical RAM installed on your computer for uninterrupted playback. You can find out how much RAM you have installed by clicking on the blue apple icon in the upper left corner of your screen and selecting "About this Mac". The "Memory" line wil display how much physical RAM you have installed. If it is less than 512MB, you should consider getting more.
    My second assumption is that you state you have had the computer for 5 years, it is posible that the hard drive (HD) is getting low on available space. Adding music, email, pictures, downloads, etc. over time erodes away at the available space on your HD. Typically on this vintage computer it likes to have at least 20% of HD free space to work relatively efficiently (this will vary based upon how large your HD is to begin with).
    To find out how much HD space you have available, click on your HD icon on your desktop once, then press and hold the CMD (open Apple) key and press the "i" key. You will see two statistics, "Capacity:" and "Available:". If the amount of available space is less than 20% of your total HD space you may want to consider removing things from you HD, acchiving things, or optimizing you HD.
    How often you repair permissions? I recommend at least once a month, and it's relatively easy and a quick thing to do. Go to your Applications->Utilities folder on your HD. There is an application called "Disk Utility", double click it. Select your HD volume in the upper left corner, then click the button "Repair Disk Permissions". Depending upon how many programs you have loaded this could take several minutes, be patient. When finished, if it fixed any permissions, run it again! Yep, twice, just to be certain, it can never hurt.
    Also, while you're in that application, and done with repairing permissions, click the "Verify Disk" button. This may also take several minutes. When done it should report if it thinks your drive is ok, or not. If not, you need to repair it, and in order to do so, you need to boot from another drive (either another physical or logical drive), so that you can attempt to repair it.
    If you have the purchased utilities such as Disk Warrior or TechTool Pro you can repair disk and directory problems, which could also be causing your problems. A free utility, such as Tiger Cache Cleaner has some utilities to clean caches, and run your nightly, weekly, and monthly processes that may also need to be run.
    Chuck
    PB Ti 1GHz - The last of it's kind Mac OS X (10.4.8) et al

  • Action Script 3 code not working for start and stop button?

    Ok so I have this simple animation I created of a circle that moves from one side of the stage to the other. I have added a new layer and called it buttons. On this layer I have added 2 buttons. One for start and another one for stop. The purpose is to get my circle to move from one side of the stage to the other but be able to use my buttons so that I can start and stop the animations at random times during playback. I fixed all my compiler errors now the problem lies in that everytime I click the start or the stop button I get an output error. I have a 3rd layer in which is titled actions and this is where all my code is posted. I removed that layer and placed my code in the first frame of the buttons layer to see if this would change anything but I still get the same output errors. So I just added back my actions layer. What could I be doing wrong? I have made sure to name all my movie clips and buttons correctly and I even added an instance name to them.
    Here is my code and the errors I am getting when I press the play and stop button on test-
    start_btn.addEventListener(MouseEvent.CLICK, startCircle);
    stop_btn.addEventListener(MouseEvent.CLICK, stopCircle);
    function startCircle(e:MouseEvent):void{
        circle.play();
    function stopCircle(e:MouseEvent):void{
        circle.stop();
    green_btn.addEventListener(MouseEvent.CLICK, greenCircle);
    red_btn.addEventListener(MouseEvent.CLICK, redCircle);
    function greenCircle(e:MouseEvent):void{
        circle.play();
    function redCircle(e:MouseEvent):void{
        circle.stop();
    Here are my output errors-
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at exercise2_fla::MainTimeline/redCircle()
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at exercise2_fla::MainTimeline/greenCircle()

    ok so my circle is my movie clip and it is titled circle and the instance name is circle. Am I supposed to change MovieClip to circle? I put the code at the top of my actions script but for some reason it did not work. I did change play to stop and it got the movie clip to stop when I do test movie but my buttons still do not work. So I changed stop back to play. Strange.
    I did try changing MovieClip to circle but that did not work so I did Circle with a capital C and that did me no good eigther.
    I meant to add that I did get an error that said- 1180 Call to a possibly undefined method circle.

  • Need help getting Tomcat 5.0.28 to start (and stop, eventually)

    Hi!
    I am such a newbie to the Terminal and writing scripts, so please forgive my naiveté. I have successfully installed Tomcat in my /usr/local directory, but I am having trouble creating files to start and stop Tomcat, per the instructions on the following page:
    http://developer.apple.com/internet/java/tomcat1.html
    I've followed the directions but continue to get the following error after I execute ~/bin/start_tomcat.
    -bash: start_tomcat: command not found
    My file contains the following code:
    #!/bin/sh /n
    export CATALINA_HOME=/usr/local/jakarta-tomcat-5.0.28 /n
    export JAVA_HOME=/usr /n
    $CATALINA_HOME/bin/startup.sh /n
    If anyone can help me, I would really, really, really appreciate it!
    Thanks!
    PowerBook G4 12"   Mac OS X (10.4.5)  

    Why are there all those "/n" there? Either you or the place you copied from has the wrong slash. But still, it's wronger than that to have them at all: "\n" means a newline (i.e., press "return") not the actual "backslash en" characters. Sometimes people post code with those \n visible: by making it explicit where a line-break should be, one doesn't have as much trouble when a web browser reformats the text and puts line breaks where they don't belong.

Maybe you are looking for