Sure.

package {
        import gs.TweenLite;
        
        public class ArrayTweenExample {
                private var arr:Array;
                
                public function ArrayTweenExample():void {
                        arr = [2.34, 100, -666];
                        trace(arr);
TweenLite.to(arr, 1, {endArray:[567.8, 999, 0], onUpdate:onArrayValueChange})
                }
                
                private function onArrayValueChange():void {
                        trace(arr);
                }
        }       
}

Output:
2.34,100,-666
67.09591373999999,202.952581,-589.730346
98.51287133999999,252.90102100000001,-552.727386
133.87956703999998,309.12897599999997,-511.072416
165.95641645999996,360.12654899999995,-473.292234
195.88508333999997,407.708821,-438.042186
224.65568813999997,453.44994099999997,-404.156106
252.26823085999996,497.34990899999997,-371.63399400000003
279.53075383999993,540.6933959999999,-339.524136
304.79098295999995,580.853524,-309.772584
328.8931499999999,619.1724999999999,-281.38500000000005
351.8372549599999,655.650324,-254.36138400000004
374.2854514999999,691.339725,-227.92185
394.8772428599999,724.077709,-203.668794
414.3109721399999,754.9745409999999,-180.77970600000003
432.5866393399999,784.030221,-159.25458600000002
450.2205094399999,812.065536,-138.48537599999997
466.14386303999987,837.3813759999999,-119.730816
480.9091545599998,860.8560639999998,-102.34022400000003
494.5163839999999,882.4896,-86.31360000000006
507.3359276599999,902.8708290000001,-71.21471399999996
518.5908434999999,920.7645249999999,-57.958650000000034
528.6876972599999,936.817069,-46.066554
537.62648894,951.0284609999999,-35.53842600000007
545.6317061599999,963.755604,-26.109864000000016
552.2181842399999,974.2271559999999,-18.352296000000138
557.6466002399999,982.8575559999999,-11.958696000000032
561.9169541599999,989.646804,-6.929064000000039
565.10784494,994.719861,-3.1708260000000337
567.0258852599999,997.7692689999999,-0.9117540000000872
567.7858634999999,998.9775249999999,-0.016650000000140608
567.8,999,0


Kenneth Kawamoto
http://www.materiaprima.co.uk/

Cor wrote:
Hi Kenneth,

That's interesting.
How can I tween an Array.
Do you perhaps  have a little example code?

TIA
Cor

-----Oorspronkelijk bericht-----
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Kenneth Kawamoto
Verzonden: woensdag 26 maart 2008 14:45
Aan: Flash Coders List
Onderwerp: Re: [Flashcoders] Tweening Engines for AS3

Then I'll tell you TweenLite can tween anything. It can even tween Array (of
numbers).

The last time I checked Tweener did not have filter tweens, that's why I
picked TweenLite/TweenFilterLite. But things may have changed.

Jack has even fixed a little (albeit non-critical) buggish TweenLite
behaviour for me earlier this year in a few days. Big respect!

Kenneth Kawamoto
http://www.materiaprima.co.uk/

Allandt Bik-Elliott (Receptacle) wrote:
i've never used tweenlite but i have used tweener and one of the things that blew me away was the ability to tween properties and variables rather than just clips/sprites

example from current project:

[CODE]
// read/write percentage value relates directly to the slider public function get percent():Number { return slider.percent; } public function set percent( p:Number ):void { slider.percent = p; }

 public function arrowPressed( e:MouseEvent ):void  {
        var dir:int = (e.target.name == "left_arrow") ? -1 : 1;
    var total:Number = slider.percent + (dir * scrollSpeed);
Tweener.addTween(slider,{percent:total, time: .5, transition:"easeInOutQuad"}); // Tweens set() method } [/CODE]

you may be able to do this with tweenlite, i don't know
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to