2 Replies Latest reply on May 11, 2015 2:28 AM by owen_bayley

    button to play 4 symbols glitchy- plays IN simultaneously, plays OUT sequentially. Why?

    g.bollmann Level 1

      I have 4 symbols, each simply a variant in the color and text. All 4 symbols are built on the same animation, but are independent symbols. Each symbol itself is composed of 3-4 symbols. I have combined these 4  into a master symbol. I have created a menu symbol to control the master symbol (e.g. the 4 variants). These 4 variants are identically built and should behave in tandem.

       

       

      Simple show/hideing works in tandem, no problem. Simultaneously playing IN the timelines of the 4 symbols in works. Unfortunately, each play OUT sequentially. Therefore, I must click 4x  to play OUT the 4 variants. (playReverse)

       

      Sometimes it looks like the computer "had no time" to execute all the code, so it skips.

       

      Questions:

      Why can't 1 button control the different symbols in parallel?

      Does it have to do with playReverse?

      Is there a limit on the symbol nesting hierarchy?

      In what order/priority does EA execute code?

       

      thx!

       

      p.s. My programming skills are rather basic. I haven't tried anything more sophisticated than show/hide and play/playReverse.

        • 1. Re: button to play 4 symbols glitchy- plays IN simultaneously, plays OUT sequentially. Why?
          g.bollmann Level 1

          /// in the following code, where some other && arguments are deleted, toggle OFF needs to be above toggle ON

           

          // def adj - toggles OFF

          if (sym.getComposition().getStage().getSymbol("GV-CASES").getSymbol("NOM-basic_case_symbol") .getSymbol("NOM-def-basic").$("marker-def-adj").is(":visible")) {

             sym.getComposition().getStage().getSymbol("GV-CASES").getSymbol("NOM-basic_case_symbol"). getSymbol("NOM-def-basic").playReverse().play(250,true);

          }

          if (sym.getComposition().getStage().getSymbol("GV-CASES").getSymbol("ACC-basic_case_symbol") .getSymbol("ACC-def-basic").$("marker-def-adj").is(":visible")) {

             sym.getComposition().getStage().getSymbol("GV-CASES").getSymbol("ACC-basic_case_symbol"). getSymbol("ACC-def-basic").playReverse().play(250,true);

          }

          if (sym.getComposition().getStage().getSymbol("GV-CASES").getSymbol("DAT-basic_case_symbol") .getSymbol("DAT-def-basic").$("marker-def-adj").is(":visible")) {

             sym.getComposition().getStage().getSymbol("GV-CASES").getSymbol("DAT-basic_case_symbol"). getSymbol("DAT-def-basic").playReverse().play(250,true);

          }

          if (sym.getComposition().getStage().getSymbol("GV-CASES").getSymbol("GEN-basic_case_symbol") .getSymbol("GEN-def-basic").$("marker-def-adj").is(":visible")) {

             sym.getComposition().getStage().getSymbol("GV-CASES").getSymbol("GEN-basic_case_symbol"). getSymbol("GEN-def-basic").playReverse().play(250,true);

          }

           

           

           

          // def adj - toggle ON

          if (sym.getComposition().getStage().getSymbol("GV-CASES").getSymbol("NOM-basic_case_symbol") .getSymbol("NOM-def-basic").$("marker-def-art").is(":visible") ) {

            sym.getComposition().getStage().getSymbol("GV-CASES").getSymbol("NOM-basic_case_symbol"). getSymbol("NOM-def-basic").play("def-adj");

          }

          if (sym.getComposition().getStage().getSymbol("GV-CASES").getSymbol("ACC-basic_case_symbol") .getSymbol("ACC-def-basic").$("marker-def-art").is(":visible") ) {

            sym.getComposition().getStage().getSymbol("GV-CASES").getSymbol("ACC-basic_case_symbol"). getSymbol("ACC-def-basic").play("def-adj");

          }

          if (sym.getComposition().getStage().getSymbol("GV-CASES").getSymbol("DAT-basic_case_symbol") .getSymbol("DAT-def-basic").$("marker-def-art").is(":visible") ) {

            sym.getComposition().getStage().getSymbol("GV-CASES").getSymbol("DAT-basic_case_symbol"). getSymbol("DAT-def-basic").play("def-adj");

          }

          if (sym.getComposition().getStage().getSymbol("GV-CASES").getSymbol("GEN-basic_case_symbol") .getSymbol("GEN-def-basic").$("marker-def-art").is(":visible") ) {

            sym.getComposition().getStage().getSymbol("GV-CASES").getSymbol("GEN-basic_case_symbol"). getSymbol("GEN-def-basic").play("def-adj");

          }

          • 2. Re: button to play 4 symbols glitchy- plays IN simultaneously, plays OUT sequentially. Why?
            owen_bayley Level 1

            Hey g.bollmann,

             

            this should help:

             

            Why can't 1 button control the different symbols in parallel?

             

            you can, I can see some errors in your code (edge does not have the best debugger tool built in so it may say code is fine when it is not). the best way to test for errors is to see what you have just code work how you want. you can use the alert (); function to help see if code it being triggered to a value is what you want

             

            e.g. banana = 8, so alert (banana); should show 8 but if It does not I know I have done something wrong

             

            Does it have to do with playReverse?

             

            To use playReverse use it like play as it does the same e.g.

             

             

            Edge uses milliseconds do 2500 = 2.5 seconds. You can play from a label but any trigger will be hit again so you will need to add a bool or something so that the code will not run again in the triggers

             

            Is there a limit on the symbol nesting hierarchy?

             

            Not from what I know I have has 10 within 10 within 4. I would recommend only have around 5 within 5 to 3 deep as you need to know where all the symbols are and what they all do so connecting and running them all can take a long time.

             

            In what order/priority does EA execute code?

             

            From what I have seen from edge it runs code in order, if you have code that does not run then it can be an errors in the code(edge stops running all code in the trigger or click if there is an error in a line). You can use several alerts to see where the errors accurse as the alerts the error will not show.

             

            Use different if statements (have you tested the ones you have? do they work?).

             

            I would use a bool or int if statement as this is easier to keep track of:

             

            In creation compete set the variable;

             

            var variblesname = true; or var variblesname = 1;

             

            you can have as many as these as you like just changed the name

             

            you then set them by

             

            variblesname = the values;

             

             

             

             

            and use them in an if by calling them again

             

            if (variblesname == 8) {

             

            do stuff

             

            }

             

            else if (variblesname == 9) {

             

            do stuff

             

            }

             

            else {

             

            do stuff if the other is statements don't work

             

            }

             

            for your if statements have "else if", if you don't want any other if to play if one of the requirements are met and an else if you want something to happen if none of the "if"'s requirements are met not met

             

             

            Hope this helps