5 Replies Latest reply on Jun 26, 2013 5:15 PM by elainecc

    tween max with a child

    oliverS

      Hello everybody,

       

      I asked a few weeks ago, but the last step is missing,

      so I could realy need some help:

       

      I placed a symol on stage with:

       

      sym.stop();

      var eins = sym.createChildSymbol("eins", "Stage");

      eins.getSymbolElement().css({

                'position': 'absolute',

                'left': 100,

                'top': 0

      });

       

       

       

      Now I want to move this symbol with tweenMax with a button

       

      So thanks for reply, I know it has to work whith:

       

      Try to use this:

      var  mySymbol = sym.getComposition().getStage().$("eins");


      TweenMax.to(mySymbol,2,{css:{y:120, scale:1, opacity: 1}, delay:0, ease:Expo.easeOut});

       

       

      But it does not. It must be my fault but I dont know how to fix it.

       

      maybe somebody could have a look at it:

       

      http://go-motion.net//upload/examples/04/test.zip

       

      Thank you in advance

       

      Oll

        • 1. Re: tween max with a child
          BigMucho Level 1

          Im away from my laptop, but try this:

           

          ////

           

          var eins = sym.createChildSymbol("eins", "Stage");

          var moveEins = eins.getSymbolElement();

           

          TweenMax.set(moveEins, {position:'absolute', left:100, top:0});

          TweenMax.to(moveEins, 2, {y:120, scale:1, opacity:1, delay:0, ease:Expo.easeOut});

           

          ////

           

          A couple of GreenSock  points: 

          * update to the latest version, or use the CDN, you then dont need to specify that a parameter is CSS (GS now just "gets it")

          * Try playing with the "TweenMax.set" as an alternative to setting parameters with JQ, it a little faster, and it works well when using GS timelines.

          • 2. Re: tween max with a child
            oliverS Level 1

            Thanks for quick response.

            It´s close to.

            Now it moves the new second createt child "eins"on the stage,

            but I placed the "eins" Symbol already on the stage whit the code

            on the first frame:

             

            sym.stop();

            var eins = sym.createChildSymbol("eins", "Stage");

            eins.getSymbolElement().css({

                      'position': 'absolute',

                      'left': 100,

                      'top': 0

            });

             

            I want to move it (whith a klick on a button) after I placed it .

             

            Thank you

            • 3. Re: tween max with a child
              sarhunt Adobe Employee

              Hey Oliver,

               

              I downloaded your .zip - did you get this working? The eins symbol moves when I click the button.

               

              Sarah

              • 4. Re: tween max with a child
                oliverS Level 1

                There are two "eins" symbols. One is placed manually on the stage per drag and drop

                 

                from the library and the second is placed with a trigger (var eins = sym.createChildSymbol("eins", "Stage");

                 

                The first one moves the second not. I want to move the symbol which is placed with the trigger.

                • 5. Re: tween max with a child
                  elainecc Adobe Employee

                  Hi, Oliver-

                   

                  Did you still need help with this issue?  I believe we resolved the issue in this thread, right?

                   

                  http://forums.adobe.com/message/5438239#5438239

                   

                  -Elaine