[Tweener] LOST
Xiongmao
wodexiongmao at gmail.com
Sun Jul 11 04:22:27 PDT 2010
Christian,
Thank you so much for your support, as I work alone I feel better to received your help.
I understand for the array and the function, nice ! I will try that.
For the position look at the other example bellow on how I do it.
Now I still feel think coding animation is not easy for timing a lots of object moving. I am wondering about an intermediate method that would be a kinf of GUI that record for you the code. For example you would just move an object and scale it on the scene and then get the code in return. What do you think ?
Do you work as freelancer ?
Do you know where I can download Tweener code example with complex animation for learning ? It is not Twenner but more how to make the AS for it that looks hard to me.
Best regards,
Julien
//Animated header
function startanim():Void {
//Default text state
_root.txt0._alpha = 0;
_root.txt0._x = 61;
_root.txt0._y = 22;
_root.txt1._alpha = 0;
_root.txt1._x = 260;
_root.txt1._y = 50;
_root.txt2._alpha = 0;
_root.txt2._x = 150;
_root.txt2._y = 95;
//txt0 transition
Tweener.addTween(_root.txt0,{_alpha:100, time:10, delay:0, transition:"easeInOutQuad"});
Tweener.addTween(_root.txt0,{time:10, delay:0, transition:"easeInOutQuad", _x:300, _y:22});
Tweener.addTween(_root.txt0,{_alpha:0, time:5, delay:11, transition:"easeInOutQuad"});
//txt1 transition
Tweener.addTween(_root.txt1,{_alpha:100, time:10, delay:20, transition:"easeInOutQuad"});
//Tweener.addTween(_root.txt1,{time:10, delay:0, transition:"easeInOutQuad", _x:300, _y:50 });
Tweener.addTween(_root.txt1,{_alpha:0, time:10, delay:31, transition:"easeInOutQuad"});
//txt2 transition
Tweener.addTween(_root.txt2,{_alpha:100, time:10, delay:25, transition:"easeInOutQuad"});
Tweener.addTween(_root.txt2,{time:10, delay:25, transition:"easeInOutQuad", _x:50, _y:95});
Tweener.addTween(_root.txt2,{_alpha:0, time:10, delay:40, transition:"easeInOutQuad"});
//Default fish state
_root.fish.fish1._x = 72.2;//settings x and y pos to avoid reverse loop animation
_root.fish.fish1._y = 74.8;
_root.fish.fish1._alpha = 0;
_root.fish.fish2._x = 108.2;
_root.fish.fish2._y = 58.1;
_root.fish.fish2._alpha = 0;
_root.fish.fish3._x = 158.7;
_root.fish.fish3._y = 74.8;
_root.fish.fish3._alpha = 0;
Tweener.addTween(_root.fish.fish1,{_alpha:100, delay:40, transition:"easeInOutQuad", _x:500, _y:74.8, _bezier:[{_x:100, _y:100}, {_x:150, _y:20}], time:8, transition:"linear"});
Tweener.addTween(_root.fish.fish2,{_alpha:100, delay:45, transition:"easeInOutQuad", _x:500, _y:74.8, _bezier:[{_x:100, _y:100}, {_x:150, _y:20}], time:8, transition:"linear"});
Tweener.addTween(_root.fish.fish3,{_alpha:100, delay:36, transition:"easeInOutQuad", _x:500, _y:74.8, _bezier:[{_x:100, _y:100}, {_x:150, _y:20}], time:8, transition:"linear", onComplete:startanim});
}
startanim();
On 11 Jul 2010, at 6:59 PM, Christian Pugliese wrote:
> Hi...
> well not sure how you set your x/y but you could do it in a while loop...
>
> for initial position, you could set it on the stage, or accessing direct the obj properties:
> clipend2.alpha = 0;
> txt1.x = 79;
> txt1.y = -22.2;
>
> for the animations there are more than a way, one of them is making an array with all your clips, and calling the function wherever you want..
>
> var clips:Array = [clipend1, clipend2, txt1, etc etc];
>
> function animate( obj:DisplayObject, obj_time:Number, obj_delay:Number, obj_x:Number, obj_y:Number):void
> {
> Tweener.addTween( obj ,{time:obj_time, delay:obj_delay, transition:"easeOutBounce", x:obj_x, y:obj_y});
> }
>
> then wherever in you move you want to animate something:
> while( i > 0)
> {
> var objDelay:Number = .5;
> var objTime:Number = 1;
> animate( clips[i], i*objTime, i*objDelay, X_POS, Y_POS )
> i++;
> }
>
> i dunno how you set you x/y so this only would word if you find a way to pre-define these.
>
> hope it helps.. cheers.
>
>
> Christian Pugliese
> Interactive Designer & Developer
> chris at chrisid.com
> www.chrisid.com
> +44 07836 564 955
>
>
>
>
> On 11 July 2010 04:25, Xiongmao <wodexiongmao at gmail.com> wrote:
> Hi Christian !
>
> Thank you so much for your reply :
>
> Here's an example of code I make when I code animation, this one was for a banner, mainly letters animation :
>
>
> import caurina.transitions.Tweener;
> import caurina.transitions.properties.CurveModifiers;
>
> var startanim:Function = function():void {
> //setting initial position
> Tweener.addTween(clipend2, {alpha:0, time:0, delay:0, transition:"easeInQuad"});
> Tweener.addTween(clipend1, {alpha:0, time:0, delay:0, transition:"easeInQuad"});
> Tweener.addTween(txt1,{time:0, delay:0, transition:"easeOutBounce", rotation:0, x:79, y:-22.2});
> Tweener.addTween(txt2,{time:0, delay:0, transition:"easeOutBounce", rotation:0, x:583.2, y:12});
> Tweener.addTween(txt3,{time:0, delay:0, transition:"easeOutBounce", rotation:0, x:603.0, y:39.1});
> Tweener.addTween(txt4,{time:0, delay:0, transition:"easeOutBounce", rotation:0, x:747.6, y:39.1});
> Tweener.addTween(txt5,{time:0, delay:0, transition:"easeOutBounce", rotation:0, x:859.2, y:39.1});
> Tweener.addTween(txt6,{time:0, delay:0, transition:"easeOutBounce", rotation:0, x:960, y:39.1});
> Tweener.addTween(txt7,{time:0, delay:0, transition:"easeOutBounce", rotation:-78.7154541015625, x:-33.6});
> trace (txt7.rotation);
>
> //start play
> Tweener.addTween(txt1,{time:2, delay:0, transition:"easeOutBounce", x:79, y:12});
> Tweener.addTween(txt2,{time:1, delay:2, transition:"easeOutBounce", x:328, y:12});
> Tweener.addTween(txt3,{time:1, delay:4, transition:"easeOutBounce", x:79, y:39.1});
> Tweener.addTween(txt4,{time:1, delay:5, transition:"easeOutBounce", x:227.6, y:39.1});
> Tweener.addTween(txt5,{time:1, delay:6, transition:"easeOutBounce", x:339.1, y:39.1});
> Tweener.addTween(txt6,{time:1, delay:7, transition:"easeOutBounce", x:440, y:39.1});
>
>
> Tweener.addTween(txt7, {rotation:0, x:79, time:0.8, delay:9, transition:"easeOutBounce"});
> trace (txt7.rotation);
> Tweener.addTween(txt1, {rotation:1, y:60, time:1, delay:8.9, transition:"easeOutBounce"});
> Tweener.addTween(txt2, {rotation:2, y:60, time:1, delay:8.9, transition:"easeOutBounce"});
> Tweener.addTween(txt3, {rotation:2, y:60, time:1, delay:8.9, transition:"easeOutBounce"});
> Tweener.addTween(txt4, {rotation:-2, y:-10, time:1, delay:8.9, transition:"easeOutBounce"});
> Tweener.addTween(txt5, {rotation:2, y:60, time:1, delay:8.9, transition:"easeOutBounce"});
> Tweener.addTween(txt6, {rotation:2, y:60, time:1, delay:8.9, transition:"easeOutBounce"});
> Tweener.addTween(clipend1, {alpha:100, time:3, delay:12, transition:"easeInQuad"});
> Tweener.addTween(clipend2, {alpha:100, time:5, delay:15, transition:"easeInQuad", onComplete:startanim});
>
> //Tweener.addTween(txt1, {rotation:370, time:1, transition:"easeinoutquad"});
> //Tweener.addTween(txt1, {scaleX:1.5, scaleY:0.5, time:0.33, delay:8, transition:"easeinoutquad"});
> //Tweener.addTween(txt1, {scaleX:0.5, scaleY:1.5, time:0.33, delay:8, transition:"easeinoutquad"});
> //Tweener.addTween(txt1, { scaleX:1.5, scaleY:1.5, time:0.34, delay:8, transition:"easeinoutquad"});
>
>
>
> };
> startanim();
> linksite.buttonMode = true;
> linksite.addEventListener(MouseEvent.CLICK, onClick);
>
> function onClick(evt:MouseEvent):void {
> var url:String = "http://www.wbsitelink.com";
> var request:URLRequest = new URLRequest(url);
>
> }
>
> stop();
>
>
> On 11 Jul 2010, at 6:04 AM, Christian Pugliese wrote:
>
>> could you post a sample of your code?
>>
>>
>>
>>
>> On 10 July 2010 16:12, Xiongmao <wodexiongmao at gmail.com> wrote:
>> Hi,
>>
>> I am using Tweener for moving a numbers of objects.
>> After making moving a few number of objects I am always facing to the same problem:
>> I get a lots of code for each animated object and synchronizing them is asking me to edit so many numbers in my code that I get lost and confused.
>>
>> What is the best way to code with tweener and make simple code to keep animation editing easy ?
>>
>> Best regards,
>> Julien
>>
>>
>> _______________________________________________
>> Tweener mailing list
>> Tweener at lists.caurinauebi.com
>> http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
>>
>>
>>
>> --
>> Christian Pugliese
>> Interactive Designer & Developer
>> chris at chrisid.com
>> www.chrisid.com
>> +44 07836 564 955
>> _______________________________________________
>> Tweener mailing list
>> Tweener at lists.caurinauebi.com
>> http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
>
>
> _______________________________________________
> Tweener mailing list
> Tweener at lists.caurinauebi.com
> http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
>
>
>
>
> --
> Christian Pugliese
> Interactive Designer & Developer
> chris at chrisid.com
> www.chrisid.com
> +44 07836 564 955
> _______________________________________________
> Tweener mailing list
> Tweener at lists.caurinauebi.com
> http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.caurinauebi.com/pipermail/tweener-caurinauebi.com/attachments/20100711/cac84143/attachment.htm>
More information about the Tweener
mailing list