Flash as3 ---- fade text in and out using script not tweening

Posted on 2009-04-21
Last Modified: 2013-11-11

I am using Flash CS3 and I would like to fade text in then fade it out then fade in a second piece of text then fade it out

like this:

fade in> text1> 10 seconds pass> fade out text1> 2 seconds pass

fade in> text2> 10 seconds pass> fade out text2> 2 seconds pass

etc etc etc with  text 3 and 4 and so on

i can do this with tweens on the timeline but it makes a big file - is it possible to do it with action script?

please could someone give me some guidance on how?

thanks very much,

Question by:kikisu
    LVL 19

    Assisted Solution

    Text is handled very efficiently in Flash. You should *not* have a large filesize from creating two text tweens.

    Is this text created in Flash, or have you imported it from another program ? And if you have imported it, it may well be coming into Flash as an *image* - yes, you and I see it as text, but a picture is a picture, whatever is in it. And tweening pictures takes much more filesize. If that is the case, you will save much space by creating the text in Flash, turning it into a movie clip, and then tweening them on the timeline.
    LVL 4

    Assisted Solution

    Are you familiar with loading external libraries?  One of the most flexible ones in my opinion is Tweener, which is just a set of libraries that you load into your action script and then you follow the guidelines to animate with code.  

    Check out the following address for more information:

    There are many options you have for tweening when you use a library like this.

    LVL 6

    Accepted Solution

    If you use Tweener class it's really easy to do.
    Quick example :
    fade in> text1> 10 seconds pass> fade out text1> 2 seconds pass =

    import caurina.transitions.*
    text1.alpha = 0;
    text2.alpha = 0;
    Tweener.addTween(text1, {alpha:1, time:1});
    Tweener.addTween(text1, {alpha:0, time:1, delay:10});
    Tweener.addTween(text2, {alpha:1, time:1, delay:12}); ...

    just download the file from " " and copy the "caurina" folder next to your .fla ...

    Author Closing Comment

    thank you for your help!

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Adobe Flash best choice for android? 5 347
    SWF won't scale? 4 510
    EMET 5.2 / Adobe Flash 2 207
    How to block online streaming via TMG2010 ? 2 90
    Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
    I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
    In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
    The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now