dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: For loop Newbie questiono

  1. #1
    forever Newbie brunodario's Avatar
    Join Date
    May 2002
    Location
    Brasil
    Posts
    256

    For loop Newbie questiono

    Hi there, this is a simple one, im sure (and shame!)

    Got this on the main timeline

    mcMyMoviClip._alpha=0;

    What im trying to do is to create a for loop to increase the alpha of this mc till it reachs 100 (Saying it otter words, im trying to make th mc fade in via actionscript).

    Also, i need to know how to make it fade out ( decrease the ._alpha).

    Thx in advance!
    I wanna ROCK

  2. #2
    Senior Member
    Join Date
    Oct 2004
    Posts
    2,049
    if you want to fade in/out a movie clip use the tween class.

    PHP Code:
    import mx.transitions.Tween;
    import mx.transitions.easing.*;

    // to fade in taking 3 seconds
    var myTween:Tween = new Tween(mcMyMoviClip"_alpha"mx.transitions.easing.Regular.easeIn01003true);

    // to fade out taking 5 seconds
    var myTween:Tween = new Tween(mcMyMoviClip"_alpha"mx.transitions.easing.Regular.easeIn10005true); 
    You can setup these in functions to call them anytime.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center