home *** CD-ROM | disk | FTP | other *** search
- class LRG.LRGFadeAction extends LRG.LRGAction
- {
- var m_sActionType;
- var m_bFadeIn;
- var m_sName;
- var m_fTimePassedSinceStart;
- var m_fTotalActionTime;
- function LRGFadeAction(kAnimationParams)
- {
- super();
- this.init(kAnimationParams);
- }
- function init(kActionParams)
- {
- if(kActionParams.m_sType == undefined && (this.m_sActionType == undefined || this.m_sActionType == "DEFAULT"))
- {
- kActionParams.m_sType = "FADE";
- }
- super.init(kActionParams);
- if(kActionParams.m_bFadeIn == undefined && this.m_bFadeIn == undefined)
- {
- this.m_bFadeIn = false;
- trace("Fade action " + this.m_sName + " initialized without specified direction.");
- }
- else
- {
- this.m_bFadeIn = kActionParams.m_bFadeIn;
- }
- this.m_fTimePassedSinceStart = 0;
- }
- function reset(fCurrTime, kActionParams)
- {
- super.reset(fCurrTime,kActionParams);
- this.m_fTimePassedSinceStart = 0;
- }
- function doUpdate(fCurrTime, fDeltaTimeSecs, kClip)
- {
- this.m_fTimePassedSinceStart += fDeltaTimeSecs;
- var _loc2_ = this.m_fTimePassedSinceStart / this.m_fTotalActionTime;
- if(_loc2_ > 1)
- {
- _loc2_ = 1;
- }
- if(this.m_bFadeIn)
- {
- kClip._alpha = _loc2_ * 100;
- }
- else
- {
- kClip._alpha = 100 - _loc2_ * 100;
- }
- if(_loc2_ == 1)
- {
- return true;
- }
- return false;
- }
- }
-