home *** CD-ROM | disk | FTP | other *** search
- var oldRot = _rotation;
- var targetScale = 100;
- var reScale = false;
- var rotOffset = 0;
- var currFrame = 1;
- onEnterFrame = function()
- {
- rotOffset += 0.2;
- _rotation = - _root.worldContainer._rotation + rotOffset;
- if((oldRot - _rotation) * (oldRot - _rotation) > 0.2 && !reScale)
- {
- targetScale = 100 + Math.floor(random(200));
- if(currFrame < 3)
- {
- currFrame++;
- }
- else
- {
- currFrame = 1;
- }
- bg.gotoAndStop(currFrame);
- reScale = true;
- }
- if((oldRot - _rotation) * (oldRot - _rotation) <= 0.2 && reScale)
- {
- reScale = false;
- }
- if((targetScale - _xscale) * (targetScale - _xscale) > 1)
- {
- _xscale = _xscale + (targetScale - _xscale) / 8;
- }
- else
- {
- _xscale = targetScale;
- }
- _yscale = _xscale;
- oldRot = _rotation;
- };
-