Jump to content
Search Community

Da Man

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by Da Man

  1. I have two arrays in javascript, here's a small example:

    arr1 = [0, 0, 0, 0];
    arr2 = [3,6,3,5];

    I want to tween all the numbers from arr1 to arr2. So,

    from 0 to 3
    from 0 to 6
    from 0 to 3
    from 0 to 5

    I tried doing something like:

    TweenLite.to(this, duration, {arr1:arr2});

    but it didn't work, so I tried again:

    for (var i = 0; i < arr1.length; i++) {
        TweenLite.to(this, duration, {arr1[i]:arr2[i]});
    }

    But that threw up an error.

     

    What's the best way to do this? In my real code, I actually have upwards of 14 elements in the array.

     
    Thanks in advance!
  2. I'm doing some animation on canvas with tweens currently like this (this is just one of a few):
     

    TweenLite.to(data, tweenDuration, {numMsgs:numMsgsResult, delay:overallDelay, ease:easeFunc, onUpdate:draw});

    Needless to say, the draw() function is called onUpdate and it is what draws on my canvas. I was wondering, however, whether moving to a ticker approach would improve performance. If it does, then that'd be great.

     

    However, I tried reading the documentation for it and I'm still a bit confused as to how I'd implement this. How do I go from what my code currently does to a ticker approach?

     

    Thanks in advance.

×
×
  • Create New...