1-button Play/Pause button

Hey there,

Well, as the title says I need to create a Play/Pause button in one. So, when I click the button it plays my animation, and then when I click it again it stops it. And then when I click it it again plays the animation where he was. etc etc.

I know how to create a simple button and give an event and a function, but I can't figure out how to meet these 2 functions in one?

What I got so far as code:

Stop();
PauzePlayknop.addEventListener (MouseEvent.CLICK, mouseClick);
function mouseClick(event:MouseEvent):void
{
Play();
}

I hope someone can help me out =)

Greetings,

Coyke

Try something in the sense of:

Stop();

var playing: Boolean = false;

PauzePlayknop.addEventListener (MouseEvent.CLICK, mouseClick);
function mouseClick(event:MouseEvent):void
{

play =! play;
{if (Playing)}

Stop();

} else {}

Play();

}
}

Tags: Adobe Animate

Similar Questions

  • Is it possible to change the link to the WMP to Play/Pause/Stop buttons

    Is it possible to change the link to the WMP to play/Pause and the Stop button?
    Because network alone and media buttons can be changed by the software.
    And I'd rather not WMP for my favorite media player.

    Unfortunately, the buttons are configured with WMP (if the CD is inserted) and WinDVD (if the DVD is inserted).
    I guess that you can not use buttons with 3rd party applications.

  • Satellite E100-004 - can I disable media buttons as mute, play pause

    My laptop is Toshiba Satellite E100-004.
    is there a way disable the multimedia button panel (Media buttons on top of keyboard - mute-media-play/pause-stop-rewind-forward-)?

    thanx

    Hello

    Please don't be crazy on my but I don't understand your question. These buttons are by default configured to run with pre-installed Windows media player. If you don't like them you just simply do not touch them.
    I know that you can change the browser settings and the multimedia key and define which application should be open with these buttons.

    In any case such option is unknown to me.
    Why you want to disable these buttons?

  • Satellite L20: Play / Pause button have no action

    Nice day!
    Sorry for my English. It is not very good. But I will try to describe a problem with my laptop. :)

    Then... Problem with media - Play/Pause button.
    All other buttons (back, forward, stop) are working properly.
    But the Play/Pause button just launch Windows Media Player 11, when I press it.
    But do not play or pause in the drive. Button Stop Stop playback in the drive, return buttons and next to work according to its tasks. Only the button Play/pause have NO effect in the reader.

    What is the problem in?
    Can I count your s help?

    Thanks for the eyes on my problem. :)

    He s strange because usually utility Toshiba controls control media buttons.
    But this tool is not available on the page of the Toshiba driver

    Have you received the CD tools & utilities?
    Are there any programs or tools called controls buttons or something like that? Install it!

  • Satellite A300 - controls (ie. mute, play/pause) button will not work

    Satellite A300 controls buttons on my laptop reasonably new (ie. mute, play/pause buttons) are only half lit and non-responsive my ironing to.

    They use to work when I got the laptop but suddenly, they stopped. You use to be able to drag your finger across the buttons and they melted, then fade in. Now all look as if are to halfway between the gradual estrangement and are stuck there permanantly.

    Hello!

    Using Windows Vista?

    If so, you should try to reinstall the Toshiba value added Package. You can download the Toshiba site:
    http://EU.computers.Toshiba-Europe.com-online decision-making supported Downloads & => Download drivers

    If you have downloaded the new VAP first remove the old version and restart the laptop. Then install new version and reboot once again.

    Good bye

  • Satellite A200-1AG: can use the play, pause buttons with other software?

    Hey

    I have question about my satellite A200-1AG.
    It's as well as the power button some other which are assigned to media player.
    Can I reprogrammed in some way to the music of change/play/stop/skip with the buttons?

    I never use media center, I know it is asigned a deflaut with the toshiba Vista Home recovery disk, but I just use winamp

    Is there a solution?

    No, as far as I know you cannot reconfigure the keys like play, pause, stop, etc.
    They can be used only with WMP (windows media, media center player)

  • Is it possible to change the function of the buttons play/Pause on Satellite P100-347

    Hello.

    I would like to would like to know if there is a way to change the play / pause button on my phone to stop the opening of windows media Center. I like to use itunes to listen to my music and the other buttons (back, forward and stop), all work with other programs, but there is no way to use the play and pause function without opening of the Media Center.

    It seems that you can only change the internet and function of CD/DVD in the Panel.
    Thanks in advance.

    Hello

    Just reply: no, not possible to change playback / pause feature keys s

    The Toshiba control utility offers two options.
    It allows you to assign and select a program for the internet button and touch CD/DVD.

  • SBH20 play/pause, next, previous buttons do work (Xperia Z3)

    Hello. I bought SBH20 but play, pause, next, previous buttons do not work. Volume buttons and the button play/pause for accept/reject calls work. I use it with a connection with Xperia Z3. Can U help me what could do? Do not want to withdraw. Thank you.

    After Lollipoped my Z3, it works fine. Probably, there was something with kitkat on my phone...

  • foobar2000 starts when you press the Play/Pause button on Sidewinder X 4 keyboard

    As the title suggests, the lance keyboard play/pause key the program foobar2000. No idea how to prevent this?

    It turns out that my Microsoft Mouse and keyboard Center not has not been entirely updated. I do not have the most recent version has caused some of the buttons to not work as expected.

    In any case, I found a solution to my problem - thank you for your help.
  • Streaming audio button for each frame to play/Pause

    I have streaming audio on each frame that automatically starts and stops when the user clicks on the next or previous image. I need to add a pause button on each image. I created a play/pause toggle clip on my first image and it works very well. Frame we use mySound1 and myChannel1, frame both uses mySound2 and myChannel2, etc.

    I get errors when I try to add the code to the next section. What should I do to have a button on each image to stop the corresponding mp3? I appreciate your help!

    SoundMixer.stopAll ();

    var pP:Number = 0; playback position

    var playing: Boolean = false;

    var mySound1:Sound = new Sound();

    var myChannel1:SoundChannel = new SoundChannel();

    mySound1.load (new URLRequest ("Physiology Slide 01 INTRO.mp3"));

    myChannel1 = mySound1.play ();

    SoundMixer.stopAll ();

    PlayPause_btn.addEventListener (MouseEvent.CLICK, togglePlay);

    togglePlay (null);

    function togglePlay(event:MouseEvent):void {}

    play =! play;

    If playS() (play);

    of other pauseS();

    }

    function playS() {}

    myChannel1 = mySound1.play (pP);

    PlayPause_btn.gotoAndStop (2);

    }

    function pauseS() {}

    pP = myChannel1.position;

    myChannel1.stop ();

    PlayPause_btn.gotoAndStop (1);

    }

    you use the same function names (IE, the togglePlay, parts and breaks) on your key frames?  If so, you will see an error in dual function (1120, I think).

    address, use different function names or use a switch/case or if/else sequence in one of each function.

  • Custom button play/pause break drag-and - d├⌐poser? Captivate 9

    Hello

    I'm working on a sensitive project and everything was fine.

    But after I created a play/pause button custom fiscal drag - d├⌐poser has stopped working. The moveable objects appear but they can´t be dragged / cursor doesn´t change.

    Advanced reading action button simply checks to see if the project is paused (by changing the image on the play button) or else (change the button to another State and continuation of the project).

    How could this advanced break action slide it / move?

    Thanks for any help!

    A user variable must be created. You can give it a default value of 0 on creation. For the rest, you just use the same way you used the other buttons to toggle. For a user variable that it is you who decide what values it may have, you can set it is a Boolean value, but if you use the toggle command, it will automatically change the value of 1 if it is 0, or 0 if it is 1.

    You have seen the conditional action (Toggler) in this article.

    Most of the books and (certainly) Lynda tutorials are quite limited, sorry to say.

  • Control edge file animate OAM with the buttons play/pause of Captivate on the skin.

    Hello world

    I worked on a project where I mix a variety of objects and animations.  I do animations animate on board.  The problem I have is that when the user clicks the button pause on the Captivate playback controls, the oam file do not pause.  I found descriptions of how I can make an animation to play/pause the Captivate timeline button on board, but I can't find anything on the use of the Captivate pause button to control the Edge file animate.  Discussions only that I managed to find on that seem to be the answer.  Someone had a bit of luck with this question?

    Any advice would be appreciated.

    Thank you

    Randy

    OK, it's a bit hacky, but it works quite to control the main timeline object in a file of edge of Cape Town, where the Edge file has been imported to Cap 9 as a Web (oam) object. I went seeking answers same like you and came from vacuum, then start to tinker myself and came across the following method.

    Let's use window.postMessage to send a string between Cape document window and document edge iframe window then react accordingly. You can learn more about postMessage accepted battery answer here: http://stackoverflow.com/questions/3076414/ways-to-circumvent-the-same-origin-policy

    In your dashboard file click the support of Actions for the stage object in the timeline and select the compositionReady event. Paste this code into the text window:

    addEventListener for Chrome, attachEvent for IE

    window.addEventListener ('message', receivedFromCaptivate, false);

    window.attachEvent ('onmessage', receivedFromCaptivate);

    function receivedFromCaptivate (event) {}

    switch (event.data) {}

    case "play":

    SYM. Play();

    break;

    case "pause":

    SYM. Stop();

    break;

    }

    }

    Save the file and publish it as an oam, then import the OLS in a slide of Cap, as you normally would. Now, to put in place things of the CAP. Here is a visual aid for the rest of the explanation...

    In the PAC file select the control that you use to start playing the chronology of the edge (in the example above the "slide4Play"), select the checkbox 'Use as button' in the properties on the right, select the "Actions" tab, then to the drop-down list for 'Success' choose "Execute advanced Actions." Click the folder next to the selection of Script control and advanced Actions dialog box should appear. Name your action something (for example, "playEdgeSlide4"), then click the 'Add' in the grey bar to add a new action in the queue. In the drop down "Select Action"... ", choose"execute Javascript. "In the drop down menu"select the window... ". ", choose"current ". Then click on the 'Script_Window' button to bring up a window of text Javascript crap. In this window, you can paste this:

    try {}

    $("iframe") [0].contentWindow.postMessage ("play", "*");

    } catch (e) {}

    Console.log (e.message);

    }

    Select 'OK' to close the window of text Javascript crap, then click the 'Update Action' button to save your new action. Now let's do the same for break action - select the control that you use to pause, go through the steps above, the name of the action, implement advanced action in the same way and in the Javascript crap text window, paste the following text:

    try {}

    $("iframe") [0].contentWindow.postMessage ("break", "*");

    } catch (e) {}

    Console.log (e.message);

    }

    Cap incorporates the Edge file in an iframe on the page that has its own document window. In order to communicate between base ceiling windows and the iframe, we use the postMessage call. So when you hit your button Pause/Play in Cape Town, he publishes an event to the function that gets recorded in the iframe on board. And in the event.data is the string we send above the Cap base window in the function postMessage ('play' or 'pause'). We use a simple switch to react to the data string, stop or have fun with the main symbol of the scene at the edge (sym.play(1000) (), sym.stop ()).

    I hope this helps!

  • play/pause button does not work

    I turned an old project (CC 2014) for 2015 of CC and the play pause button did not work, it is now the same for all my projects and it's very strange. Help me please

    bugt.PNG

    Hi pixelmatic,.

    It is more than likely due to changes in Premiere Pro audio engine. You can post a screenshot of your preferences > Audio Hardware Setup?

  • Play/Pause button

    I just spent my first Alienware of Toshiba laptop and I miss some functionality.

    My previous laptop was préattribués additional buttons like TactX™ and one of them was the Play/Pause button, who has worked for most of the players including Youtube and VLC. Is there a way to set one of the TactX buttons for this function?

    That will not be supported, but I usually use the space bar to play and pause.

  • Captivate 6: why is my button play/pause of slide not getting along with my PREVIOUS slide button?

    I use a BACK button on slides that I built with advanced actions and a play/pause of slide button that I built with stocks advanced on every slide in my project. They work all - except if you click pause, then play, then play again. The slide will play again, but the pause button will no longer work. Let me know if you have any ideas on this problem.

    Thank you
    Brad

    I had finally found it! For someone else, who runs into this problem:

    Use a transparent button (on your images of two buttons) and set its conditional action as follows:

    IF

    Perform the action if all the conditions are met

    cpCmndResume is equal to 1

    cpCmndPause is equal to 0

    Actions

    Assign the cpCmndResume with 0

    Assign the cpCmndPause with 1

    See the PlayBTN (that you have created and appointed beforehand)

    Hide PauseBTN (that you have created and appointed beforehand)

    ON THE OTHER

    Assign the cpCmndResume with 1

    Assign the cpCmndPause with 0

    See the PauseBTN

    Hide PlayBTN

    In this way, if you have a replay of slide in the slide button, your pause/play toggle work after clicking to reread your slide.

  • Central Play/Pause button

    Is it possible to have a button Play/Pause 'Central' in Captivate?  I have inserted a 4 and 5, the video files in Captivate and either have selected "Autoplay" or leave the control to the end user in the skin.  However, when only the user presses pause on the Captivate PlayBar video file will continue to play if I select "Autoplay".  If I do not select 'Autoplay' there are two play/pause buttons (control the video file and the other all the captivate project)... is there a way to combine these two into one central play/pause button play/pause buttons?

    It looks like that your videos have been inserted as videos of the event.  Seek to try inserting them as drag videos instead.  Then you lose skin on the video, but the playback for all of the module bar will pause the videos as well.

Maybe you are looking for

  • Re add music

    is any way to re - add of music without finding all my CDs & goes to this issue the long way to iTunes on my iPod?

  • Scribble Apple Watch

    Why I can't use scribble in Spanish? Scribble bubble disappears when I change the language from English to Spanish in messages

  • Can satellite L300-11 - I replace the CPU for the Core 2 Duo T7100?

    I have laptop Toshiba L300-11F. It integrates CPU INTEL CELERON CPU 550 @ 2 GHz, socket 479P. Can I replace this processor on the socketP478 of core2duo T7100 and know if it will work on 800 MGz?

  • Change region HP C7100

    Hi all I have a HP C7100 while a printer that I bought when I lived in Dubai. I know live in New Zealand and require the cartridges that are not compatible with the region, located on the printer. Can someone tell me how to change the region on this

  • Why the host computer is unable to connect to the smart camera on the network?

    My smart camera of NOR-1772 was connected to our network and functioning as a target to a host computer.  The two are running VBAI 2011.  The camera has been moved to another location on the network and another computer is used as the host? The host