Click button to play and click to reverse

I have a test button i would like to have play a movie where a graphic expands. Once stopped, I would like to be able to click that same button and have the graphic go backwards. I would prefer to have timeline reverse, rather than lengthen the timeline of the mc because then i have to line up the start and end, and if one changes, i have to remember to change the other.
I have:
btn_test.onRelease = function(){
    if (_root.adinstance._currentframe != 1) {
        while(_root.adinstance._currentframe != 1) {
            _root.adinstance.prevFrame();
    else {   
        _root.adinstance.play();
I get the expand, but when when it hits the while loop, it just disappears the adinstance mc.
Any ideas?

You rarely want to use any kind of coded loop to animate something, especially a while loop (they can be especially ornery).  Try something more along the lines of....
btn_test.onRelease = function(){
    if (_root.adinstance._currentframe != 1) {
        _root.adinstance.onEnterFrame = function(){
             if(_root.adinstance._currentframe != 1){
                   _root.adinstance.prevFrame();
             } else {
                   delete _root.adinstance.onEnterFrame;
    else {   
        _root.adinstance.play();

Similar Messages

  • How to code a button to play and pause sound using load sound?

    how to code a button to play and pause sound using load sound?I have used load sound methos to attach the sound.Can anyone help me?

    Hey thnx,
    I have used this code on sound's button's frame.and my stop n play button is on another screen.main sound button and stop button is on diffrent screen.
    Here is my code-
    stop();
    adaDrut1.onRelease = function () {
              mySoundC = new Sound(this);
              mySoundC.loadSound("F#/Bhajni1.ark", true);
    mySoundC.onSoundComplete = function() {
    _root.mySoundC.start(0,999); }
             gotoAndPlay("play2");
            _global.myTaalLaya = "Low1";
    adaDrut1 is a sound button.And there are lot of buttons with diffrent sound.
    Thanks..

  • Sometimes my play and pause button(F8) is not working.

    I don't know why, sometimes the button of play and pause button is not working why?
    do you have any advice or do you think is broken??

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

  • Click a button, wait mc A to finish playing and play mc B

    Hello. I am using Adobe Flash pro CS6 and AS3.
    Right now I am trying to make a button to play a new mc. There are 2 movie clips. mc A and mc B.
    What I want to do is my swf is playing mc A but if I click a button, it starts to play mc B, but I want to  finish playing mc A before starting mc B, I mean it plays mc A (500 frames  loop animation) and if I click a button on 250 frames of mc A, it waits mc A to play remaining 250 frames, and if mc A finishes, it starts mc B.
    So I can not use gotoAndPlay command. What command should I use to do it?

    You could set some boolean variable to be true when you want mcB to play and at the end of mcA have it check the value of that variable and stop mcA/play mcB if the variable is true.

  • Hi - Re Keynote  I'm trying to figure out how to create a music album on USB flash drive. What I want is a background picture with 'click-buttons' to play each track listed, also similar for embedded videos and photos etc.  Is this possible with Keynote ?

    Hi - Re Keynote  I'm trying to figure out how to create a music album (as an artist) on USB flash drive, (accessible by both Mac and PC). What I want is a background picture with 'click-buttons' to play each track listed, and play in order (like a cd) - also similar for embedded videos and photos etc. This should all be on the one page.  
    Is this possible with Keynote, or any other software package for Mac (am using Macbook Pro) ?
    Gav 88

    Hi there,
    Yikes, it sounds like you've been doing a lot of work on this project... Unfortunately, however, this isn't the Adobe Encore forum, but the Acrobat.com forum. While it seems like an exciting question, we're not able to address issues pertaining to other Adobe products and services. Here's a link to the Adobe Encore forum, where you're more likely to get help for this specific issue:
    http://forums.adobe.com/community/encore
    Sorry not to be of more specific help to you. Best of luck!
    Kind regards,
    Rebecca

  • How to link audio to button to make it play and stop on click? Help please!!!!

    Hi guys,
          I am trying to connect audio to the button so when I click on the button music it starts playing and when clicked again music stops. Any ideas??

    assign your sound a class, say S.  you can then use:
    var s:Sound=new S();
    var sc:SoundChannel;
    var soundon:Boolean;
    yourbutton.addEventListener(MouseEvent.CLICK,btnF);
    function btnF(e:MouseEvent){
    if(!soundon){
    sc=s.play();
    } else {
    sc.stop();
    soundon=!soundon;

  • Click to play, and click to play in reverse actions with specific time

    Is there any code that can specify the amount of time my animation will play forwards or in reverse so that the viewer can move my animation in set increments either forwards or backwards along the timeline. ?
    i.e. 1 second forwards or one second in reverse.

    To play forward 1 sec do:
         var t = sym.getPosition();
         sym.play();
         sym.stop(t + 1000);
    Similarly, to play backward:
         var t = sym.getPosition();
         sym.playReverse();
         sym.stop(t - 1000);
    hth,
    Vivekuma

  • TS1424 When I click to play my songs in the library they will not play and show a circle with an exclamation point in the middle of it, what does that mean and how can I get them to play?

    When I click to pay my songs in the library they will not play and it shows a circle with an exclamation point within it. What does that mean, how do I fix it, and how will it play my songs again? They used to play before on my Iphone4 with no problem, but since I upgraded to the Iphone4s there is an issue.

    I am having the same problem. I have just tried this. Unplug iphone > open itunes > delete all music from itunes library > close itunes > re-open itunes > add music from original folder > plug in iphone > select songs > press sync > unplug iphone using eject button onscreen > checked phone .... still nothing in music folder on phone. On itunes the "On this iphone" tab the songs remain there but greyed out.

  • Programming button for single and double click

    I know how to programme a button to play a certain movie segment. However, in my current project I need to be able to programme a button in the menu so that
    1. on rollover - nothing
    2. on single mouse click - button colour changes + a parapraph of text appears on the menu screen in a predefined space
    3. on double click - a movie clip plays
    It might be a simple qiestion but I would greatly appreciate it if you could point me in the right direction.
    Thanks.

    Nick76 wrote:
    I know how to programme a button to play a certain movie segment. However, in my current project I need to be able to programme a button in the menu so that
    1. on rollover - nothing
    Do not change the highligh and it will look like nothing is happening (make sure auto activate is not beign used)
    2. on single mouse click - button colour changes + a parapraph of text appears on the menu screen in a predefined space
    3. on double click - a movie clip plays
    It might be a simple qiestion but I would greatly appreciate it if you could point me in the right direction.
    Thanks.
    Single and Double clicks cannot be done like that. (Some players using layered menus do require a click to get things seen but not really what you are speaking about.)
    Flash or Director may be better for this?

  • When I choose an album to play in my itunes library, only one song will play and then itunes stops. Also, when I click on next, itunes just stops playing.

    When I choose an album to play in my itunes library, only one song plays and then itunes stops. Also, when I click on the next button, itunes stops. How can I play an entire album through without stopping after each song?

    Sounds like you have accidentally unchecked all items. In the Songs view ctrl-click on any empty checkbox.
    tt2

  • IPhone (Cocoa Touch) Button that plays sound file on click?

    Hello.
    I am trying to create a button that, when clicked, it plays a given sound file in the app's filesystem.
    This is what I have set up thus far:
    Regular Rectangular button -> connected to NSObject Called "sounds" -> with the Event "playsound1" chosen as the event.
    I then wrote the class files, brought them into Xcode file project under classes, and now I'm staring at sound.h and sounds.m with no idea what to do next.
    I was able to create in a regular Mac OSX Cocoa, a button that plays the system beep using NSBeep. However, I don't know how to achieve this similar objective with using a given sound file in the iPhone Cocoa Touch.
    Thanks

    I have tried so many things. I'm so lost.

  • How do I get iTunes 11 to work as the old iTunes did in this respect: after playing a song in one playlist, I click on another playlist, highlight a song, press play, and get the result of that song playing & that playlist continuing?

       How do I get iTunes 11 to work as the old iTunes did in this respect: after playing a song in one playlist, I click on another playlist, highlight a song, press play, and get the result of that song playing & that playlist continuing?  As it goes now, one clicks on the song in the new playlist where the arrow is and then chooses 'Play Song Next.'  So, it plays next, but then the song after that is back in the old playlist.  I want to use iTunes smoothly without the extra clicks I've had to do in order to get the playlist to continue.  This is music for background while I play the violin at restaurants, and extra clicks and hassle is quite unappreciated, especailly since it worked fine in the previous iTunes.
       Thanks.

    At the top of the playlist where it shows the playlist title and the number of songs, there are two icons. Click the "play" triangle to add the entire playlist to "Up Next", or the "shuffle" symbol to do the same thing but in random order. But the currently playing track will stop playing, and all the songs in "Up Next" will be removed (replaced by the ones from this playlist).
    If you hold down the "option" key while clicking those icons, the currently playing song will continue playing, and the new playlist will be added to "Up Next" (above the songs that were already there).

  • Error 500 -Internal Server Error when I click on browse catelog button on Reports and Analytics in Fusion

    Hi
    I am unable to access Reports and Analytics . It throws a Error 500 -Internal Server Error when I click on browse catelog button on Reports and Analytics in Fusion
    I have all the required roles and also BIADMINISTRATOR ACCESS still I am unable to login to Reports and Analytics. I have cleared the cache also.
    My collegue who has the same roles is able to access it.
    Regards
    Avinash

    I created the showModule.xhtml in the web.view.module\src\main\resources folder and test the application and Now I'm getting the error in both deployment ways.
    a) Local deployment: Same result
    Error 500--Internal Server Error
    com.sun.faces.context.FacesFileNotFoundException: /showModule.xhtml Not Found in ExternalContext as a Resource
    at com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:232)
    at com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:273)
    b) Remote server:
    Error 500--Internal Server Error
    com.sun.faces.context.FacesFileNotFoundException: /showModule.xhtml Not Found in ExternalContext as a Resource
    at com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:232)
    at com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:273)
    Please check the below screenshots for the mappings captured in the properties window.
    http://imageshack.us/photo/my-images/5/srwebviewmodule.png/
    http://imageshack.us/photo/my-images/811/eclipseexplorer.png/
    http://imageshack.us/photo/my-images/521/cdiandrichfacesear.png/
    http://imageshack.us/photo/my-images/90/cdiandrichfaces.png/
    Thanks,
    Vijaya

  • When trying use any Creative Cloud product on opening an application it attempts to verify my subscription "Membership Expired". I click the button "Try Again" and it says "Thank you, your Creative Cloud is now active. Click Continue to use your product."

    When trying use any Creative Cloud product on opening an application it attempts to verify my subscription "Membership Expired". I click the button "Try Again" and it says "Thank you, your Creative Cloud is now active. Click Continue to use your product." Clicking continue takes me back to the Member Expired prompt. My account and subscription are both active and current.

    Does your Cloud subscription properly show on your account page?
    If you have more than one email, are you sure you are using the correct Adobe ID?
    https://www.adobe.com/account.html for subscriptions on your Adobe page
    If yes
    Some general information for a Cloud subscription
    Cloud programs do not use serial numbers... you log in to your paid Cloud account to download & install & activate... you MAY need to log out of the Cloud and restart your computer and log back in to the Cloud for things to work
    Log out of your Cloud account... Restart your computer... Log in to your paid Cloud account
    -Sign in help http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html
    -http://helpx.adobe.com/creative-cloud/kb/sign-in-out-creative-cloud-desktop-app.html
    -http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html
    -http://helpx.adobe.com/creative-suite/kb/trial--1-launch.html
    -ID help https://helpx.adobe.com/contact.html?step=ZNA_id-signing_stillNeedHelp
    If no
    This is an open forum, not Adobe support... you need Adobe staff to help
    Adobe contact information - http://helpx.adobe.com/contact.html
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"

  • I need an application that will turn off my iPhone on the home screen just by a one click since my power button has sank and is no longer working--anyone have ideas?? I don't like having to use assistive touch and hit three buttons to lock my screen

    I need an application that will turn off my iPhone on the home screen just by a one click since my power button has sank and is no longer working--anyone have ideas?? I don't like having to use assistive touch and hit three buttons to lock my screen

    No such app exisits or can exist.  Apple doesn't allow 3rd party apps to access core functions of the phone.  Time to get your phone replaced or repaired if assistive touch doesn't needs your needs.

Maybe you are looking for