?
Solved

simple fade to white transition between images (rotating slide show)

Posted on 2007-09-29
12
Medium Priority
?
3,245 Views
Last Modified: 2012-08-14
geeeeze, you'd think I'd know this by now...

I have a simple flash header that I'm building.  The right 1/3 of the header is a place for images to cycle one after the other.  What I want is for the images to fade to white and then have the next one fade in.

However, I have a number of images and I'm wondering if there is an faster way than adding a transition effect for the in and out of every single image.  

I'd love to find a simple, fast way to do this transition without all the hassle of the built in transitions...

Any ideas?
0
Comment
Question by:marglar
  • 5
  • 5
  • 2
12 Comments
 
LVL 23

Expert Comment

by:Zeffer
ID: 19985908
0
 

Author Comment

by:marglar
ID: 19986163
Thanks, but I'm working with images in the library not external images.

Is there an easy way to do this with images from the library?  I even thought about creating a white box that fades in and then out again and placing it in the timeline over the place where one image ends and the next one begins.  It works OK but I wonder if there is a better, simpler, cleaner way...

Any help is most appreciated!



0
 
LVL 23

Expert Comment

by:Zeffer
ID: 19986347
Not a simple way no..you could do it by putting each image in a movieclip..do the fade up and fade down and then attach each one with attachMovie..but that is probably more work than you are doing at the moment.
Why not use external images?..if you don't want the "loading image" thing you could preload them just by sticking them outside the stage somewhere of the main movie on frame 1..the loading time would be identical to having them embedded and they would all appear seamlessly.

Z
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 10

Expert Comment

by:najh
ID: 19986777
creating a white box that sits over the top sounds fine - that would work a treat. then you use a bit of actionscript to change the _alpha property of that box. You could use a setInterval() function to control the fading effect. (remembering to keep hold of the setInterval() value so that you can clear it each time)

that's probably how i'd do it.
0
 

Author Comment

by:marglar
ID: 19988105
I like the idea of using action script to control the alpha of the box.  I have to admin though that I'm a complete noobie when it comes to action script.

Could you help me out with what that code would look like?  I'm not a programmer at all but this sounds like the perfect solution!
0
 
LVL 10

Accepted Solution

by:
najh earned 1500 total points
ID: 19989953
ah i put an example together to help someone with something kinda similar for this question:

http://www.experts-exchange.com/Software/Photos_Graphics/Web_Graphics/Macromedia_Flash/Q_22828539.html

I put an example file (based on the file that the question maker had been using) here:
http://www.geocities.com/neilonusenet/

and that code will be quite similar to what you need:

here's a snippet:

var myInt1:Number;
var myInt2:Number;
function makeTransparent(){
      clearInterval(myInt2);
      myInt1 = setInterval(makeALilBitTransparent,20);
}

function makeOpaque(){
      clearInterval(myInt1);
      myInt2 = setInterval(makeALilBitLessTransparent,20);
}

so here there are two functions - makeOpaque and makeTransparent.

These call another function (one each) which actually change the alpha settings:


function makeALilBitTransparent(){

      if (_root.mainMovie._alpha > 50){
            _root.mainMovie._alpha--;
      }
}

function makeALilBitLessTransparent(){
      if (_root.mainMovie._alpha < 100){
            _root.mainMovie._alpha++;
      }
}

If you look at the makeTransparent function, you can see it's clearing a past interval and then setting a new interval. When the new interval is set a value is held so that we can clear it the next time it's needed.

Have a play and if there's something you don't understand (or all of it) ask some more and I'll explain in detail the bits you don't get.
0
 

Author Comment

by:marglar
ID: 19990854
what about something using the tween class to change the alpha?  Wouldn't that be easier?
0
 
LVL 10

Expert Comment

by:najh
ID: 19990955
I don't know how you'd do that. I only suggested this method because I know it works. I've never used the tween class, but if you've got a method which works better using it then go for it.
0
 

Author Comment

by:marglar
ID: 19991778
Thats cool.

Could you show me how I could use this on the timeline to slowly fade my box to 0 alpha and then on the timeline how to slowly fade it to 100% alpha?

This looks like just what I need, I just don't need it to work on mouse-over but rather as a timeline event.

Thanks so much for all of the great help!
0
 
LVL 10

Expert Comment

by:najh
ID: 19992288
I've put a copy of a flash file here:
http://www.geocities.com/neilonusenet/

it's the second item. I've actually faded to red just to make it a bit more easy to see - it fades from red to clear after about 1 second and then fades back to red again. There are a few setIntervals being used in there, but that's ok so long as they're always cleared.

You'll be able to see that you can actually trigger any transition you like from this sort of code - setInterval is really very useful and worth understanding.
0
 

Author Comment

by:marglar
ID: 19992693
Hey!  Thats really cool.  Thank you!

Sorry to be a bit dense.  I'm still trying to understand..  I'd show one instance of text and imagery for however long I want it, then add that action script to the timeline to do a fade in of my graphic and a fade out again, revealing my next image.  Is that right?

This example is actually reverse from what I need, I think.  I need to go from normally transparent to temporarily opaque and then back to transparent again.  Then I need it to stay transparent until I'm ready to do the whole thing over again.   What changes would I need to make to have it work in that way?

Thanks so much for your help!
0
 
LVL 10

Expert Comment

by:najh
ID: 19995021
Ah I'm at home and don't have the code to hand - but basically the bit that calls the makeTransparent function can be swapped with the makeOpaque function and then it'll do it the other way around.

As for triggering it to do it over again, you need to decide what's going to trigger it, and have it all called by another function.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question