Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fading a picture in and out

Status
Not open for further replies.

Kijori

Technical User
Jan 22, 2002
67
0
0
SG
as the subject mentioned, how to fade out the old picture and fade in a new one? i don't seem to be able to find help on this anywhere...
 
look at setinterval in as dictionary

if that dont help say so and ill make you a very quick example
 
setInterval() calls a function at a specific time interval right? i'll be using that to change the images displayed. but what i want to know is how to fade out and fade in the image.

this effect would be nice over the abrupt change in images.
 
Hmm. It sounds like you guys are wanting ActionScript to do this, and I'm sure it can. But an easy, albeit simple (and labor-intensive) way to do it is to create two motion tweens on two layers and the apply alhpa fade ins and fade outs. If you're doing a lot of this stuff and you don't need to code for user interaction, I would recommend Adobe AfterEffects. It is easier to do simple tweens and fades with AfterEffects than it is with Flash and you can Export SWFs from AfterEffects. That said, in Flash:

1. Create a keyframe in frame 1 of Layer 1 on the timeline (click frame 1, press F6).
2. Drag an image to that keyframe. Convert the image to a graphic symbol (press the F8 key and follow the instructions).
3. Click frame 12 of Layer 1 and insert another keyframe.
3. Create another layer in your timeline above Layer 1. We'll call it Layer 2.
4. Create a keyframe in frame 6 of Layer 2 (click frame 6 of layer 2 and press F6).
5. Drag an image to that keyframe in Layer 2 and convert the image to a graphic symbol (click the image and press F8).
6. Click frame 18 of Layer 2 and insert another keyframe.
7. Alright, you've now effectively blotted out your first image. So, in your timeline, click the column below the eye icon in Layer 2. That will hide the second image so you can work on the first.
8. Click the first keyframe in Layer 1 and then click the image on the stage. If you converted the image to a symbol as instructed earlier, the Color parameter will become active in the Properties dialog box. Click the Color drop-down list and then click Alpha. Notice the percentage becomes active on the right. Set the percentage to 100.
9. Still in Layer 1, click keyframe 12, and then click the image that is on the stage. Click the Color drop-down list, set alpha to 0. Done with that one.
10. In your timeline, click the Eye icon again in Layer 2 so you can see Layer 2. In Layer 1, click the Lock icon so you lock layer one and don't mess up what you've done.
11. In Layer 2, click keyframe 6, and then click the picture (symbol) that is in keyframe 6. Click the Color drop-down list, select Alpha, and set the alpha to 0.
12. Still in Layer 2, click keyframe 18, click the symbol on the stage, and set the Alpha to 100.
13. In Layer 2, right-click between the two keyframes and select Create Motion Tween from the context menu.
14. In Layer 1, right-click between the two keyframes and select Create Motion Tween from the context menu.
13. Test your movie. That should fade out the first image in a second and fade in the next image in the next second.

Like I said, kind of labor intensive, and certainly not as efficient as ActionScript if you're doing it a hundred times. But easy enough for a simple fade or two.

Regards,
Kesey Seven
 
hey glosso,

you are right. a tween or two would work fine for a few pictures. but i'm working on a photo album and i think using ActionScript would be more ideal. thanks for the post. will look into AfterEffects.
 
thanks guys for the help here. cheers!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top