Stop a setTimeout function?

Hey guys

I have a setTimeout that shows a symbol after ten seconds. However, if the user clicks a button in the following ten seconds, I want the setTimeout to stop.

So far, I have this code to implement the setTimeout tab click the phase:

If (play)

{

timerName = {setTimeout (function ()}

SYM.$("ButtonName"). Show();

(}, 10000);

}

Now it works a treat, however, I have this line to stop it, called by another function:

clearTimeout() (timerName);

However, it does not work

Where I'm going wrong?

See you soon

Hello

It seems that you must use a global function.

Where did you write "clearTimeout() (timerName)": compositionReady, creationComplete, another click action?

You can try:

timerName = setTimeout (function () {sym.$("buttonName").show ()}, 10000);

sym.setVariable ("timerName" setTimeout (function () {sym.$("buttonName").show ()}, 10000));

clearTimeout() (timerName);

clearTimeout() (sym.getVariable ("timerName"));

Tags: Edge Animate

Similar Questions

  • My laptop stopped recognizing wireless function. What drop-down list function should I use to get it to recognize wireless again?

    My laptop stopped recognizing wireless function.  What drop-down list function should I use to get it to recognize wireless again?

    Hello

    What is the brand and model of your laptop?

    Follow the suggestions and check out them.

    Method 1

    You can follow the procedure in the article.

    Enable or disable a network adapter

    http://Windows.Microsoft.com/en-us/Windows-Vista/enable-or-disable-a-network-adapter

    Method 2

    Windows wireless and wired network connection problems

    http://Windows.Microsoft.com/en-us/Windows/help/wired-and-wireless-network-connection-problems-in-Windows

    See also:

    Network adapter problems

    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-network-adapter-problems

  • How to stop an enterFrame function

    Here is my code. I coludnt stop function after n = > 5. I tried removeeventlistener. It did not work. the code gives error every time he enters a new frame.

    var ff1:MovieClip = new FF1();
    var ff2:MovieClip = new FF2();
    var ff3:MovieClip = new FF3();
    var ff4:MovieClip = new FF4();
    var ff5:MovieClip = new FF5();

    var a: Array = new Array();
    a = [ff1, ff2, ff3, ff4, ff5];


    var n: int;
    n = 0;

    a .addEventListener [n] (Event.ENTER_FRAME, oynat);
    function oynat (event: Event): void {}
    addChild (a [n]);
    a [n] .x = Math.floor (Math.random () * 100);
    a [n] there = Math.floor (Math.random () * 100);
    n ++ ;

    }
    if(n>4) {}

    a [n] .addEventListener (Event.CANCEL, oynat)
    ;}

    To stop an enterFrame listener, you use the removeEventListener method.  As the code you show is difficult to make sense, you are the best showing what you have tried so far as to remove it if you want to solve why it did not work for you.  Here's part of what makes your code where you think he does it differently...

    These lines create five instances of a few references to classes and stores them in an array

    var ff1:MovieClip = new FF1();
    var ff2:MovieClip = new FF2();
    var ff3:MovieClip = new FF3();
    var ff4:MovieClip = new FF4();
    var ff5:MovieClip = new FF5();

    var a: Array = new Array();
    a = [ff1, ff2, ff3, ff4, ff5];

    These lines assign an event listener enterFrame until the first element of the array "a".


    var n: int;
    n = 0;

    a .addEventListener [n] (Event.ENTER_FRAME, oynat); / / listener to ff1 assignment

    This function adds what is stored in the 'a' table from the display list

    probably pushing a lot of mistakes once ' is more than 4 since it stops nevers


    function oynat (event: Event): void {}
    addChild (a [n]);
    a [n] .x = Math.floor (Math.random () * 100);
    a [n] there = Math.floor (Math.random () * 100);
    n ++ ;

    }

    These lines do nothing because n = 0 when it runs

    {if(n>4)}

    a [n] .addEventListener (Event.CANCEL, oynat);
    }

  • setTimeout() function does not

    Can anyone help the setTimeOut() function?

    I write code app.setTimeOut ("app.alert('hello')", 2000) which works properly;

    but the following code does not work...

    app.setTimeOut ("sayHello ()", 2000);

    function SayHello)

    {

    App.Alert ('hello');

    }

    Can I know where I am wrong?

    Thank you

    Nith

    Here is a sample to help out you...

    Paul

  • How to return on a Subvi in a calling VI and does not stop the calling function

    I am writing a program which consists of a call VI and one under VI. I want to call function to run continuously and be able to trigger the sub VI (via activation of the voice). I want the sub VI to expire automatically after 10 seconds and return to the calling VI (master), which will continue until the sub VI is still called.

    I found a way to expire the sub VI using the 'stop' command, but he left the appellant VI also, which does not. I know there is no 'back' or 'soft stop' in LabVIEW, but someone he knows a way to do this?

    What you really need in your Subvi is something like what is shown below. You specify the delay using the delay function or get Date/Time In Seconds msec. would work in the same way.

  • What happened to the move to stop in 14 function?

    The function stop movement was one of the reasons I used elements of Prime Minister. Why did take it away? If I know when I bought 14, I would have stayed with 11!

    You are right. Stop motion capture was discontinued in version 12, when Adobe has also stopped the capture on tape function.

  • Is it possible to find a stop(); call to function in a framework?

    Hello all and thanks in advance for any help you can provide.

    Background:

    I have two built-in functions in a SWF root; we stop all clips, nested in the root swf file and the other plays all clips, nested in the root swf file.

    The stop function performs perfectly. The clips that play stop and clips that do not do nothing (as expected).

    Playback function works very well except for one question.

    I changed the function of reading so that it checks each video clip to see if the current frame is 1, or if the current frame is equal to the total number of images in the clip.

    This prevents playback playback of clips which can be on the scene but have not started reading again, either re-clips that have already completed their animation, but are still on the scene.

    Question:

    The issue I'm having with the playback feature is when I'm dealing with nested clips that have been created to be part of a secondary navigation.

    For example; I have a clip named BOB. BOB has ten frames.

    In staggered layers, there is a clip in each frame of BOB which has its own animation and secondary navigation controls.

    When I use the stop function, it stops at all the animations as expected.

    BUT when I use the play function, it goes to the next section of BOB, instead of simply playing the animation of the current image as it normally would.

    Code:

    Unfortunately, I can't copy the function here because of restrictions on access to the source.

    However, here is an example of the IF statement, I use to control the playback of all the clips.

    if (typeOf(mc) == movieclip && mc._currentframe != mc._totalframes && mc._currentframe != 1){
    name_playAll(mc)
    

    I need to add a delimiter to my playback function to account for the existing stop() function calls so that I can make the play function ignore video clips if the current frame has a stop(); in it.

    Is there a method to take into account the existing stop() function calls?

    Once again, thanks in advance for any suggestions you may have.

    No, stop() is a method of movieclip, not a variable boolean and returns void.

    When you apply a stop() to a timeline, use:

    var stopped: Boolean = true;

    If the latter, you apply a play(), you must update stopped to false.

  • 6 elements stopped working (Greyed functions)

    Hi all

    I use elements and have been for some time, but recently most of the functions in the menus has stopped working for example ALL functions of the layer are grayed out. The product is licensed.

    Does anyone have any suggestions / can someone help?

    Thanks in advance

    Craig

    Craig, maybe your image is 16-bit rather than 8-bit

    If yes go to Image Mode

    Then choose 8-bit/channel

  • with what my windows vista, does not not, extremely slow, start, stop, and overall functioning. This model is an H.P. Presario420US I have not downloaded anything at all to clog it HELP! TX. Email removed for privacy

    Why is my computer so slow? I have windows vista in a notebook presario H P, 6 months old. It is slow to start, slow operation and when I stop it takes forever. I have not to down load something for her to cover. It dose the same when I try to wbob249ork offline. It says Windows NO answer.  Help!  any input would be greatfull. E-mail address is removed from the privacy *.         OR * address email is removed from the privacy *.

    Start with "clean boot" (read article) and check if the system works better in a State of "strictly punt.

  • How to stop the import function resulting in a gel?

    I use Lightroom 6.0 on a PC running Windows 10 and I was using before Lr5. My Lr5 ceased to be able to import correctly. It kept freezing around 10%. Tried various things offered on the forums.

    Finally gave up and bought a new version 6.0 to solve the problem. Imagine my surprise when even if this did not help.

    I tried to disable the graphics processor acceleration.

    I tried to rename the folder containing both Lr5 and Lr6 preference files and I'm still in the same situation.

    Thanks for the update.

    Would recommend to copy some images on your desktop and then try to import them into Lightroom just to the test application to check if the import process go through.

  • Pause in adobe feature animate CC

    Hello, I'm doing a pause feature to animate CC (for purposes of advertising of HTML5)

    The principle is simple, as stop anim, wait 3 seconds, struck again play.

    This code doesn't seem to work.

    function fonctionPause(tps){
    
      this.stop();
      function lecture(){
      this.play();
      }
      setTimeout(lecture, tps);
    
    
    }
    
    
    fonctionPause(3000);
    

    Can someone give me a hand?

    Thank you.

    Almost!

    _this = this;

    pauseFor = {function (sec)}

    _this. Stop();

    setTimeout (function () {_this.play ()}, s * 1000);

    }

    pauseFor (3);

    It works, thanks for the help!

  • Pause animation for 3 sec (was: break)

    How can I stop an animation for 3 seconds using a trigger?

    Hello

    You can easily achieve this by adding following the click on the action panel of the item code

    SYM. Stop();

    setTimeout (function () {sym.play(1000) ()}, 3000);

    Please check the attachment for a better understanding.

    http://Adobe.LY/1yAuQOI

    Concerning

    Vivek

  • Trigger points - sliders

    Hi, can someone help me please about trigger points.

    Basically, I create a banner flash/slider. I have 4 images and I want to stop every image playing for 3 seconds and then display the following image.  Any ideas? I was watching a tutorial about it but does not have the function code / gave only. I'm new on the thing all code/edge/muse/webdesign and need simple answers right pleeeaaasse front

    the video I was watching- http://www.YouTube.com/watch?v=n8XLVLh5MIM

    The code given - but does not work...

    SYM. Stop();

    setTimeout (function () {sym.play(1000) ();}, 5500) ;

    Hi Robyn, it is from this work for me.

    /////////////////////////////////

    SYM. Stop();

    setTimeout (function () {sym.play(1000) ()}; 5500);

    ////////////////////////////////

    Is above what you have on each trigger of chronology.

    Download sample: http://www.heathrowe.com/edge/slideshow/slideshow.zip

    The sample extract: http://www.heathrowe.com/edge/slideshow/slideshow.html

    HTH

    Darrell

  • Help with Js and symbol

    Where to start.

    I have a simple composition which includes a rectangle with images nested on the stage.  The rectangle and images make up a simple slideshow that rotates at a slight angle. Triggers convenient timeline, I use a code snippet that first each image and plays then stops the timeline after 3 second delay.  Works a treat during a test in a browser and I am satisfied with the results.  When I convert the animation of a symbol and a test in a browser, code snippets seem to be ignored and the time planned, allocated between each slide simply does not work.

    The code snippet: sym. stop ();

    setTimeout (function () {. play()}, 3000);

    Shoot me because I have no idea about the coding - but miss me certainly something here.  As a coder, you can possibly put me right?  your a lot.

    Hello

    Are your triggers in the symbol timeline? If not, then select them in the main timeline, cut them to the Clipboard and then enter the symbol timeline and paste them.

    HTH,

    Joe

  • function setTimeout in flash 10 (linux)

    have a strange problem. I wrote a flex application that loads the images from the local file system. There is a function which checks, if all the images are loaded. I use the settimeout function to check the status of the images. Otherwise all images are completed, I use settimeout to call control function. Sometimes, the control function is not called, although not all the images are loaded.

    I put the tracks in each line. Everything seems fine, but in rare cases, the application has stopped working.

    Here is an excerpt of the control function (deleted tracks):

    private void CheckImagesLoaded (): void {}

    clearTimeout() (TimeoutId);

    var _LoadedImages:int = 0;

    check images
    If (myLogo._Loaded == true) {}
    _LoadedImages ++;
    }
    else {}
    If ("myLogo._Error! =" ") {}
    trace (myLogo._Error);
    }
    }


    see other images...

    // [...]



    If (_LoadedImages < _MaxImages) {}

    TimeoutId = setTimeout (CheckImagesLoaded, 50);
    }

    else {}

    application startup

    }

    }

    Note: myLogo is a class, the Event.COMPLETE Manager affect the indicator _Loaded Boolean true, if the image is loaded.

    You can create a custom event.  Examples in the doc and this forum search

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

Maybe you are looking for

  • An error occurred when to partition the drive

    I have a MBP 2012 retina end 13 "El Capitan 10.11.6 The hard drive in the machine is swapped with Transcend SSD of retinaTRIM is not enabled. I'm trying to install 10 Windows using Boot Camp, and I get this error. An error occurred when to partition

  • Audio but not vision

    I'm trying to airtime of various Apple devices to my AppleTV. When you try to do, I'm getting audio but not vision. When return to Apple devices, everything works normally again. I guess there is a problem with my AppleTV. It doesn't seem to matter w

  • Blue Screen of Death Dell PC error Code 650F137B

    Hello Recently I was make a noise from my PC to start up, and then all of a sudden now I have a blue screen with the error code 650F137B that the same thing happens When I try to start in safe mode, fortunately I backed up my data before that happens

  • Sydney Australia time zone

    sydney Australia time zone

  • drop-down menus are not open

    Any program that uses the menu drop-down menus in the program such as outlook will allow not her drown to the bottom of the window to stay open enough long to allow you mouse and choose anything from the drop down. When a window pops up which is happ