home *** CD-ROM | disk | FTP | other *** search
/ Champak 48 / cdrom_image.iso / Games / avalanche.swf / scripts / DefineSprite_112 / frame_1 / DoAction.as
Encoding:
Text File  |  2007-09-28  |  901 b   |  33 lines

  1. function camControl()
  2. {
  3.    parentColor.setTransform(camColor.getTransform());
  4.    var _loc4_ = sX / this._width;
  5.    var _loc3_ = sY / this._height;
  6.    _parent._x = cX - this._x * _loc4_;
  7.    _parent._y = cY - this._y * _loc3_;
  8.    _parent._xscale = 100 * _loc4_;
  9.    _parent._yscale = 100 * _loc3_;
  10. }
  11. function resetStage()
  12. {
  13.    var _loc2_ = {ra:100,rb:0,ga:100,gb:0,ba:100,bb:0,aa:100,ab:0};
  14.    parentColor.setTransform(_loc2_);
  15.    _parent._xscale = 100;
  16.    _parent._yscale = 100;
  17.    _parent._x = 0;
  18.    _parent._y = 0;
  19. }
  20. this._visible = true;
  21. var oldMode = Stage.scaleMode;
  22. Stage.scaleMode = "exactFit";
  23. var cX = Stage.width / 2;
  24. var cY = Stage.height / 2;
  25. var sX = Stage.width;
  26. var sY = Stage.height;
  27. Stage.scaleMode = oldMode;
  28. var camColor = new Color(this);
  29. var parentColor = new Color(_parent);
  30. this.onEnterFrame = camControl;
  31. camControl();
  32. this.onUnload = resetStage;
  33.