A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: fading multiple images via alpha and tween

  1. #1
    Junior Member
    Join Date
    May 2004
    Posts
    13

    fading multiple images via alpha and tween

    hi, im trying to fade two separate images on the same layer from 0 alpha to 100 alpha but flash MX 2k4 will not do it! It works fine if i do the same process with just one image, but not with any more on the same layer.

    do i have to do a separate layer for every image i want to fade? Whats the solution to this problem? I have tried grouping them and this does not work either.

    I am using the pictures as graphic symbols, and as i say if its just one image that i change the alpha on per layer it works fine (i.e 5 images on one layer, as long as i only tween the alpha on one it works fine, if i try and tween the alpha on any more, grouped or ungrouped it does not work, it just stays at 0 alpha over the tween and even into the next keyframe)

    thanks guys!
    Is it just me that can perform the exact same process to two separate flash objects and get TOTALLY different outcomes?

  2. #2
    Expand Your Element Color420's Avatar
    Join Date
    Feb 2001
    Location
    Chicago
    Posts
    265
    When I do that, I always use a different layer for each mainly because when you are fading one image into another, you need them to overlap.

    So like 5 frames to go, i let the other one start to fade in as the other fades out. Use sep. layers. Thats my advice!
    ||| Valerie |||

    EXPAND YOUR ELEMENT

  3. #3
    Junior Member
    Join Date
    May 2004
    Posts
    13
    thanks for the reply, but the idea i want is that its a list of images like a gallery - they all fade in at the same time, like 10 images on a page and you click to enlarge.

    The clicking to enlarge ill burn that bridge when i get to it, but i have 20+ images i dont want to have to have a separate layer for each! is there any way to merge layers? Id be happy to do that.
    Is it just me that can perform the exact same process to two separate flash objects and get TOTALLY different outcomes?

  4. #4
    Member
    Join Date
    May 2004
    Location
    blah
    Posts
    81
    Heh, I just looked up this code used for animated buttons. What you want to do is make a movie clip with the thumbnail in it. The first frame should have the image at 0 alpha and have the last frame at 100 alpha(or whatever kind of fading-in you want to do). Put a "stop" action in the first frame, so the fade-in doesn't play automatically. Drop the thumbnail into your scene, and add this code to the object(not inside the movie, but click on it in your main scene and add it):

    onClipEvent (enterFrame) {
    if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
    this.nextFrame();
    } else {
    this.prevFrame();
    }
    }

    What this does is leave the thumbnail in faded mode, and when the user moves the mouse over it it'll fade in. WHen the mouse rolls out, it goes back to the faded appearance. You can try some fun stuff animating with this, but make sure the hit area(which is basically the whole area of the movie clip) doesn't overlap with other ones.

    Now, as far as enlarging pictures, you may want to dedicate a whole layer to the button layout. Just slap it on top and put the button grid in there.
    blah.

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