Single start/stop button for looping movie

Dear Friends,
I apologize if this has been addressed already in the forum, as I have had no luck searching here or the web in general for a solution.
I currently have a 23-frame multilayered single-scene animation designed to loop continuously which I would like to add to my portfolio. As such, I am adding a Play button, which I would like to toggle to a Stop (or Pause) button. I currently have an instance of the Play button ("playButton") created.
(You can find this at pineboxmovingco.com/gear_redux.swf)
Besides imploring your assistance in providing the code, I must also ask if this requires (and best practice for) inserting an additional frame at the beginning for the ActionScript, as well as where/what layer to add an instance of the Stop button. I would like the movie to be stopped by default, presenting the Play button, toggling to the Stop button, and back to the Play button, each upon release.
Thank you so much in advance!
Michael T
Phila, PA

So, Ned, insert the stop(); command - with no other code - on each keyframe of the MC like so:
Then, return to Scene 1 and select the MC, inserting the code:
With an additional "stop" command in the first frame:
I must be missing something as it is continues to loop. Any further assistance would be greatly appreciated...
Michael
(UPDATE: Replaced second image with AS reflecting replacement of XXX with "1".)
Message was edited by: turnerator

Similar Messages

  • How do I create a start/stop button for each separate while loop within my program, when each of them does a different task?

    I have a multimeter VI with separate while loops to accomplish the different tasks of reading  voltage, current, etc. Each while loop has a stop button, but I need a button that will have to be pressed in order for the while loop to even start. I tried putting another while loop around the present one, but it still has to run once before it will stop. I want the user to have to press the button before it runs, because they interfere with each other.
    I am just learning so patience and your kind assistance is greatly appreciated!
    ElectroKate

    iZACHdx wrote:
    Hello,
    I'm not entirely clear with everything you have going on and what you want your final functionality to be, but you can use sequence structures to prevent a loop from starting until the user presses a button like this:
    -Zach
    I have to ask, why is an NI employee using examples using sequence frames? The same thing could be accomplished using data flow by simply wiring the value of the first stop button out of teh first while loop and connecting it to the second loop. This would then use data flow to control the sequence. Why show new users bad programming methods?
    As to the original question I would concur with altenbach on using an event structure.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Separate Start/Stop times for a single song file

    I am trying to create some playlists for different moods e.g. calm, happy, upbeat etc.
    Now, my problem is this. I have some songs that have more than one mood within them, and I would like to set different start/stop times for the one song file.
    I would like to be able to set different start/stop times in each playlist and not affect the start/stop times for the file in the music library.
    Thanks in advance to anyone who can help!

    The only way to do this is to make a duplicate copy of the song for your playlist and adjust the times for the duplicate.

  • Aperture 3 shuts down every time I try to use it after only using it for one minute. Aperture closes then a pop up screen asks if I want to reopen Aperture. If somrone at Aperture didn't keep pushing a stop button for it to close,it wouldn't need to ask t

    Aperture 3 shuts down every time I try to use it after only using it for one minute. Aperture closes then a pop up screen asks if I want to reopen Aperture. If somrone at Aperture didn't keep pushing a stop button for it to close,Apple wouldn't need to ask the stupid question"Do you want to reopen Aperture?" to begin with. Anyone out there having the same annoying problem?? I like Aperture or used to anyway,but if this nonsense continues, I will be forced to buy some other editor besides "No hanging fruit - Adobe photoshop CS5" or "I don't like you so I'm shutting down - Aperture".

    Hello,
    sorry to hear about your troubles, but we will need to have more technical information about your problem to be able to help you:
    There may be several reasons that can cause Aperture to crash on start up:
    You may have imported an image (or video) in an encoding that Aperture does not support, or that is larger than 2 GB, or that is corrupted and Aperture cannot process it
    Your Aperture Library or Preferences may have been corrupted
    Or you are having a system wide problem with your machine.
    Or you may simple be running out of disk space.
    It would help, if you could post the crash log from your last crash. Also, more details on your Aperture Library: Is it managed or references? how large is it? Is it on your system drive or on an external drive?
    What have you done, shortly before the trouble started? Have you imported new images or videos? Did you install any plug-ins or any new software, lile Final Cut?
    Try, if you can get Aperture to launch, if you defer the generation of Previews: Hold down the SHIFT-key immediately after you start Aperture to prevent preview generation for that session. If a damaged image in your library is preventing normal opening, this may allow you to start Aperture. If this succeeds, try to identify the broken image or video among the images you recently imported and remove it from the library.
    Regards
    Léonie
    Don't you think your user name is a little bit tactless in an Apple provided forum?

  • How to stop a "for" loop

    Hello,
    Do you know how I can stop a for loop ? because when I click on the stop switch on my front panel, the VI don't stop and continue to run the loop.
    Peter.
    Labview 2010
    Solved!
    Go to Solution.

    Peter,
    It sounds like you need a while loop, not a for loop. A button or switch does not traditionally control iterations of execution for a for loop.
    Please post your code so we may help better.
    -Chazzmd

  • Playback buttons for flash movie

    Hello, im having some difficulty adding a play, pause and
    stop button to a movie I imported into flash.
    The movie was imported using the import wizard in flash 8. I
    did not add a skin because when I tried adding it , the skin would
    not show through once I imported the finished swf file in
    Trainersoft. ONly the movie would come through. So, then I decided
    to add my own playback buttons to the movie. I imported the movie
    again using the import wizard, i did not select a skin. The movie
    was imported fine into flash. I added a play, pause and stop
    buttons as new symbols each in their own layer. I added the correct
    action scripting to the buttons, i preview movie and the buttons
    appear correctly but nothing happens when I click each of the
    buttons, the movie keeps playing without reacting to me clicking on
    either the pause or stop button, or the play button.
    Here is thte scripting im using.
    For Play: on (release) {
    myButton.onrelease = function() {
    trace("onrelease called");
    on (release) {
    play();
    For Pause:
    on (release) {
    myButton.onrelease = function() {
    trace("onrelease called");
    on (release) {
    stop();
    For Stop
    on (release) {
    " Movie".gotoAndStop (1) ;
    I would love to hear from someone to help me out. Thank
    you!!

    First, create your play button. Click on it, and open up the
    Properties Panel (Shift + F3). Type in:
    play_btn for the <Instance Name>.
    Then, create a new Layer in your Flash file, called Actions.
    Click on the first frame of the Actions layer, and open up the
    Actions panel (F9).
    Type in:
    stop();
    play_btn.onRelease = function(){
    play();
    }

  • Where did the "Stop" button go on the Navigation Bar in ff4? It isn't included in the Customize box. Is there anyway to install the "Stop" button for loading web pages or is this option compeletly gone from Firefox now?

    Just installed upgrade to Firefox 4.0. Where did the "Stop" button go on the Navigation Bar. I checked the Customize dialogue box and it isn't included. Is anyone else missing it? Is there anyway to install the "Stop" button for loading web pages or is this option completely gone from Firefox now? It was a very helpful button and allowed us users to stop a web page and move on if it wasn't what we needed.

    In Firefox 4 by default the Stop, Go and Reload buttons are combined and attached to the right hand edge of the location bar.
    When you are typing in the location bar it will show the Go button. When a site is loading it shows the Stop button. At other times it shows the Reload button.
    If you want separate buttons, right-click on a toolbar and choose Customize, you can then drag and drop the stop or reload buttons and place them elsewhere. If you place them in the order "Reload-Stop" on the right hand edge of the location bar they will be combined again. For more details on customizing the toolbar see https://support.mozilla.com/kb/How+to+customize+the+toolbar

  • How do I change the start/stop time for multiple songs not just one song at a time?

    How do I chnage the start/stop time for multiple songs not just one song at a time?

    I don't think you can in iTunes.
    Multiple editing in Get Info does not offer an option to change start/stop times.

  • I want a stop button for disabling JavaScript only in the current tab

    I want a 'Stop' button for disabling JavaScript only in the current tab.
    I searched for a feature like this but couldn't find it. It would be a great new feature.

    Tab Permissions: https://addons.mozilla.org/firefox/addon/4757

  • HT204370 I cant fined the play button for a movie ive already rented... How do you restart a movie???

    I cant fined the play button for a movie ive already rented... How do you restart a movie???

    Once you rent it it will tell you when its 'ready to watch' and you can then hit play. You can also access it by going to the movies tab, and the poster image for the rented title will appear in the top left. You can also go to settings - general - itunes store - check for rentals.
    Note: a 6mbps connection is required for instant HD rentals. If you are much lower it may take some time before you can watch. Accessing other content during this time or turning off the device will flush the rental, requiring a reload.

  • HT201412 ipad not turning on.On charging apple logo appears in between.But its not turning on,tried to restore by pressing start & home button for 10 seconds.But its not working.

    ipad not turning on.On charging apple logo appears in between.But its not turning on,tried to restore by pressing start & home button for 10 seconds.But its not working.

    Frozen or unresponsive iPad
    Resolve these most common issues:
        •    Display remains black or blank
        •    Touch screen not responding
        •    Application unexpectedly closes or freezes
    http://www.apple.com/support/ipad/assistant/ipad/
    iPad Frozen, not responding, how to fix
    http://appletoolbox.com/2012/07/ipad-frozen-not-responding-how-to-fix/
    iPad Frozen? How to Force Quit an App, Reset or Restart Your iPad
    http://ipadacademy.com/2010/11/ipad-frozen-how-to-force-quit-an-app-reset-or-res tart-your-ipad
    Black or Blank Screen on iPad or iPhone
    http://appletoolbox.com/2012/10/black-or-blank-screen-on-ipad-or-iphone/
    What to Do When Your iPad Won't Turn On
    http://ipad.about.com/od/iPad_Troubleshooting/ss/What-To-Do-When-Your-Ipad-Wo-No t-Turn-On.htm
    iOS: Not responding or does not turn on
    http://support.apple.com/kb/TS3281
    Home button not working or unresponsive, fix
    http://appletoolbox.com/2013/04/home-button-not-working-or-unresponsive-fix/
    Fixing an iPad Home Button
    http://tinyurl.com/om6rd6u
    iPad: Basic troubleshooting
    http://support.apple.com/kb/TS3274
     Cheers, Tom

  • Start/Stop Buttons and infinite loop exit

    I am trying to make a GUI with a Start/Stop and an Exit button. Initially the button will have the label "Start". When i push it, its label should become "Stop" and an infinite loop function will begin. I want the loop to run until i press the Stop or Exit button.
    The problem is that when the loop starts i can't press neither of the buttons. The "Start" button changes its label into "Stop" only if i make the loop finite and it ends.
    Here is the source:
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    public class StartStopButtons extends JFrame{
        Component visualComponent = null;
        JPanel panel = null;
        JLabel statusBar = null;
         public StartStopButtons() {
              setSize(160, 70);
              getContentPane().setLayout(new BorderLayout());
            panel = new JPanel();
            panel.setLayout(new BorderLayout());
            getContentPane().add(panel, BorderLayout.CENTER);
            final JPanel panel_1 = new JPanel();
            panel.add(panel_1, BorderLayout.CENTER);
            final JButton startButton = new JButton();
            startButton.addActionListener(new ActionListener() {
                 public void actionPerformed(final ActionEvent e) {
                    String action = e.getActionCommand();
                    if (action.equals("Start")) {
                         System.out.println("Start Loop");
                         startButton.setText("Stop");
                         myLoop ();
                    if (action.equals("Stop")) {
                         System.out.println("Stop Loop");
                         System.exit(0);
            startButton.setText("Start");
            panel_1.add(startButton);
            final JButton exitButton = new JButton();
            exitButton.addActionListener(new ActionListener() {
                 public void actionPerformed(final ActionEvent e) {
                    String action = e.getActionCommand();
                    if (action.equals("Exit")) {
                        System.exit(0);
            panel_1.add(exitButton);
            exitButton.setText("Exit");
         public void myLoop() {
              for (int i = 0; ; i++)
                   System.out.println(i);
         public static void main(String[] args) {
              StartStopButtons ssB = new StartStopButtons();
              ssB.setVisible(true);
    }

    I works just fine. Here is the source and thanks for the help.
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.UIManager;
    public class StartStopButtons extends JFrame implements ActionListener, Runnable{
        Component visualComponent = null;
        JPanel panel = null;
        JLabel statusBar = null;
        Thread thread;
        JButton startButton;
         public StartStopButtons() {
            try {
                UIManager.setLookAndFeel(
                    UIManager.getSystemLookAndFeelClassName());
            } catch(Exception e) {}
              setSize(160, 70);
              getContentPane().setLayout(new BorderLayout());
            panel = new JPanel();
            panel.setLayout(new BorderLayout());
            getContentPane().add(panel, BorderLayout.CENTER);
            final JPanel panel_1 = new JPanel();
            panel.add(panel_1, BorderLayout.CENTER);
            startButton = new JButton();
            startButton.addActionListener(this);
            startButton.setText("Start");
            panel_1.add(startButton);
            final JButton exitButton = new JButton();
            exitButton.addActionListener(new ActionListener() {
                 public void actionPerformed(final ActionEvent e) {
                    String action = e.getActionCommand();
                    if (action.equals("Exit")) {
                        System.exit(0);
            panel_1.add(exitButton);
            exitButton.setText("Exit");
         public void actionPerformed(ActionEvent e) {
              String action = e.getActionCommand();
              if (action.equals("Start")) {
                   startButton.setText("Stop");
                   thread = new Thread( this );
                   thread.start();
              if (action.equals("Stop")) {
                System.exit(0);
         public void run() {
              myLoop();
         public void myLoop() {
              for (int i = 0; ; i++)
                   System.out.println(i);
         public static void main(String[] args) {
              StartStopButtons ssB = new StartStopButtons();
              ssB.setVisible(true);
    }

  • How to pause and stop two "for loops" in an event

    Hi
    The main menu runs first and then goes to reading menu. After "Start Reading" button is pressed, the reading process will take readings.
    1) During reading process, if the "Pause Reading" button is pressed, I want that the two "for loops" are stopped and the two "for loop" counters do not reset. After the "Start Reading" button is pressed, the two "for loops" will continue to run.
    2) During reading process, if the "Stop Reading" button is pressed, I want that the two "for loops" are stopped and the two "for loop" counters are reset. After the "Start Reading" button is pressed, the two "for loops" will run again.
    The attached two VIs are simplified my real application. Any help will be appreciated.
    Thanks
    Steve
    Attachments:
    Main Menu Test.vi ‏9 KB
    Reading Menu Test.vi ‏23 KB

    You can't have those loops inside of the event structure.  Currently, when you press the start button, the reading has to finish before the event case finishes.  This will prevent the stop can cancel buttons from being processed by the event structure.
    You need another loop that can recieve commands from the event loop.  Look up the Queued Message Handler.  That should get you a good start on the command process.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Starting/Stopping a polling loop with a user event.

    I keep reading on this forum that placing a loop inside a user event structure is a bad idea because it disables other user events from triggering.  However, it seems like a good idea to be able to start and stop a loop from a user event (like a button being pressed or de-pressed) and it seems like a good idea to not have the loop waist CPU resources while it does not need to be running.
    So what are the solutions to this?  Is a notification the best approach?
    Attached is my solution.  Is there a more graceful approach to this problem?
    Aside: Why are boolean controls that are of the "Latched" mechanical action always pressed in after their event fires?  For instance, the stop button on the attached VI?  Shouldn't it be depressed after the user clicks on it because it is "Latch when released?"  I've always wired "false" constants to 'variables' of these controls after the event structure fires, but do not find this approach very graceful.
    -Nickerbocker
    LV 8.5
    Attachments:
    Wait for Notification for Polling Loop Test.vi ‏25 KB
    wait for notification for polling loop test.jpg ‏61 KB

    Nickerbocker wrote:
    If an error is generated on the first itteration, then the loop is terminated with that error line.  Right?
    Wrong! The loop cannot terminate until everything in it has terminated. RIght now it will stall at the event structure no matter what until an event occurs. At this time it is sufficient to get the error piped through the event structure. If you are worried about an error in creating the notifier (anything that happens before the loop starts), you shold place your entire later code inside a case structure wired to the error so the loops don't even start.
    Nickerbocker wrote:
    Can multiple event structures exist in the same block diagram?  For some reason I was under the impression that there could only be one event structure that fires at one time.  If that structure was in execution then no other Event Structures could fire....  if my information is wrong, then I like your solution.  If it is right, then I don't like your solution .
    Your information is wrong again. You can have as many event structures as you want, and all is well as long as all event structures can execute in parallel. So make sure they are in independent loops.
    (If you would place two event structures in the same loop, both must trigger for the loop to complete the iteration, probably something that does not make a lot of sense. So don't do that!).
    LabVIEW Champion . Do more with less code and in less time .

  • Adding stop button for streaming music

    hi iam trying to add a stop button in addition to the play
    button (i already have), to give the user more control. so they can
    click play, then stop and if they desire play again (so it starts
    from the beginning). the music is streamed and i do not have a
    media player (small area) just a play button. any help is greatly
    appreciated the code i have is;
    <object codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0
    class=" height="12" width="12"
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
    <param name="_cx" value="318" />
    <param name="_cy" value="318" />
    <param name="FlashVars" value="" />
    <param name="Movie" value="web_images/neverletugoedit.swf"
    />
    <param name="Src" value="web_images/neverletugoedit.swf"
    />
    <param name="WMode" value="Opaque" />
    <param name="Play" value="-1" />
    <param name="Loop" value="0" />
    <param name="Quality" value="High" />
    <param name="SAlign" value="" />
    <param name="Menu" value="-1" />
    <param name="Base" value="" />
    <param name="AllowScriptAccess" value="" />
    <param name="Scale" value="ShowAll" />
    <param name="DeviceFont" value="0" />
    <param name="EmbedMovie" value="0" />
    <param name="BGColor" value="FF0000" />
    <param name="SWRemote" value="" />
    <param name="MovieData" value="" />
    <param name="SeamlessTabbing" value="1" />
    <param name="Profile" value="0" />
    <param name="ProfileAddress" value="" />
    <param name="ProfilePort" value="0" />
    <param name="AllowNetworking" value="all" />
    <param name="AllowFullScreen" value="false" />
    <embed src="web_images/neverletugoedit.swf" width="12"
    height="12" play="true" loop="false" wmode="Opaque" quality="high"
    bgcolor="#ff0000" align="" pluginspage="
    http://www.macromedia.com/go/getflashplayer"></embed>
    </object>

    See if these tutorials help:
    http://kennybellew.com/tutorial/

Maybe you are looking for