dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: How do I fade in a Flash Component

  1. #1
    Senior Member
    Join Date
    Nov 2004
    Location
    nj
    Posts
    176

    How do I fade in a Flash Component

    I have a flash component that is linking to an XML document which is creating a picture slideshow on my homepage. How can I make it fade in initially instead of having it just show the first picture?

  2. #2
    Junior Member
    Join Date
    Apr 2004
    Location
    New Jersey
    Posts
    28
    The two ways i would do it is by the tween class

    //-----------------//
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    new Tween(myComponent, "_alpha", Strong.easeIn, 100, 0, 3, true);

    or just put a shape the same color as the background over the component and fade the shape out.

  3. #3
    Senior Member
    Join Date
    Nov 2004
    Location
    nj
    Posts
    176
    i have tried to do the shape over the oblect and fade up but that seems to make the component not show up at all. where do i put that actionscript?

  4. #4
    Junior Member
    Join Date
    Apr 2004
    Location
    New Jersey
    Posts
    28
    put the imports at frame 1 and the "new tween" where you want the transition to occur....i.e in the actions of a button or something just like any other action applied.

    mybutton_btn.onRelease = function(){
    new Tween(myComponent, "_alpha", Strong.easeIn, 100, 0, 3, true);
    }

  5. #5
    Junior Member
    Join Date
    Apr 2004
    Location
    New Jersey
    Posts
    28
    P.S. the 100, 0, 3 referes to the starting alpha, ending alpha, and the time in seconds to do the tween thus if you want to fade in in 2 seconds, you should replace that with 0, 100, 2

  6. #6
    Senior Member
    Join Date
    Nov 2004
    Location
    nj
    Posts
    176
    cool thanks.

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