To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Actionscript 3.0

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 10-27-2009, 06:15 PM   #1
jpd1466
Junior Member
 
Join Date: Feb 2004
Posts: 10
controlling animation timing

Hey all. I'm new to OOP and AS3 but I'm diving in head first. I have what is probably a simple question if anyone can help me out with a simple answer. I'm doing my company website. When a mouse event sends you to my services page I have 4 seperate blocks of text that fade in. So far I have the first 2 texts blocks fading in at the same time. I want to stagger the timing so the second block of text starts its fade in a fraction of a second later, and so on with the remaining text blocks. Below is the code I've used to fade them in at the same time. Is there an easy way to adjust this code to achieve the desired effect.


//services text fade in
var servicesText1Tween:Tween = new Tween(servicesText1, "y", Regular.easeOut, 148.9, 140.9, 1, true);

var servicesText1Fade:Tween = new Tween(servicesText1,"alpha",Regular.easeIn,0,1,2,t rue);


var servicesText2Tween:Tween = new Tween(servicesText2, "y", Regular.easeOut, 244.7, 236.7, 1, true);

var servicesText2Fade:Tween = new Tween(servicesText2,"alpha",Regular.easeIn,0,1,2,t rue);



Many many thanks.
jpd1466 is offline   Reply With Quote
Old 10-27-2009, 08:27 PM   #2
absolutezero342
absolutezero3424
 
Join Date: Nov 2006
Posts: 484
I'm going to introduce you to a class that will save your life in terms of animation...first off, forget the built-in Tween class because it's terrible compared to this option. It's called Tweener and you can get it for AS2 & AS3. You can set all tween properties (x, y, alpha, rotation, etc.) in one function call and you can specify easing functions to apply to the MC AND the time and even a delay before executing like you referred to. You can also specify what should happen during certain events pertaining to your animation, such as when it starts, when it ends, etc.

PHP Code:
Tweener.addTween(some_mc, {x: 50, y: 100, alpha: 0.5, time: 3, delay: 5, transition: "Strong.easeIn", onComplete: myFunction});
or you can create an Object that holds all those props and pass that to "addTween", like this:

PHP Code:
var tweenProps:Object = new Object();
//add some props to tweenProps
//...
Tweener.addTween(some_mc, tweenProps);
And since I'm feeling so nice today, I'm going to refer you to the BulkLoader class which can control the loading of multiple MC's, FLV's, mp3's, etc. in one easy, concise package!

Here are the links:

http://code.google.com/p/tweener/

and...

http://code.google.com/p/bulk-loader/

and TweenLite is like Tweener, same stuff basically, but maybe you'll like it better...I use Tweener cause I'm used to it.

http://blog.greensock.com/licensing/
absolutezero342 is offline   Reply With Quote
Old 10-28-2009, 12:37 PM   #3
jpd1466
Junior Member
 
Join Date: Feb 2004
Posts: 10
Hey Thanks. I'm going to check it out and report back.
jpd1466 is offline   Reply With Quote
Old 11-04-2009, 08:53 PM   #4
jpd1466
Junior Member
 
Join Date: Feb 2004
Posts: 10
controlling animation timing with Tweener class

Hey absolutezero342 thanks for the Tweener tip. I used it to add delays to in my code and it works great and is pretty easy to use so far. For anyone out there using MC Tween you should try the Tweener class instead. I have another issue I'm trying to solve. I'm trying to apply the Blur Filter effect to my target object that I am also tweening.

I've imported and initialized the class;

import caurina.transitions.properties.FilterShortcuts;
FilterShortcuts.init();

but I don't really know where to go from here to get it to work. I tried a few things but nothing has worked so far.

Here's my code

import caurina.transitions.Tweener;
import caurina.transitions.properties.FilterShortcuts;
FilterShortcuts.init();

redDot.alpha = 0;

//red dot moves diagonally and down
Tweener.addTween(redDot, {x:100, y:100, alpha:1, time:2, transition:"easeInOutQuad"});
Tweener.addTween(redDot, {delay:4, x:175, y:200, time:3, transition:"easeInOutQuint"});

animation.alpha = 0;

//animation button fades up from blur
Tweener.addTween(animation, {x:118, y:200, delay:6, alpha:1, height:100, width:300, time:1, transition:"easeInOutQuint"});

Thanks again.
jpd1466 is offline   Reply With Quote
Old 11-05-2009, 11:22 AM   #5
jAQUAN
it's automatic
 
jAQUAN's Avatar
 
Join Date: Jul 2000
Location: NaN
Posts: 2,000
Just use TweenLite or TweenMax instead of all that tweener crap.
http://blog.greensock.com/
__________________
I approve this message.
AS3SOURCE: @ @ @ @
SD | fk css | Believe the HYPE | I tweet.
jAQUAN is offline   Reply With Quote
Old 11-05-2009, 11:30 AM   #6
absolutezero342
absolutezero3424
 
Join Date: Nov 2006
Posts: 484
I'm not opposed to using either of the ones you mentioned, but do they easily handle filters? If so, please give an example.
absolutezero342 is offline   Reply With Quote
Old 11-06-2009, 11:09 AM   #7
jAQUAN
it's automatic
 
jAQUAN's Avatar
 
Join Date: Jul 2000
Location: NaN
Posts: 2,000
import com.greensock.*;
import com.greensock.easing.*;

var myMovieClip:MovieClip = someClip;
var mySeconds:Number = 1;
TweenMax.to(myMovieClip, mySeconds, {x:100, y:100, alpha:1, blurFilter:{blurX:20}, ease:QuadInOut});


http://blog.greensock.com/tweenmax/
scroll down to the plugin explorer to get a better idea.
__________________
I approve this message.
AS3SOURCE: @ @ @ @
SD | fk css | Believe the HYPE | I tweet.
jAQUAN is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Actionscript 3.0

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:16 AM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.