Animation start/stop/pause on mouseclick #2

Hi,
Sorry for opening a new thread -- it was probably unwise to mark my previous question "answered" and then to post a follow-up question in the very same thread and hoping for more help..
My final goal would be to have the animation pause after the first click, then resume with the next click and so on.
So, after successfully having started the animation on click thanks to kglad's advice, I tried adding a
this.addEventListener(MouseEvent.CLICK,stopF);
function stopF(e:MouseEvent):void{
this.stop();
in order to make the animation stop on the click thereafter. This did not work when I put it all on the first frame:
stop();
this.addEventListener(MouseEvent.CLICK,playF);
function playF(e:MouseEvent):void{
this.play();
this.addEventListener(MouseEvent.CLICK,stopF);
function stopF(e:MouseEvent):void{
this.stop();
However, in the meantime I found out that if I put the "stop" event handler on the next frame, it stops again on the second click, as wanted. I then assumed I would be able to put a "play" event handler on frame 3 and so forth, in order to create a "pause" workaround.
Suprisingly, the animation coul not be resumed on the third frame. Why is that? Any chance to have a "pause" functionality on click?
Thanks again!
PS: Here is my "code" in detail:
on keyframe1 I have:
stop();
this.addEventListener(MouseEvent.CLICK,playF);
function playF(e:MouseEvent):void{
this.play();
Works! Then on keyframe 2:
this.addEventListener(MouseEvent.CLICK,stopF);
function stopF(e:MouseEvent):void{
this.stop();
Works! But on keyframe 3: 
this.addEventListener(MouseEvent.CLICK,playF);
function playF(e:MouseEvent):void{
this.play();
does not work!?

If you have new questions you are better off starting a new posting, even if they followup on something that was solved.  Postings with 0 replies get noticed.
Just create a variable that you toggle each time you click and use that variable to determine whether to stop or play... in frame 1...
stop();
var stopped:Boolean = true;
this.addEventListener(MouseEvent.CLICK,playF);
function playF(e:MouseEvent):void{
   if(stopped){
       this.play();
   } else {
       this.stop()
   stopped = !stopped;

Similar Messages

  • Gif animation start stop pause

    Can I pause the gif animation? start, stop?

    Hello,
    you can't control a gif animation in Edge but you can use John Dunning's plugin for exporting symbols from Fireworks to Edge. you can download and try it here: http://johndunning.com/fireworks/about/EdgeAnimate

  • Privileges to Start / Stop / Pause Tidal Master

    Hi Team,
    Please your advise on what's the minimum level of privilege in a Windows environment that a user account needs to have to be able to Stop/Start/Pause the Tidal Master.
    We think we should belong to the Administrators group to be able to action the above.
    Our Security team has raised concerns on we getting to much access into that box if we get Admin rights.
    Thanks.

    You could work with the system administrators to grant all the appropriate privileges to stop/start services using an MMC snap-in  We do that with our operations team... they can stop/start tidal services (master/agent) but they can't logon to the servers themselves. System Admins have tools for setting this up. You could also add runtime users and possibly automate.
    however, if I am responsible for Tidal Administration and application, I would want to be able to logon to the infrastructure that runs the master (or agents) it just makes sense from a troubleshooting perspective to have local access.(App logs, System Log, Event logs, etc.). But responsibilities and roles vary from company to company.
    I wasn't sure if you meant manually (above) or automated but we do some autmation of shutdown for maintenance using Tidal jobs for maintenance weekends like MS patches (using a combination of powershell and api jobs)
    Marc

  • How can i control when my animation starts/stops with external JS

    I am making a web app that will allow you to go through "pages" by clicking and dragging or sliding your finger (touch devices).
    I am wanting to make a seperate animation on Edge for each page and play it when the current page is on witht the relevant edge comp.
    So far my code allows me to know what page is being viewed and that the animation should be played, however I can not figure out how to play the comp.
    ie.
    WHEN page = 1, play composition "page1".
         If currentPage is not currentPage, stop composition "page 1".
    Please could you help me as I've been racking my brain all day to figure this out.

    Hi,
    You'll find a tutoriel here.
    Then, example #1 and example #2.

  • GIF animation start, stops halfway and fully repeats

    On something like this http://i.imgur.com/aQS9uF6.gif, the gif repeats suddenly halfway through, then plays as normal.

    Wait till the image is fully loaded before watching it.

  • Music spontaneously starts, stops, stutters at random and I'm not even using that app. Repeated attempts to pause the song and close the app have no affect. Just keeps popping on and off randomly no matter what I'm doing at the time.

    How do I eliminate this glitch?  Music spontaneously starts, stops, stutters at random and I'm not even using that app. Repeated attempts to pause the song and close the app have no affect. Just keeps popping on and off randomly no matter what I'm doing at the time. I tried double-clicking the Home button which brings up all of the active apps, touched and held the Music icon until all the icons started wiggling, tapped the Close icon in the upper left corner of the Music app to close the app completely, but the app is still open and still randomly stuttering. I did notice that the play button icon flashes in the upper right corner of the screen when this happens and it appears and disappears in concurrence with the Music app stuttering. When the music starts, the icon appears and when it stops, the icon disappears again. When the music stutters on and off, the icon appears and disappears rapidly and in sync with that random glitch. This just started today for no apparent reason. I turned the iPad off, waited 30 seconds and turned it back on. As soon as it was finished starting up, the same music glitch began again immediately. I'm using iOS 6.1.3.

    Well, no one seems to have any answers or ideas for me, I'll update what I've been able to accomplish.
    I reloaded all 14 disks in the time frame of watching Lord of the Rings on Fri. nite.
    Funny thing is, the first disk pulled the info from the online store! Hooray!
    Wait-then all the next 13 could find no information online...what the heck is up with that? So I MANUALLY assign each disk a new track # to co-inside with each disk, spent about 2 hours doing that.
    But still, itunes tells me my playlist is too large, there's not enough space on the ipod. so I unchecked 1 1/2 disks (I'd listen to 1/2 of disk 1 previously) and voila! there's my ipod full of my book. Finally. But what a lot of bother just to keep things in order!

  • SWFLoader : stop/ pause / play features ?

    hi,
    I am using the SWFLoader component to play Flash files (with SWF extension).
    <mx:SWFLoader id="animation_toto" x="24" y="36" source= "toto.swf" autoLoad="true" width="657" height="164"/>
    I am able to control the start of the animation with the load() method.
    animation_toto.load();
    However, I do not see stop / pause methods to stop / pause the animation.
    (But they exist in the VideoDisplay component.)
    How do i do that ? Is there a way ?
    Thanks a lot for helping.

    Hello Zen,
    Thanks for the RecursiveStop() function tip. I tried this out in my Flex application where I have to play one movie clip after another but without success. Here is the scenario: I am using a SWFLoader class on the main application form and have set a swf path. On application initialization, I call the stop() method to the MovieClip that is loaded in my SWFLoader object.
    MovieClip(Application.application.mySwfLoader.content).stop(); // THIS WORKS
    Later on click of a button, I dynamically store the paths of the swf files that I want to play one after another into an ArrayCollection and call a function to play the first item in the ArrayCollection.
    myArrayCollection.addItem("assets/beginning_swfs/0114INSTR.swf");
    myArrayCollection.addItem("assets/beginning_swfs/0111INSTR.swf");
    myArrayCollection.addItem("assets/beginning_swfs/0201INSTR.swf");
    myArrayCollection.addItem("assets/beginning_swfs/0202INSTR.swf");
    setTimeout(PlayMovieClip, 1000);
    In the PlayMovieClip() function, I set the path of the first item (swf file) as the source of the SWFLoader object in my application, again assign the content of the SWFLoader object to a MovieClip object and add an eventlistener - Event.ENTER_FRAME along with the method checkFrame() that will be invoked when the EVENT_FRAME event is raised. After this I call the MovieClip.play() function.
    if (myArrayCollection.length == 0)
    return;
    path=String(myArrayCollection.getItemAt(0));
    trace("Starting movie: " + String(myArrayCollection.getItemAt(0)));
    Application.application.mySwfLoader.source = path;
    flashMovie=Application.application.mySwfLoader.content as MovieClip
    flashMovie.addEventListener(Event.ENTER_FRAME, checkFrame);
    flashMovie.play();
    Now once in the checkFrame() method, I determine if the end of the MovieClip has been reached. Stop the movie if the end frame has been reached.
    if (event.target.currentFrame == event.target.totalFrames)
         trace("Stopping movie: " + String(myArrayCollection.getItemAt(0)));
         // stop the movie, call the RecursiveStop function.
         RecursiveStop(MovieClip(event.target)); //event.target cast to MovieClip
         event.target.removeEventListener(Event.ENTER_FRAME, checkFrame);
         // Check if the array has elements in it.
         if (myArrayCollection.length != 0)
              // Remove the top most one.
              myArrayCollection.removeItemAt(0);
         // Check if there are more items in the array.
         if (myArrayCollection.length != 0)
              // Play the next file
              PlayMovieClip();
    I expect the MovieClip files (SWF) to play one after another but there is an overlap and the movies do not stop playing.
    Any help pointing what I am doing wrong or a push in the right direction is highly appreciated. I've spent at least 3 days now trying to solve this issue without success.

  • ITunes 11 will no longer rewind in stop/pause mode !

    iTunes used to be able to rewind while in stop/pause mode : alt cmd arrow left would rewind 5 seconds.
    I use it on a daily basis for transcribing music.
    Now, I suppose because of iTunes 11 (or is it Mountain Lion..?)  rewind is only possible in play mode !! (while the song is playing..)
    Is there anyone who can help me , or has a solution to fix this problem ?
    Thanks !
    Carlo

    Here is the log. Looks like its QT is crashing it. So, again, its either QT, or one of the Vista updates. I haven't tried to watch a movie on the computer in awhile so I have no idea what update in the past few months is causing the problem.
    Log Name: Application
    Source: Application Error
    Date: 2/11/2009 4:08:29 PM
    Event ID: 1000
    Task Category: (100)
    Level: Error
    Keywords: Classic
    User: N/A
    Computer: OU812
    Description:
    Faulting application iTunes.exe, version 8.0.2.20, time stamp 0x4925c4fe, faulting module QuickTimeH264.qtx, version 7.55.90.70, time stamp 0x49011c68, exception code 0xc0000005, fault offset 0x00073570, process id 0x159c, application start time 0x01c98c8ac9ea815b.
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    <System>
    <Provider Name="Application Error" />
    <EventID Qualifiers="0">1000</EventID>
    <Level>2</Level>
    <Task>100</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2009-02-11T21:08:29.000Z" />
    <EventRecordID>17730</EventRecordID>
    <Channel>Application</Channel>
    <Computer>OU812</Computer>
    <Security />
    </System>
    <EventData>
    <Data>iTunes.exe</Data>
    <Data>8.0.2.20</Data>
    <Data>4925c4fe</Data>
    <Data>QuickTimeH264.qtx</Data>
    <Data>7.55.90.70</Data>
    <Data>49011c68</Data>
    <Data>c0000005</Data>
    <Data>00073570</Data>
    <Data>159c</Data>
    <Data>01c98c8ac9ea815b</Data>
    </EventData>
    </Event>

  • HTML animation in a Folio flashes once  & lightens the page briefly as the an animation starts

    Hi
    When an HTML animation plays in a folio page on the iPad the animation flashes lighter briefly as the animation starts.
    Is there a way to stop this happening?
    Alan Ross

    Does it flash every time, or only first time you run it?

  • DV Start/Stop issue with DVC Pro 50

    Hey guys/ladies... I'm editing with Final Cut studio 2 (FCP 5) and i want to use the "DV Start/Stop Detect" feature. I'm capturing video with the DV50 NTSC 48KHz codec, however, when I try to use the DV Start/Stop Detect function, it gives me an error that reads "The clip you have selected does not reference a movie that can be analyzed". I've brought this video in via FireWire, and I see in the manual that it should work with DV, DVCPro, DVCPro 50, and DVCPro HD... The deck i'm using is the Panasonic AJ-SD93P (DVCPro 50), and the camera for aquisition is Panasonic AJ-SDX900P (DVCPro 50). What am I missing?
    G5   Mac OS X (10.4.9)   2x 3GHz Dual-Core Intel Xeon

    Ah! the operative word here is "may"... it's bad information I believe. The camera has to have a time of day code function recorded in the signal or it won't work... and only the consumer/prosumer level cameras have this feature. If you can't superimpose the time of day and date over the picture in the recording mode (like consumer cameras do) this isn't going to work.
    FCP reads this code and when it detects a break in time (every time you pause would be when this happens) it can place the markers. But if the feature isn't on the camera, FCP can't read it. I've never read nor seen this work on anything but DV 25 recordings... and then only if the camera has the time of day capability.
    Jerry

  • Logic Pro midi start/stop remote

    I would like to start and stop (and even record) in logic with MIDI-commands from my keyboard (Roland RD-700GX).
    The keyboard has several midi buttons which are progammable but the message which is sent, is not a controler or SysEx but the start/stop status bytes of the MIDI-protocol. Logic cannot recognise these messages. Is there any trick or what can I do to work around this problem.

    voss.audio wrote:
    (look at FAH and FCH!)
    Well I downloaded the Midi Implementation manual and it says that these the S1 and S2 buttons send this messages for start/stop. They are labeled as "Real Time Midi messages" but I could not understand if they are MMC ones for this device. If it is standard MMC it must looks like:
    *MMC messages*
    An MMC message (that is sent to, or generated by, an MMC device) is:
    *F0 7F deviceID 06 command F7*
    The third byte is the Device ID.
    The fifth byte is the command:
    01 Stop
    02 Play
    03 Deferred Play
    04 Fast Forward
    05 Rewind
    06 Record Strobe (Punch In)
    07 Record Exit (Punch out)
    08 Record Ready (Record Pause)
    09 Pause
    0A Eject
    0B Chase
    0F MMC Reset
    40 Write
    44 Locate/Go to
    47 Shuttle
    Where the Roland Device ID is 41 as far as I remember.
    You can try the S1 & S2 start/play function but first enable "Listen to MMC Input" logic sync setting ( see the pic below ).
    I downloaded the User Manual of the RD-700GX as well, so in page 103 I found "Transmitting the Control Change (USER CC)". can you try to assign for S1 & S2 buttons ? If yes then assign CC13 for S1 and CC14 for S2 ( values 0 for example ). After that try to learn the Logic Keycommands dialog for play stop using this buttons - see my first post picture.
    !http://img707.imageshack.us/img707/9002/mmc.gif!
    !http://img59.imageshack.us/img59/4967/aglogo45.gif! [www.audiogrocery.com|http://www.audiogrocery.com]

  • Print job starts, stops on last page of job, then finally restarts.

    Hello, I have an HP Office Jet Pro 8500 (A909), connected via router (ethernet cable). Windows 8, HP Pavillion machine, i5 processor, 64 bit, 6gigs ram
    The print job starts, stops on last page of job, then finally restarts, then starts whole print job over with same results; pausing for about a minute, restarting and finishing job but the driver must detect that the job - still in the queue - is not done and starts again.
    I've swapped ethernet cables with the same results. I can print over the wireless network with other computers and do not have this issue.
    I thought it was a driver issue so I uninstalled/reinstalled HP software, with all available updates, same results.
    The only work around at my disposal now, other than printing from another machine, is to wait for the last page to print and manually clear the queue so the job doesn't print again. Suggestions?
    Thanks

    Hey @DavidWW ,
    Thank you for joining us on the HP Forums today, hope you enjoy your time with us! Also thank you for taking the time to thoroughly explain the issue, much appreciated. 
    I understand you are having an issue with the last page printing late, the computer not recognizing it, re-printing and so on. You need to print, wait for stall and then last page and then clear queue to stop the printer. That is truly annoying, however; I might have a fix for you in 1 simple post... maybe not, but maybe at least.
    Try the tool I have posted below and run the print fix option.
    Click here to download and run the Print and Scan Doctor >>> www.hp.com/go/tools
    If that doesn't fix your issue make sure you let me know and we can continue.
    I worked for HP.

  • Embedded media player controls (play, stop, pause, etc.) on multiple sites will not respond in FireFox 12.0 or will only respond after multiple clicks

    I go to multiple websites that contain embedded media, such as billburr.com, tunein.com, and forums where members embed media from sites like YouTube. When attempting to access or use that media, using the available play, stop, pause, and volume control buttons, FireFox doesn't respond. For example, If I'm on billburr.com and attempt to play the podcast, I can click the play button over and over again and nothing will happen. The play button lights up like the site realizes I'm clicking it, but the media will not play, at least not the first time. I might get it to work after several fast clicks. However, if I need to pause it, I have the same trouble. These sites work perfectly in IE 9. I've already started FireFox in safe mode, but encountered the same problem. Has anyone seen this?

    That is a Flash player on the billburr<i></i>.com site.
    You can try to install the 32 bit Flash player for Firefox from this page.
    *http://www.adobe.com/special/products/flashplayer/fp_distribution3.html
    For Firefox on 64 bit Windows, you need the 32 bit Flash version version because Firefox is a 32 bit application.

  • How can I show an image before my animation starts playing

    Hey there!
    First of all, great work on making Adobe Edge...! I can see real potential in the use of this program!
    I have started to work on an animation which will work as a splash-screen before the users see the actual site. (Yes I know... but the client wants it like this...)
    The problem I have now is that the animation plays after a few seconds and that during these seconds it shows the content of the website. Besides that I still find it pretty difficult to actually position the animation the way I want.
    I am using a plug-in for wordpress so I might not be in the right place to find help.
    I tried fixing this with a pre-loader but this is also too slow. Is there any way I can force the animation to play sooner or to make sure they can't see the content before the animation has played?
    You can find the concept of the website on: www.appyourservice.nl/concept/Jack.
    Any help is appreciated.
    Cheers,
    Dominic

    For sure,
    It's also in my reply above. What I did is add an other div to my website which overlaying the complete content.
    Then you add in the animation a line to hide this div before the animation starts playing like so:
    So add this to the stage in "CompositionReady" --> jQuery("#div").hide();
    This will make sure that the animations hides the div before playing so you will see first only the overlaying div and once the animation is ready to play, this div will hide and the animation will start.
    Hope this helps.
    Cheers,
    Dominic

  • Why do animated GIFs stop animating

    I just upgraded to Muse CC Prerelease July 29, 2013 Version 6, Build 717.
    Some animated GIFs stopped animating. Should I go back to my May 31st version of Muse?
    Is there a released version of Muse?
    Animated GIFs have always had problems when an effect like a Shadow or a Glow is applied. Sometimes they animate, sometimes they don't.
    Usually I can get animated GIFs to work if they are not placed as text objects but it makes it more difficult if things reflow.

    Message was edited by: pennyschuler

Maybe you are looking for

  • Root element required

    SDNers, I have created a message type in XI and have exported the XSD. When I try to import the XSD in the syndicator, I get an error message: Root element required. Thanks in advance. + JT

  • Speck Case for Macbook Pro Worth It?

    I just ordered the black seethru mbp case and was wondering if any of you enjoy it as much the reviews say it.  The real question i wanted to ask was since i always have it on my desk most of the time don't actually take it anywhere either, is the ca

  • How to change Self Monitoring Thresholds in SOLMAN 7.1 SP8?

    Hello Expert, I'm wondering if there is an option to change Self Monitoring Thresholds in SOLMAN 7.1 SP8? I'm getting so many SOLMAN Self Monitoring alert's emails, so looking forward to adjust the thresholds (if this is possible at all)? Your help i

  • Jpeg and dpi?

    How do I create in jpeg format an image no larger than 8" h x 8" w at a resolution of 300dpi or less that I can transfer to a CD-Rom that is PC compatible?  I'm entering a sculpture competion, and these are the requirements.  Many thanks!

  • Siebel database migration from Sql Server 2005 to Oracle 11g RAC.

    Hi, We would like to migrate our Siebel database from Sql Server 2005 to Oracle 11g RAC. Can you suggest the best way to do that ? The current configurations are: Application : Siebel database : SQL Server 2005 The hardware can be changed if needed.