Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Actionscript / March 2007



Tip: Looking for answers? Try searching our database.

Fading a mc in reverse

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gryllsie - 30 Mar 2007 15:48 GMT
I have the attached bit of code which fades an mc out smoothly using
actionscript. Works a treat, but how do I get the mc to fade in - i.e. the
reverse of this code?
gryllsie

mcname.onEnterFrame = function() {
    mcname._alpha -= 5;
    if (mcname._alpha <= 0) {
        mcname._visible = false;
        delete.mcname.onEnterFrame;
    }
};
kglad - 30 Mar 2007 16:08 GMT
mcname.onEnterFrame = function() {
    mcname._alpha += 5;
   mcname._visible = true;  // or set this elsewhere.
    if (mcname._alpha >= 100) {
        delete this.onEnterFrame;  // correct your other delete statement.
    }
};
gryllsie - 30 Mar 2007 16:32 GMT
thanks, that's awesome!
kglad - 31 Mar 2007 01:21 GMT
you're welcome.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.