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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image Fade for splash page 1

Status
Not open for further replies.

GUJUm0deL

Programmer
Jan 16, 2001
3,676
US
Hi, this is what i'd like to accomplish:
I'm creating a splash page. I have 3 images that i'd like to gradually fade into the next image. How can I do that??
Thanks...

Forget the Nobel Peace prize, I just want to take over the world!! [hammer]
 
billwatson, you're action tween script shows me how to fade in, but what I want is:
image1 [fade into ->] image2 [fade into ->] image3 [fade back into ->] image1, and so forth...

Forget the Nobel Peace prize, I just want to take over the world!! [hammer]
 
ok

fade out image 1
when the interval is cleared (see code) dynaically load image 2
fade in image 2

and so on

 
billwatson, hi i tried that. I got it fade-in and fade-out (with the same image) but on your code...on my code, I get an error:

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 1: Mouse events are permitted only for button instances
on (release) {

And I created a button also. I did:
1) Selected 'pushButton' from components
2) Did F8 (convert to symbol -> button)
3) Selected Frame1
4) And then I added this code...
This is the code I entered:

on (release) {
clearInterval(showclip);
fadeclip = setInterval(fade, 100);
function fade() {
clip.hen--;
message.text = "Alpha = "+clip.hen;
if (clip.hen<0) {
clip.hen = 0;
message.text = &quot;Alpha = 0&quot;;
clearInterval(fadeclip);
}
}
showclip = setInterval(fadeIn, 100)
function fadeIn(){
clip.tiger ++;
message.text = &quot;Alpha = &quot; + clip._alpha;
if (clip.tiger >100){
clip.tiger = 100;
message.text = &quot;Alpha = 100&quot;;
clearInterval(showclip);
}
}
}


Forget the Nobel Peace prize, I just want to take over the world!! [hammer]
 
you cant do that to the pushbutton component. well you cant do that to a movieclip which is what you made the button.

place an empty movie clip on stage with an instance name
i will call it clip. name your images 123 etc. this should be enough to get you going.

i = 1;
loadmovie(&quot;image&quot; +i + &quot;.jpg&quot;,clip);
fadeclip = setInterval(fade, 100);
function fade() {
clip.--;
message.text = &quot;Alpha = &quot;+clip.hen;
if (clip._alpha<=0) {
clip._alpha = 0;
message.text = &quot;Alpha = 0&quot;;
clearInterval(fadeclip);
i++;
loadmovie(&quot;image&quot; +i + &quot;.jpg&quot;,clip);
showclip = setInterval(fadeIn, 100)
}
}

function fadeIn(){
clip._alpha ++;
message.text = &quot;Alpha = &quot; + clip._alpha;
if (clip._alpha >=100){
clip._alpha = 100;
message.text = &quot;Alpha = 100&quot;;
i++;
loadmovie(&quot;image&quot; +i + &quot;.jpg&quot;,clip);
clearInterval(showclip);
}
}


 
billwatson, it works, errr kinda...image1 phases out and image2 phases in, but then image3 just appears...how can I get image2 phase into image3, then image3 phase into image1??
And lastly, right now the movie works when you click the button, can I make it into an onload movie?? I want the image phasing to start and keep going (kinda like a loop) when the .swf file is loaded...I tried on (load) but that did not work...

Forget the Nobel Peace prize, I just want to take over the world!! [hammer]
 
this is very close to what you need...up to you to make it work the way you want


var i = 100;
var j = 1;
loadmovie(&quot;image&quot; + j + &quot;.jpg&quot;,clip);
fadeclip = setInterval(fade, 100);
function fade() {
i --;
clip._alpha = i;
if (i<=0) {
clip._alpha = 0;
clearInterval(fadeclip);
j ++;
loadmovie(&quot;image&quot; + j + &quot;.jpg&quot;,clip);
showclip = setInterval(fadeIn, 100)
}
}

function fadeIn(){
i ++;
clip._alpha = i;
if (i >=100){
clip._alpha = 100;
j ++;
loadmovie(&quot;image&quot; + j + &quot;.jpg&quot;,clip);
clearInterval(showclip);
if (j<4){
fadeclip = setInterval(fade, 100);
}else{
j = 0;
fadeclip = setInterval(fade, 100);
}
}
}


 
billwatson, hi, sorry for the late reply, been busy all of a sudden...
Well, I got the thing to work the way I wanted, with some tweaking of the idea/script...
One last help, how can I make it so that movie runs as it loads in the browser?? As of now, I have it as on (release) which requires the pressing of a button...I want to be able to have the movie load on its own...
Once again, thanks...

Forget the Nobel Peace prize, I just want to take over the world!! [hammer]
 
I want to be able to have the movie load on its own...

Sorry I meant to say have the movie load and run without pressing/clicking anything...

Forget the Nobel Peace prize, I just want to take over the world!! [hammer]
 
just take the code out of the button and place it in the timeline as a frame action. then delete the button.
 
Works great!!
Thanks man...[smile]

Forget the Nobel Peace prize, I just want to take over the world!! [hammer]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top