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!

fade without tween

Status
Not open for further replies.

dzr

Programmer
Nov 20, 2001
109
US
I have a slide show in flash mx and I want the pictures to have some sort of transition ... like have it fade into the next picture -- or go from blurry to clear.

Nothing major -- something quick. Right now I have each picture in it's own frame... I had the idea of putting a grey box over the picture and converting it to a movie clip and then performing some action on it ... but I don't know the right way to script it so it goes from solid to fade ... I can put it on the on(release, keypress...) I think ...

(am i losing you?)

i'm a programmer so would rather do this with script then on the timeline with tweening.

Newbie at Flash - I'm sure you can tell!
 
this will fade one image out and the other in

function loadContent(sNewClip, sOldClip) {
// set the next clip for tracking
_root.currentClip = sNewClip;
// fade out the old clip
_root.onEnterFrame = function() {
var oca = _root[sOldClip]._alpha;
oca += (-oca * .25);
// if our alpha is close to 0...
if (oca <=1 ) {
// force it to 0 & change this handler
// to fade in the new clip
oca = 0;
_root.onEnterFrame = function() {
var nca = _root[sNewClip]._alpha;
nca += ((100-nca) * .25);
// if we're close, then set & erase
// the handler
if (nca > 99) {
nca = 100;
delete _root.onEnterFrame;
};
};
};
};
};
 
thanks! wow .. it's going to take me a bit to figure that out.

i'm kinda have a tiny bit of luck with this:

onClipEvent (enterFrame) {
if (this._alpha>=0) {
this._alpha -=25;
_root.alpha_display = this._alpha;
}
}

the first pic needs no fade. and then i click the 'next' and it fades well into the second pic. then the rest of them have no fade.

should i set the alpha back to 0 (or 100) before the if? I assume alpha at 100 is no fade ...
this._alpha=100;

 
no no no... that wont work
 
simpler over 3 frames

frame 1

image._alpha= 100;//fully visible

frame 2

image._alpha-=1;

frame 3

if (image._alpha==0)(stop();
}else{gotoandplay(2);
}

this will give a fade from fully visible to invisible

to fade in make
frame 1 alpha 0 frame2 += and frame 3==100
 
i'm not sure i'm on the same page with everyone. in fact my stupidity is getting on my own nerves.

this is the file i'm working with

you can see that the first click works but all the rest don't. i think that i have it set up wrong in the timeline.

what i did was create one grey block and made it a movie clip ... then i added the scripting to that. it appears in each frame of the movie (there are 8 - one for each picture) and the code appears in the action panel for each.

Sorry to be so ignorant. there are some basic Flash stuff i need to learn (and don't worry i won't be posting for every little thing)!
 
OH Great!

i'm always up for whatever works -i'm the queen of duct taping scripts together (i prob. shouldn't brag about that).

thanks so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top