Jump to content
Search Community

fiatuno

Members
  • Posts

    6
  • Joined

  • Last visited

Posts posted by fiatuno

  1. Hi 

     

    Wishing you all a Happy 2019.  

     

    I have an animation requirement where I have a TimelineMax instance and number of TweenMax instances added to it and some of these TweenMax instances (not all) need to be repeated for number of times. So my question is can I create TimelineMax instances and add repeating instances to it and add these repeating TimelineMax  instances to the main TimelineMax instance will it work.

     

     

    Example:

     

    // somewhere globally create main 

    var mainTimeline = new TimelineMax({repeat: false, paused: false});

     

    //later on we loop through an array of objects 

     

    If (obj.repeat){

         var tlr = new TimelineMax({repat:99, yoyo:true, paused: false});

         tlr.add(TweenMax.to(obj, duration, { x:x, 

                                                                    y:y,

                                                                   ease:Quint.easeOut,

                                                                   onUpdate:updateDraw,         

                                                                   overwrite: "none" }));
    }else{

       //add TweenMax instances to mainTimeline

       mainTimeline.add(TweenMax.to(obj, duration, { x:x, 

                                                                    y:y,

                                                                   ease:Quint.easeOut,

                                                                   onUpdate:updateDraw,         

                                                                   overwrite: "none" }));

    }
    mainTimeline.add(
    tlr, self.getDelay();

     

    //end code

     

     

     

    Thanks in advance

     

  2. Hi

    I have simple code as below adding TweenMax obects to the TimelineMax 

     

    timeline = new TimelineMax({repeat: false, paused: true,
      onComplete: cleanTweens,
      onReverseComplete: reverseComplete});

     

    //note arr is an array of objects and duration, delay and xand y varies sets based on function calls has been omitted for brevity

    for(var i = 0; i < arr.length; i++){
       timeline.add(TweenMax.to(arr[i], someDuration, {
        x:someX,
        y:someY,
        rotate:(x * Math.PI)/180, // handled in updateDraw
        ease:Quint.easeOut,
        onUpdate:updateDraw
       }), someDelay)

    }

    then 
    timeline.restart();

    and later on based on request will replay like below

     

    timeline.reverse(0, false);

     

    Issue this vill replay tweens of only last ojects or it appears to play only last tweens.

    any help appreciated

     

    Thanks

     

     

     

     

     

     

     

×
×
  • Create New...