[FMX] some code using _alpha

ok so this code…


onClipEvent( enterFrame) {
	if (this._alpha > 0 ) {
		this._alpha -= 5; 
	} else if (this._alpha < 100 ) {
		this._alpha += 100;
	}
}

How would I make this code increase the alpha back to 100 instead of just “changing” it to 100 in one frame ?

I’m confused. :-\

What are you trying to do exactly? Have it fade back and forth in and out?

To do the code snippets you need to put [ CODE ] in front of the code and [ /CODE ] at the end of the code.

Remove the spaces, I didn’t want the board to convert that text…haha.

yep i want it to fade in and out. :slight_smile:

YAY!!! )@#($)(@#)$*(@#$(# I"M HAPPY!!! :nerd:

I got it all bymyself !!


onClipEvent(load) {
	alpha = 5;
}
onClipEvent(enterFrame) {
	this._alpha -= alpha;
	if (this._alpha >= 100 ) {
		alpha = -alpha;
	} else if ( this._alpha <=0 ) {
		alpha = -alpha;
	}
}

Very good :slight_smile: