home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Puzzle / Easter_Eggs.swf / scripts / __Packages / com / novelgames / flashgames / commonAS2 / NewMovieClip.as < prev    next >
Text File  |  2008-09-04  |  11KB  |  415 lines

  1. class com.novelgames.flashgames.commonAS2.NewMovieClip extends MovieClip
  2. {
  3.    function NewMovieClip()
  4.    {
  5.       super();
  6.    }
  7.    function get parent()
  8.    {
  9.       return this._parent;
  10.    }
  11.    function set x(x)
  12.    {
  13.       this._x = x;
  14.    }
  15.    function get x()
  16.    {
  17.       return this._x;
  18.    }
  19.    function set y(y)
  20.    {
  21.       this._y = y;
  22.    }
  23.    function get y()
  24.    {
  25.       return this._y;
  26.    }
  27.    function set rotation(rotation)
  28.    {
  29.       this._rotation = rotation;
  30.    }
  31.    function get rotation()
  32.    {
  33.       return this._rotation;
  34.    }
  35.    function set visible(visible)
  36.    {
  37.       this._visible = visible;
  38.    }
  39.    function get visible()
  40.    {
  41.       return this._visible;
  42.    }
  43.    function set alpha(alpha)
  44.    {
  45.       this._alpha = alpha * 100;
  46.    }
  47.    function get alpha()
  48.    {
  49.       return this._alpha / 100;
  50.    }
  51.    function get width()
  52.    {
  53.       return this._width;
  54.    }
  55.    function set width(width)
  56.    {
  57.       this._width = width;
  58.    }
  59.    function get height()
  60.    {
  61.       return this._height;
  62.    }
  63.    function set height(height)
  64.    {
  65.       this._height = height;
  66.    }
  67.    function set scaleX(scaleX)
  68.    {
  69.       this._xscale = scaleX * 100;
  70.    }
  71.    function get scaleX()
  72.    {
  73.       return this._xscale / 100;
  74.    }
  75.    function set scaleY(scaleY)
  76.    {
  77.       this._yscale = scaleY * 100;
  78.    }
  79.    function get scaleY()
  80.    {
  81.       return this._yscale / 100;
  82.    }
  83.    function set mouseX(mouseX)
  84.    {
  85.       this._xmouse = mouseX;
  86.    }
  87.    function get mouseX()
  88.    {
  89.       return this._xmouse;
  90.    }
  91.    function set mouseY(mouseY)
  92.    {
  93.       this._ymouse = mouseY;
  94.    }
  95.    function get mouseY()
  96.    {
  97.       return this._ymouse;
  98.    }
  99.    function get totalFrames()
  100.    {
  101.       return this._totalframes;
  102.    }
  103.    function get currentFrame()
  104.    {
  105.       return this._currentframe;
  106.    }
  107.    function get name()
  108.    {
  109.       return this._name;
  110.    }
  111.    function set mask(mask)
  112.    {
  113.       this.__mask = mask;
  114.       super.setMask(mask);
  115.    }
  116.    function get mask()
  117.    {
  118.       return this.__mask;
  119.    }
  120.    function set buttonMode(buttonMode)
  121.    {
  122.       this.useHandCursor = buttonMode;
  123.    }
  124.    function get buttonMode()
  125.    {
  126.       return this.useHandCursor;
  127.    }
  128.    function set mouseEnabled(mouseEnabled)
  129.    {
  130.       this.__mouseEnabled = mouseEnabled;
  131.    }
  132.    function get mouseEnabled()
  133.    {
  134.       return this.__mouseEnabled;
  135.    }
  136.    function set mouseChildren(mouseChildren)
  137.    {
  138.       this.__mouseChildren = mouseChildren;
  139.    }
  140.    function get mouseChildren()
  141.    {
  142.       return this.__mouseChildren;
  143.    }
  144.    function get stage()
  145.    {
  146.       return com.novelgames.flashgames.commonAS2.NewStage.getNewStage();
  147.    }
  148.    function set numChildren(numChildren)
  149.    {
  150.       this.__numChildren = numChildren;
  151.    }
  152.    function get numChildren()
  153.    {
  154.       if(this.__numChildren == undefined)
  155.       {
  156.          this.__numChildren = 0;
  157.       }
  158.       return this.__numChildren;
  159.    }
  160.    function get graphics()
  161.    {
  162.       return this;
  163.    }
  164.    function startDrag(lockCenter, bounds)
  165.    {
  166.       if(lockCenter == undefined)
  167.       {
  168.          super.startDrag();
  169.       }
  170.       else if(bounds == undefined)
  171.       {
  172.          super.startDrag(lockCenter);
  173.       }
  174.       else
  175.       {
  176.          super.startDrag(lockCenter,bounds.__get__left(),bounds.__get__top(),bounds.__get__right(),bounds.__get__bottom());
  177.       }
  178.    }
  179.    function lineStyle(thickness, colour, alpha)
  180.    {
  181.       if(alpha == undefined)
  182.       {
  183.          alpha = 1;
  184.       }
  185.       super.lineStyle(thickness,colour,alpha * 100);
  186.    }
  187.    function beginFill(colour, alpha)
  188.    {
  189.       if(alpha == undefined)
  190.       {
  191.          alpha = 1;
  192.       }
  193.       super.beginFill(colour,alpha * 100);
  194.    }
  195.    function getBounds(target)
  196.    {
  197.       var _loc2_ = super.getBounds(target);
  198.       return new com.novelgames.flashgames.commonAS2.Rectangle(_loc2_.xMin,_loc2_.yMin,_loc2_.xMax - _loc2_.xMin,_loc2_.yMax - _loc2_.yMin);
  199.    }
  200.    function localToGlobal(point)
  201.    {
  202.       var _loc2_ = {x:point.x,y:point.y};
  203.       super.localToGlobal(_loc2_);
  204.       return _loc2_;
  205.    }
  206.    function globalToLocal(point)
  207.    {
  208.       var _loc2_ = {x:point.x,y:point.y};
  209.       super.globalToLocal(_loc2_);
  210.       return _loc2_;
  211.    }
  212.    function hitTestPoint(x, y, shapeFlag)
  213.    {
  214.       if(shapeFlag == undefined)
  215.       {
  216.          return super.hitTest(x,y);
  217.       }
  218.       return super.hitTest(x,y,shapeFlag);
  219.    }
  220.    function hitTestObject(obj)
  221.    {
  222.       return super.hitTest(obj);
  223.    }
  224.    function addChild(movieClip)
  225.    {
  226.       if(movieClip.addedToParent)
  227.       {
  228.          return undefined;
  229.       }
  230.       if(movieClip._parent != this)
  231.       {
  232.          trace("wrong addChild: " + [this,movieClip]);
  233.       }
  234.       if(movieClip == null)
  235.       {
  236.          return undefined;
  237.       }
  238.       this.addChildAt(movieClip,this.__get__numChildren());
  239.    }
  240.    function addChildAt(movieClip, index)
  241.    {
  242.       if(movieClip.addedToParent)
  243.       {
  244.          return undefined;
  245.       }
  246.       if(movieClip._parent != this)
  247.       {
  248.          trace("wrong addChildAt: " + [this,movieClip]);
  249.       }
  250.       if(movieClip == null)
  251.       {
  252.          return undefined;
  253.       }
  254.       movieClip.addedToParent = true;
  255.       this.__set__numChildren(this.__get__numChildren() + 1);
  256.       this.setChildIndex(movieClip,index);
  257.    }
  258.    function removeChild(movieClip)
  259.    {
  260.       if(!movieClip.addedToParent)
  261.       {
  262.          return undefined;
  263.       }
  264.       this.removeChildAt(movieClip.getDepth());
  265.    }
  266.    function removeChildAt(index)
  267.    {
  268.       var _loc5_ = this.getInstanceAtDepth(index);
  269.       var _loc3_ = undefined;
  270.       var _loc2_ = undefined;
  271.       if(!_loc5_.addedToParent)
  272.       {
  273.          return undefined;
  274.       }
  275.       _loc5_.removeMovieClip();
  276.       _loc3_ = this.getNextHighestDepth();
  277.       _loc2_ = index + 1;
  278.       while(_loc2_ < _loc3_)
  279.       {
  280.          this.getInstanceAtDepth(_loc2_).swapDepths(_loc2_ - 1);
  281.          _loc2_ = _loc2_ + 1;
  282.       }
  283.       this.__set__numChildren(this.__get__numChildren() - 1);
  284.    }
  285.    function setChildIndex(child, index)
  286.    {
  287.       var _loc3_ = child.getDepth();
  288.       var _loc2_ = undefined;
  289.       var _loc1_ = undefined;
  290.       if(_loc3_ == index)
  291.       {
  292.          return undefined;
  293.       }
  294.       _loc2_ = _loc3_ >= index ? -1 : 1;
  295.       _loc1_ = _loc3_;
  296.       while(_loc1_ != index)
  297.       {
  298.          child.swapDepths(_loc1_ + _loc2_);
  299.          _loc1_ += _loc2_;
  300.       }
  301.    }
  302.    function getChildIndex(child)
  303.    {
  304.       return child.getDepth();
  305.    }
  306.    function getChildAt(index)
  307.    {
  308.       return com.novelgames.flashgames.commonAS2.NewMovieClip(this.getInstanceAtDepth(index));
  309.    }
  310.    function addEventListener(type, listenerObject, listenerFunctionName)
  311.    {
  312.       switch(type)
  313.       {
  314.          case com.novelgames.flashgames.commonAS2.MouseEvent.CLICK:
  315.             this.onRelease = function()
  316.             {
  317.                listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
  318.             };
  319.             break;
  320.          case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OVER:
  321.             this.onRollOver = function()
  322.             {
  323.                listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
  324.             };
  325.             break;
  326.          case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OUT:
  327.             this.onRollOut = function()
  328.             {
  329.                listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
  330.             };
  331.             break;
  332.          case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN:
  333.             this.onPress = function()
  334.             {
  335.                listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
  336.             };
  337.             break;
  338.          case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_UP:
  339.             this.onRelease = function()
  340.             {
  341.                listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
  342.             };
  343.             this.onReleaseOutside = this.onRelease;
  344.             break;
  345.          case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_MOVE:
  346.             this.onMouseMove = function()
  347.             {
  348.                listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
  349.             };
  350.             break;
  351.          case com.novelgames.flashgames.commonAS2.Event.ENTER_FRAME:
  352.             this.onEnterFrame = function()
  353.             {
  354.                listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
  355.             };
  356.       }
  357.    }
  358.    function removeEventListener(type)
  359.    {
  360.       switch(type)
  361.       {
  362.          case com.novelgames.flashgames.commonAS2.MouseEvent.CLICK:
  363.             this.onRelease = null;
  364.             break;
  365.          case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OVER:
  366.             this.onRollOver = null;
  367.             break;
  368.          case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OUT:
  369.             this.onRollOut = null;
  370.             break;
  371.          case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN:
  372.             this.onPress = null;
  373.             break;
  374.          case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_UP:
  375.             this.onRelease = null;
  376.             this.onReleaseOutside = null;
  377.             break;
  378.          case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_MOVE:
  379.             this.onMouseMove = null;
  380.             break;
  381.          case com.novelgames.flashgames.commonAS2.Event.ENTER_FRAME:
  382.             this.onEnterFrame = null;
  383.       }
  384.    }
  385.    function navigateToURL(urlRequest, window)
  386.    {
  387.       this.getURL(urlRequest.url,window);
  388.    }
  389.    function createMovie(name)
  390.    {
  391.       var _loc4_ = this.getNextHighestDepth();
  392.       var _loc2_ = undefined;
  393.       if(this.createMovieCount == undefined)
  394.       {
  395.          this.createMovieCount = 0;
  396.       }
  397.       if(name)
  398.       {
  399.          _loc2_ = this.attachMovie(name,name + "_" + this.createMovieCount,_loc4_);
  400.       }
  401.       else
  402.       {
  403.          _loc2_ = this.createEmptyMovieClip(name + "_" + this.createMovieCount,_loc4_);
  404.          _loc2_.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
  405.       }
  406.       _loc2_.addedToParent = false;
  407.       this.createMovieCount = this.createMovieCount + 1;
  408.       return _loc2_;
  409.    }
  410.    function createSound(name)
  411.    {
  412.       return new com.novelgames.flashgames.commonAS2.NewSound(this,name);
  413.    }
  414. }
  415.