How to stop a recursive loop

I have a recursive loop fade in several video clips, the one after the other (see text below), it works fine and the flash is located in an html page. However, when I navigate between this and other html pages - sometimes the recursion happens again to return to this page & at the same time it again so it seems that the elements are blurred in a completely random way.

How stop/reset the recursive loop by entering the page again?

Thanks in advance for your suggestions.

function revealSentences(num:Number) {}

var showText:Tween = new Tween (this "discourse" [+ num], "_alpha", Strong.easeIn, 0, 100, 2, true ");

showText.onMotionFinished = function() {}

_root ["speech" + num].sentences_txt.text = _root.textItems [num];

delete this ['speech' + num]._accProps.silent;

if (num < textItems.length) {}

                                    trace("num:"+num);

revealSentences(num+1);

                        }

            };

}

revealSentences (0);

do not local showText revealSentences(): remove the var.

and run a showText.stop (), when you navigate away from this page.

Tags: Adobe Animate

Similar Questions

  • How to stop an infinite loop due to a guest user placed during development without close LabView?

    How to stop an infinite loop due to a guest user placed during development without close LabView?

    Thank you!

    Hi chuck72352,

    Press on "Ctrl +." and keep pressing OK on the MsgBox. There will be a point when the program terminates.

    Mike

  • How to stop the timeline loop (where the loop is not activated)

    Hello

    How to stop the chronology of looping/jump at the beginning of the timeline automatically when the playhead reaches the end of the edition / the end of the timeline please? The loopback feature is disabled. Its really frustrating when you look at the video game back, and when it reaches the end, he always goes early in the Cup again. Any help would be greatly appreciated. Thanks Tatjana

    Thank you! I fixed it. Its automatic scrolling of the playback head.

  • How to stop the recursion on event

    Hello

    I have a table shape with text fields that have the onchange event handlers. The event handlers call a function that changes many of the fields, so there is a lot of recursion. How could stop all other events when a change occurs?


    Tiina

    Normally, changing a value via javascript will not trigger an onchange event. However, dynamic action of the apex 'value' default will trigger a change event. So if you use dynamic actions then the solution would be to define 'Change to suppress event' on 'Yes' on real action.
    If you use javascript, check if you use $s to set a value. The docs say this:

    PValue value is stored in the hidden field to return. The pSuppressChangeEvent parameter is optional. By the way either FAKE or not passing this parameter value results in a change event of shooting for the element set. Pass TRUE to prevent the change event firing for the element set.

    If you do not use dynamic measurements of the $s function, then check if a change event is raised in your javascript, usually done by '. change().

  • How to stop a while loop structure in the event of a main vi

    Hello;

    Sorry for my English

    I have to stop to a Subvi my main VI, the Subvi contains a while loop and an event structure, so I need to stop this loop while I tried directly from my main vi, global variable, but it did not work

    any help please or example!

    How about something like this (solution see attachment) using a user event.

    Explore the User Interface--> range of events and dialogue. To display the dynamic event of the terminals in the structure of the event just right click and select 'display the dynamic event posts '.

  • How to stop the While loop in the Structure of the event with the same button?

    Hello

    I have a problem. I want to use a single control to activate an event in a structure of the event and the same control to end a while loop in this case.

    It is possible to use 2 controls to do this, but I need to be alone.

    Thank you

    You should NEVER place while loops inside the case of the event, and it is never necessary to do. Think about it: all you have to do is spin the code. You can easily use the outside while loop for everything. Simply place the code of the loop internal (without the inner loop) inside the case of delay and manipulate the time-out period between a pending finished and the infinite (-1), depending on the State of the Boolean value.

    A very simple example (LV 8.0)

  • How to stop the VI and a Sub VI together

    Hi, in my application, I have a vi with a state machine with a loop of event handler. One of the events in my loop of event handler is out who runs the State of the output of my state machine. I also have an under vi outside my statemachine.

    The problem:

    1. at the exit of pressing my Vi does not stop.

    Reason: my sub vi is still running.

    Need solution : How tp stop the two loops together using the exit button.

    StateMachine P.S:1.My is inside a while loop and while loop runs inside my sub vi also.

    2. both the loops are parallel, since I'm on queues in it.

    2. both the loops are parallel, since I'm on queues in it.

    There are many ways, depending on your architecture.

    Can pass you a message from out of your event loop to your another loop on the queue?

    Another way is to use a global Boolean variable 'Stop' and use it in your second loop exit condition. Set it in the event loop when you want to stop the program.

    The producer consumer example stops the second loop by closing the queue during the first loop stops and then to capture the error when the second loop trying to read the queue.

  • stop a sound loop :(

    I am extremely new to Flash as a whole.

    I imported sound and dragged to the timeline - after watching a bunch of discussions I realized that I couldn't change the music at all.

    How to stop music from looping through itself?

    Here is the animation until now:

    http://www.fastswf.com/ruTpjkg

    What should I do to get it actually stop?

    If your timeline plays repeatedly the keyframe where starts your sound, you will need to remove your sound on the timeline and use actionscript to play your sound.

    Otherwise, click the keyframe where starts your sound and, in the properties panel, there is a loops parameter which should be 0.

  • Tutorial: how to stop a loop 'while' Subvi, which within the main program loop 'while '.

    Hi ppl,

    I searched through the forum on the topic above, but still don't know how to do this. Maybe one of you can post the solution of this important issue.

    I have attached a very simple program: I've done a few while loop as a main program and Subvi as a post-secondary program. Inside the Subvi also manages some while loop. All I want to do is to push the stop button in the main program that will stop the while loop in the second channel; to create a kind of judgment of reference in the main program which influence only the stop button on the Subvi. During this time the loop of the main program will still work.

    Thank you.

    I modified the code that you have joined. check.

  • How to stop a clip of a loop at the end of my main timeline?

    I have searched and tried many suggestions and couldn't quite find a solution to my specific challenge.

    I use Adobe animate CC to produce HTML5 banner ads, no is put in place as a HTML5 Canvas document.

    My main timeline is 15 seconds long and any animation must stop at 15 seconds. While I have been using Flash for years I me as never any good at Actionscript.

    On one of my main calendar layers, I placed a short Clip (85 images) I'd like to loop until the end of the main timeline (356 frames).

    How to stop the Clip or more instances of the MC at the end of the main timeline?

    Any help is greatly appreciated. Thank you

    Apparently, some syntax was wrong.

    So on the last frame of the layer actions main adds on the scenario:

    This.instance - name-of-Movie - Clip.Stop ();

    It worked

  • HOW TO CREATE A STOP COMMAND IN LOOP FOR

    I have a problem. I can't put a stop to the VI attached here. I want to stop an iteration without support on cancel execution, because I want to connect this VI by a Subvi to control a motor continuous.

    Thank you

    Hello

    in order to stop your first vi, you can use a stop button for the while loop to 'or' with the release of your "equal" comparison function Then you can also use a local variable created the stop button to stop the loop for, configure it with a conditional expression (right click on the loop for > conditional expression).

    This way if you press "stop"button, you will stop the while loop and the loop together foor.

    Good bye

  • Need help cleaning a recursive loop, please.

    Hello again,

    I'm on another quest to write a function completely fool proof to a very specific task in Illustrator. The task is to create a new work plan in the target document (determined by a guest of small script user interface) which is a certain distance from the existing chart with the highest index Board (so I'm still putting the new plan of work at the end). After I created the work plan, I want to activate the source document and duplicate all the layers (a few layers are empty but will be used later) and work in the doc of the target and place them on the newly created artboard.

    With the help and advice of Silly-V , I wrote a recursive loop to handle the situation of nested layer. This brings me to the first part of my question. Please take a look at recursion and let me know if there is anything I can do to clean it up and simplify as much as possible. (I know it looks really messy. I've learned how do on the fly and I changed a lot of variables and loops after the fact, just trying to make it work). I hope also that somehow slightly more efficient to work this will improve stability as well. As it is, I can only run this script 3 or 4 times (if I'm lucky), before I get persistent errors of MRAP on trivial things such as: layers.getByName("Information").visible = false; At this point, the only recourse is to stop illustrator and reopen files. So I'm usually good for a few runs more...

    Part 2 of my question is the following. Is there a way to reproduce the work from one document to the other, and place it on the new artboard rather than the artboard [0]? Currently, art is duplication of artboard [0] the doc from the source to the artboard [0] the doc of the target and then I manually manipulate the implementation by defining: this.left this.left = + (artboards.length * 2100). First, it is just steps adding too much to the script and slow things down I'm sure. The second problem that is after 4 work plans, I need down another line (to keep from spilling onto the pasteboard). That adds another layer of complexity and a lot more if statements to determine how far from move it and in what direction.

    Here's the script in its entirety. Please do not hesitate to rip it and ask me WTH I thought. According to carloscanto, script.elegant is definitely fake.

    var copyToMaster = function(){
      var docRef = app.activeDocument;
      var layers = docRef.layers;
      var masterFile = getTargetDoc();
      if(masterFile == null){
      return;
      }
      var master = app.documents.getByName(masterFile);
      var sourceDoc = app.activeDocument;
      var move;
      var myLayer;
      var targetLayer;
      var innerTargetLayer;
      var outerTargetLayer;
    
    
      //Logic Container//
    
      function outerRecursive(layer){
      var name = layer.name;
      try{
      outerTargetLayer = targetLayer.layers.getByName(layer.name);
      }
      catch(e){
      outerTargetLayer = targetLayer.layers.add(ElementPlacement.PLACEATBEGINNING);
      outerTargetLayer.name = name;
      }
      if(layer.pageItems.length>0){
      for(var b=layer.pageItems.length-1;b>-1;b--){
      var curItem = layer.pageItems[b];
      var copyCurItem = curItem.duplicate(outerTargetLayer,ElementPlacement.PLACEATBEGINNING);
      copyCurItem.left = curItem.left+move;
      }
      }
      if(layer.layers.length>0){
      for(var e=layer.layers.length-1;e>-1;e--){
      var subSubLayer = layer.layers[e];
      innerRecursive(subSubLayer);
      }
      }
      }
    
      function innerRecursive(subLayer){
      try{
      innerTargetLayer = outerTargetLayer.layers.getByName(subLayer.name);
      }
      catch(e){
      innerTargetLayer = outerTargetLayer.layers.add();
      innerTargetLayer.name = subLayer.name;
      }
      if(subLayer.pageItems.length>0){
      for(var g=subLayer.pageItems.length-1;g>-1;g--){
      var curItem = subLayer.pageItems[g];
      var copyCurItem = curItem.duplicate(innerTargetLayer,ElementPlacement.PLACEATBEGINNING);
      copyCurItem.left = copyCurItem.left + move;
      }
      }
      if(subLayer.layers.length>0){
      for(var h=subLayer.layers.length-1;h>-1;h--){
      innerRecursive(subLayer.layers[h]);
      }
      if(name == "Information"){
      layer.locked = true;
      layer.visible = true;
      }
      else if(name == "Prepress"){
      layer.locked = false;
      layer.visible = false;
      }
      }
      if(subLayer.name == "Information"){
      subLayer.locked = true;
      subLayer.visible = true;
      }
      else if(subLayer.name == "Prepress"){
      subLayer.locked = false;
      subLayer.visible = false;
      }
      }
    
      function getTargetDoc(){
    
      var docs = [];
    
    
      for(var a=0;a<app.documents.length;a++){
      docs.push(app.documents[a].name);
      }
    
    
      var targetIndex = new Window("dialog", "Which is Master");
      var newTextGroup = targetIndex.add("group");
      newTextGroup.text = targetIndex.add("statictext",undefined,"Which file do you want to merge to?");
      newTextGroup.align = "center";
      var radioGroup = targetIndex.add("group");
      radioGroup.alignChildren = "left";
      radioGroup.orientation = "column";
      for(var a=0;a<docs.length;a++){
      radioGroup.add("radiobutton",undefined,docs[a]);
      }
      radioGroup.children[0].value = true;
    
      var buttonGroup = targetIndex.add("group");
      var ok = buttonGroup.add("button", undefined, "OK");
      var can = buttonGroup.add("button", undefined, "Cancel");
    
    
      function selected(which){
      for(var c=0;c<which.children.length;c++){
      if(which.children[c].value == true){
      return which.children[c].text;
      }
      }
      }
    
    
      if(targetIndex.show() == 1){
      return (selected(radioGroup));
      }
      else{
      return;
      }
    
    
      targetIndex.show();
      }
    
      function createNewArtboard(){
      master.activate();
      move = ((master.artboards.length) * 2100)
      var aBcount = master.artboards.length;
      var lastAB = master.artboards[master.artboards.length-1];
      var aB = lastAB.artboardRect;
      var left = aB[0];
      var top = aB[1];
      var right = aB[2];
      var bot = aB[3];
      var moveRight = 2100;
      var moveDown = 2100;
      if(aBcount != 5 && aBcount != 10){
      var newLeft = left + moveRight;
      var newRight = right + moveRight;
      var rect = [newLeft,top,newRight,bot];
      var newAb = master.artboards.add(rect);
      }
      else{
      var originAb = master.artboards[0].artboardRect;
      var oLeft = originAb[0];
      var oTop = originAb[1];
      var oRight = originAb[2];
      var oBot = originAb[3];
      oTop = oTop - moveDown;
      oBot = oBot - moveDown;
      var rect = [oLeft,oTop,oRight,oBot];
      var newAb = master.artboards.add(rect);
      }
      sourceDoc.activate();
      }
    
      //Function Calls
    
      createNewArtboard();
    
      for(var a=0;a<layers.length;a++){
      layers[a].locked = false;
      layers[a].visible = true;
      }
      for(var a=0;a<master.layers.length;a++){
      master.layers[a].locked = false;
      master.layers[a].visible = true;
      }
    
      for(var a=layers.length-1;a>-1;a--){
      var curLayer = layers[a];
      try{
      targetLayer = master.layers.getByName(curLayer.name);
      }
      catch(e){
      targetLayer = master.layers.add();
      targetLayer.name = curLayer.name;
      }
      if(curLayer.pageItems.length>0){
      for(var k=curLayer.pageItems.length-1;k>-1;k--){
      var curItem = curLayer.pageItems[k];
      var copyCurItem = curItem.duplicate(targetLayer,ElementPlacement.PLACEATBEGINNING);
      copyCurItem.left = copyCurItem.left + move;
      }
    
    
      }
      if(curLayer.layers.length>0){
      for(var f=curLayer.layers.length-1;f>-1;f--){
      var curSubLayer = curLayer.layers[f];
      outerRecursive(curSubLayer);
      }
      }
      }
    
      //re-lock/hide layers;
    
      for(var a=0;a<master.layers.length;a++){
      if(master.layers[a].name == "Guides" || master.layers[a].name == "BKGRD, do not unlock"){
      master.layers[a].locked = true;
      }
      else{
      for(var b=0;b<master.layers[a].layers.length;b++){
      var level2 = master.layers[a].layers[b];
      if(level2.name == "Prepress"){
      level2.locked = false;
      level2.visible = false;
      }
      else if(level2.name == "Information"){
      level2.locked = true;
      level2.visible = true;
      }
      }
      }
      }
    
    
    
    
    
    
    
    
    }
    copyToMaster();
    copyToMaster = null;
    

    How is that?

    function duplicateToMaster(){
        function pasteInMaster(){
            if(app.pasteRemembersLayers === false){
                app.pasteRemembersLayers = true;
                app.executeMenuCommand('pasteInPlace');
                app.pasteRemembersLayers = false;
            }else{
                app.executeMenuCommand('pasteInPlace');
            }
        }
    
    var aDoc = app.activeDocument;
    app.executeMenuCommand('selectall');
    app.executeMenuCommand('copy');
    var bDoc = app.documents[1];
    bDoc.activate();
    pasteInMaster();
    }
    duplicateToMaster();
    
  • How to have a while loop inside a structure of matter?

    Hi all

    I would like to know how to control a while loop by using the structure of the case? I would like the person to check if the object has is in its original position or not.

    If this is the case, go...

    The object must then do its job, as mentioned in the while loop... as up and down 10blocks...

    Later, when she returns to its original position, the entire process must stop...

    I checked the forums on this http://forums.ni.com/t5/LabVIEW/How-to-stop-while-loops-inside-a-case-structure/m-p/591259

    It is the closest, I can have... but can someone tell me how to program for this? How logic should be?


  • How to stop compensation labview my data output by a fixed amount of 0.125 seconds of every second iteration 1?

    How to stop compensation labview my data output by a fixed amount of 0.125 seconds of every second iteration 1? (I have my DAQ Assistant contained in a while loop so that I can control the number of iterations and therefore the time of sampling).

    My apologies for such a badly phrased statement of problem. The question I faced which was the sign that I was getting a pair of accelerometers and through an amp. in my DAQ board felt an offset in voltage for a short period every second iteration 1. It turns out that the problem is that my laptop and the AGP were grounded. Once I disconnected the signal ground in the shift of the signal amp went.

    Thank you for your messages.

    Kevin

  • Stop a while loop in a sub - VI in a message in queue manager

    Hi all

    I am trying to program a control for certain manufacturing equipment. For this I use a message in queue manager. Within the QMH, I have a VI that controls a particle size probe (called a PPC, at the bottom of the first image. When I start the main-vi, the PPC.vi is on the case "Parsum measurement", in which measurement data are repeatedly called in a while loop (screw for call data provided by the manufacturer of the probe. Also, I am aware that I don't connect the data again. That will come later.). When I want to stop the measure, I have send the message "Exit" to the PPC.vi (last photo). However, the vi is stuck in the while loop in the case of the measure and is unresponsive. I tried to send a notifier with a constant value true, but that did not work as well.

    You have any suggestions, how can I stop the while loop before you send the message "Exit"? Or is the completely different way to approach this problem?

    Thank you!

    I just threw together a framework very fast to help you get started.  The thing I noticed is that the library of the queue doesn't have a time-out of the waiting message entry.  Since it is your own local copy (to the project), add a timeout and connect to the element Dequeue function.  I by default set to-1 and make it "recommended".

Maybe you are looking for