[flashpro] Fade scripter for objects

Denis Huë denis at atypic.be
Fri May 20 08:24:07 EDT 2005


function fade(here, maxi) {
	here.onenterframe = function() {
		if (math.round(here._alpha)==maxi) {
			delete here.onenterframe;
			trace("stopped");
		} else {
			trace(this._alpha);
			finalfo = maxi;
			distancefo = (finalfo-here._alpha);
			here._alpha += distancefo/10;
		}
	};
}

fade(yourmovieclip,10);
stop();


my function works for fadein & fadeout

// denis Huë / www.atypic.be

-----Message d'origine-----
De : flashpro-bounces at muinar.org [mailto:flashpro-bounces at muinar.org] De la
part de Valentijn Langendorff
Envoyé : vendredi 20 mai 2005 13:59
À : Mailing list for professional Flash designers and developers
Objet : [flashpro] Fade scripter for objects

> 
> Hi All,
> 
> I'm trying to fade an object [button] from 100% to 20%
> Within a actionscript...
> What am I doing wrong here!. Ps. Placed in the first frame of a scene x
> 
> 
> function fade(){
>       this._alpha = 100;
>       
>       this.onLoad = function(){
>           if (this._alpha<100 && this._alpha>20){
>               this._alpha -= 5;
>           }
>       }
>       
>       
> }
> buttoninstanceorotherobjects.fade();
> 
> 
> Regards Valentijn
> 
> ______________________________
> 
> ICT Solutions & Design
> 
> Valentijn Langendorff
> E : valentijn at multimediaconsult.nl


------------------------------------------------------------------
send message to the list:               mailto:flashpro at muinar.org
[FlashPro] list info, subscribe, archive:   http://flash-list.com/
There's also a WebPro mailing list:     http://webdesign-list.com/
cutting-edge sounds for flash:            http://flash-sounds.com/




More information about the FlashPro mailing list