home *** CD-ROM | disk | FTP | other *** search
- class Fade
- {
- var bmpRoot;
- var removeMovieClip;
- var getDepth;
- var swapDepths;
- var nTime;
- var nTemp;
- var nT;
- var nRdm;
- var m_0;
- var m_1;
- var finish;
- var switchDepth;
- var nRdm_2;
- var m_2;
- var m_3;
- static var nColor = 0;
- static var nInterval = 20;
- function Fade()
- {
- }
- static function start(_ob)
- {
- var _loc11_ = false;
- var _loc9_ = Stage.width;
- var _loc10_ = Stage.height;
- var _loc13_ = 0;
- var _loc12_ = 0;
- for(var _loc6_ in _ob)
- {
- Fade[_loc6_] = _ob[_loc6_];
- }
- var _loc7_ = new flash.display.BitmapData(_loc9_,_loc10_,false,Fade.nColor);
- _loc7_.draw(_root);
- var _loc3_ = _root.createEmptyMovieClip("mClip_root" + _root.getNextHighestDepth(),_root.getNextHighestDepth());
- var _loc4_ = _loc3_.createEmptyMovieClip("mClip_mask",0);
- var _loc8_ = _loc3_.createEmptyMovieClip("mClip_bmp",1);
- _loc8_.attachBitmap(_loc7_,0);
- _loc3_.nT = Fade.nInterval;
- _loc11_ && Fade.disableBtn(_loc3_);
- _loc3_.bmpRoot = _loc7_;
- _loc3_.nTime = 0;
- _loc3_.finish = function()
- {
- this.bmpRoot.dispose();
- this.removeMovieClip();
- };
- _loc3_.switchDepth = function()
- {
- if(this.getDepth() != _root.getNextHighestDepth() - 1)
- {
- this.swapDepths(_root.getNextHighestDepth() - 1);
- }
- };
- switch(random(4))
- {
- case 0:
- _loc3_.nRdm = random(2);
- _loc3_.m_0 = Fade.createClip("m_",_loc4_,0,0);
- _loc3_.m_1 = Fade.createClip("m_",_loc4_,0,1,{_x:10,_y:10,_rotation:180});
- _loc3_.onEnterFrame = function()
- {
- this.nTime = this.nTime + 1;
- this.nTemp = 50 - Fade.trigonometric(this.nTime,this.nT,50);
- if(this.nRdm > 0)
- {
- this.m_0._yscale = this.m_1._yscale = this.nTemp;
- }
- else
- {
- this.m_0._xscale = this.m_1._xscale = this.nTemp;
- }
- if(this.nTime == this.nT / 2)
- {
- this.finish();
- }
- this.switchDepth();
- };
- break;
- case 1:
- _loc3_.nRdm = random(3);
- _loc3_.nRdm_2 = random(4);
- _loc3_.m_0 = Fade.createClip("m_",_loc4_,1,0,{_x:5,_y:5});
- _loc3_.onEnterFrame = function()
- {
- this.nTime = this.nTime + 1;
- this.nTemp = 100 - Fade.trigonometric(this.nTime,this.nT,100);
- switch(this.nRdm)
- {
- case 0:
- this.m_0._xscale = _loc0_ = 150;
- _loc0_;
- this.m_0._yscale = _loc0_ = this.nTemp;
- _loc0_;
- break;
- case 1:
- this.m_0._xscale = _loc0_ = this.nTemp;
- _loc0_;
- this.m_0._yscale = _loc0_ = 150;
- _loc0_;
- break;
- case 2:
- this.m_0._yscale = _loc0_ = this.nTemp;
- this.m_0._xscale = _loc0_;
- }
- if(this.nRdm_2 == 3)
- {
- this.m_0._rotation = 180 - Fade.trigonometric(this.nTime,this.nT,180);
- }
- else if(this.nRdm_2 == 2)
- {
- this.m_0._rotation = Fade.trigonometric(this.nTime,this.nT,180);
- }
- if(this.nTime == this.nT / 2)
- {
- this.finish();
- }
- this.switchDepth();
- };
- break;
- case 2:
- _loc3_.nRdm = random(5);
- _loc3_.m_0 = Fade.createClip("m_",_loc4_,2,0);
- _loc3_.m_1 = Fade.createClip("m_",_loc4_,2,1,{_x:10,_y:10,_rotation:180});
- _loc3_.onEnterFrame = function()
- {
- this.nTime = this.nTime + 1;
- this.nTemp = 100 - Fade.trigonometric(this.nTime,this.nT,100);
- switch(this.nRdm)
- {
- case 0:
- this.m_1._yscale = _loc0_ = this.nTemp;
- this.m_0._yscale = _loc0_;
- break;
- case 1:
- this.m_1._yscale = _loc0_ = this.nTemp;
- this.m_0._xscale = _loc0_;
- break;
- case 2:
- this.m_1._xscale = _loc0_ = this.nTemp;
- this.m_0._yscale = _loc0_;
- break;
- case 3:
- this.m_1._xscale = _loc0_ = this.nTemp;
- this.m_0._xscale = _loc0_;
- break;
- case 4:
- this.m_1._xscale = _loc0_ = this.nTemp;
- this.m_0._xscale = _loc0_;
- this.m_1._yscale = _loc0_ = this.nTemp;
- this.m_0._yscale = _loc0_;
- }
- if(this.nTime == this.nT / 2)
- {
- this.finish();
- }
- this.switchDepth();
- };
- break;
- case 3:
- _loc3_.nRdm = random(2);
- _loc3_.m_0 = Fade.createClip("m_",_loc4_,2,0);
- _loc3_.m_1 = Fade.createClip("m_",_loc4_,2,1,{_x:10,_y:10,_rotation:180});
- _loc3_.m_2 = Fade.createClip("m_",_loc4_,2,2,{_x:0,_y:10,_rotation:-90});
- _loc3_.m_3 = Fade.createClip("m_",_loc4_,2,3,{_x:10,_y:0,_rotation:90});
- _loc3_.onEnterFrame = function()
- {
- this.nTime = this.nTime + 1;
- this.nTemp = 100 - Fade.trigonometric(this.nTime,this.nT,100);
- if(this.nRdm > 0)
- {
- this.m_0._yscale = this.m_1._yscale = this.m_2._yscale = this.m_3._yscale = this.nTemp;
- }
- else
- {
- this.m_0._xscale = this.m_1._xscale = this.m_2._xscale = this.m_3._xscale = this.nTemp;
- }
- if(this.nTime == this.nT / 2)
- {
- this.finish();
- }
- this.switchDepth();
- };
- }
- _loc4_._width = _loc0_ = _loc9_;
- _loc0_;
- _loc4_._height = _loc0_ = _loc10_;
- _loc0_;
- _loc4_._x = _loc0_ = _loc13_;
- _loc0_;
- _loc4_._y = _loc0_ = _loc12_;
- _loc0_;
- _loc8_.setMask(_loc4_);
- }
- static function disableBtn(_m)
- {
- _m.onPress = null;
- _m.enabled = false;
- _m.hitArea = _root;
- }
- static function trigonometric(x, T, A, P)
- {
- var _loc2_ = 0;
- var _loc1_ = 3.141592653589793 / T * x;
- if(!isNaN(P))
- {
- _loc2_ = P - _loc1_;
- }
- return A * Math.sin(_loc1_ + _loc2_);
- }
- static function createClip(_s, _m, _nType, _nDepth, _ob)
- {
- isNaN(_nDepth) && (_nDepth = _m.getNextHighestDepth());
- isNaN(_nType) && (_nType = 0);
- _m.createEmptyMovieClip(_s + _nDepth,_nDepth);
- _m[_s + _nDepth].beginFill(0);
- switch(_nType)
- {
- case 0:
- _m[_s + _nDepth].lineTo(10,0);
- _m[_s + _nDepth].lineTo(10,10);
- _m[_s + _nDepth].lineTo(0,10);
- _m[_s + _nDepth].lineTo(0,0);
- break;
- case 1:
- _m[_s + _nDepth].moveTo(-5,-5);
- _m[_s + _nDepth].lineTo(-5,5);
- _m[_s + _nDepth].lineTo(5,5);
- _m[_s + _nDepth].lineTo(5,-5);
- _m[_s + _nDepth].lineTo(-5,-5);
- break;
- case 2:
- _m[_s + _nDepth].lineTo(10,0);
- _m[_s + _nDepth].lineTo(0,10);
- _m[_s + _nDepth].lineTo(0,0);
- }
- _m[_s + _nDepth].endFill();
- for(var _loc5_ in _ob)
- {
- _m[_s + _nDepth][_loc5_] = _ob[_loc5_];
- }
- return _m[_s + _nDepth];
- }
- }
-