SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Opacity Tweens with Action Script

    Hi,

    I'm currently working on a slideshow which draws its photos out of a xml file. Unfortunately, I used a tutorial and I have the tutorial part of it working properly but my meager knowledge of code makes it hard for me to make edits too.

    What I want to do is fade the image in, wait two seconds and then fade the image out before the next image is loaded.

  2. #2
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You probably just want to build a Tween to modify the 'alpha' property of your DisplayObject over some period of time. I've googled for a good explanation for you. Check this page: http://livedocs.adobe.com/flash/9.0/...=00000965.html

    I might suggest you look into a full-blown animation framework if you're going to be doing much more complex animations. I'm quite fond of http://www.goasap.org/ (AS3), from the same author as Fuse Kit - http://www.mosessupposes.com/Fuse/ (AS2). But I've heard good things about Tweener as well http://code.google.com/p/tweener/.

    Finally, if you're working in Flex, it has mx: Dissolve, which is what you're looking for.

  3. #3
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the quick reply telematter. The problem I'm having is that I need to add two tweens to each slide in my slideshow and that kind of goes over my head. I need the first tween to go from zero to 100% and the second to go from 100% to zero. I can post the code is that willl help more sense.

    Thanks!

  4. #4
    SitePoint Wizard jim_morrison3's Avatar
    Join Date
    Apr 2004
    Location
    UK
    Posts
    2,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you using AS 1/2 or AS 3?
    Good Luck!
    There are things known and Things unknown
    And in between are the Doors.
    I love hand Coding.

  5. #5
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actionscript 2.

  6. #6
    SitePoint Wizard jim_morrison3's Avatar
    Join Date
    Apr 2004
    Location
    UK
    Posts
    2,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you using loadMovie() method to load images or MovieClipLoader class ?
    Good Luck!
    There are things known and Things unknown
    And in between are the Doors.
    I love hand Coding.

  7. #7
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The MovieClipLoader class.

  8. #8
    SitePoint Wizard jim_morrison3's Avatar
    Join Date
    Apr 2004
    Location
    UK
    Posts
    2,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can write the code for fade in and fade out in the onLoadInit method of the MovieCLipLoader class. You need to call separate functions one to bring in the fadeIn and another to bring the fadeOut. You need to increase/decrease the alpha property of the movieclip, inside an onEnterFrame event.
    Good Luck!
    There are things known and Things unknown
    And in between are the Doors.
    I love hand Coding.


Tags for this Thread

Bookmarks

Posting Permissions

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