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 >
Wrap
Text File
|
2008-09-04
|
11KB
|
415 lines
class com.novelgames.flashgames.commonAS2.NewMovieClip extends MovieClip
{
function NewMovieClip()
{
super();
}
function get parent()
{
return this._parent;
}
function set x(x)
{
this._x = x;
}
function get x()
{
return this._x;
}
function set y(y)
{
this._y = y;
}
function get y()
{
return this._y;
}
function set rotation(rotation)
{
this._rotation = rotation;
}
function get rotation()
{
return this._rotation;
}
function set visible(visible)
{
this._visible = visible;
}
function get visible()
{
return this._visible;
}
function set alpha(alpha)
{
this._alpha = alpha * 100;
}
function get alpha()
{
return this._alpha / 100;
}
function get width()
{
return this._width;
}
function set width(width)
{
this._width = width;
}
function get height()
{
return this._height;
}
function set height(height)
{
this._height = height;
}
function set scaleX(scaleX)
{
this._xscale = scaleX * 100;
}
function get scaleX()
{
return this._xscale / 100;
}
function set scaleY(scaleY)
{
this._yscale = scaleY * 100;
}
function get scaleY()
{
return this._yscale / 100;
}
function set mouseX(mouseX)
{
this._xmouse = mouseX;
}
function get mouseX()
{
return this._xmouse;
}
function set mouseY(mouseY)
{
this._ymouse = mouseY;
}
function get mouseY()
{
return this._ymouse;
}
function get totalFrames()
{
return this._totalframes;
}
function get currentFrame()
{
return this._currentframe;
}
function get name()
{
return this._name;
}
function set mask(mask)
{
this.__mask = mask;
super.setMask(mask);
}
function get mask()
{
return this.__mask;
}
function set buttonMode(buttonMode)
{
this.useHandCursor = buttonMode;
}
function get buttonMode()
{
return this.useHandCursor;
}
function set mouseEnabled(mouseEnabled)
{
this.__mouseEnabled = mouseEnabled;
}
function get mouseEnabled()
{
return this.__mouseEnabled;
}
function set mouseChildren(mouseChildren)
{
this.__mouseChildren = mouseChildren;
}
function get mouseChildren()
{
return this.__mouseChildren;
}
function get stage()
{
return com.novelgames.flashgames.commonAS2.NewStage.getNewStage();
}
function set numChildren(numChildren)
{
this.__numChildren = numChildren;
}
function get numChildren()
{
if(this.__numChildren == undefined)
{
this.__numChildren = 0;
}
return this.__numChildren;
}
function get graphics()
{
return this;
}
function startDrag(lockCenter, bounds)
{
if(lockCenter == undefined)
{
super.startDrag();
}
else if(bounds == undefined)
{
super.startDrag(lockCenter);
}
else
{
super.startDrag(lockCenter,bounds.__get__left(),bounds.__get__top(),bounds.__get__right(),bounds.__get__bottom());
}
}
function lineStyle(thickness, colour, alpha)
{
if(alpha == undefined)
{
alpha = 1;
}
super.lineStyle(thickness,colour,alpha * 100);
}
function beginFill(colour, alpha)
{
if(alpha == undefined)
{
alpha = 1;
}
super.beginFill(colour,alpha * 100);
}
function getBounds(target)
{
var _loc2_ = super.getBounds(target);
return new com.novelgames.flashgames.commonAS2.Rectangle(_loc2_.xMin,_loc2_.yMin,_loc2_.xMax - _loc2_.xMin,_loc2_.yMax - _loc2_.yMin);
}
function localToGlobal(point)
{
var _loc2_ = {x:point.x,y:point.y};
super.localToGlobal(_loc2_);
return _loc2_;
}
function globalToLocal(point)
{
var _loc2_ = {x:point.x,y:point.y};
super.globalToLocal(_loc2_);
return _loc2_;
}
function hitTestPoint(x, y, shapeFlag)
{
if(shapeFlag == undefined)
{
return super.hitTest(x,y);
}
return super.hitTest(x,y,shapeFlag);
}
function hitTestObject(obj)
{
return super.hitTest(obj);
}
function addChild(movieClip)
{
if(movieClip.addedToParent)
{
return undefined;
}
if(movieClip._parent != this)
{
trace("wrong addChild: " + [this,movieClip]);
}
if(movieClip == null)
{
return undefined;
}
this.addChildAt(movieClip,this.__get__numChildren());
}
function addChildAt(movieClip, index)
{
if(movieClip.addedToParent)
{
return undefined;
}
if(movieClip._parent != this)
{
trace("wrong addChildAt: " + [this,movieClip]);
}
if(movieClip == null)
{
return undefined;
}
movieClip.addedToParent = true;
this.__set__numChildren(this.__get__numChildren() + 1);
this.setChildIndex(movieClip,index);
}
function removeChild(movieClip)
{
if(!movieClip.addedToParent)
{
return undefined;
}
this.removeChildAt(movieClip.getDepth());
}
function removeChildAt(index)
{
var _loc5_ = this.getInstanceAtDepth(index);
var _loc3_ = undefined;
var _loc2_ = undefined;
if(!_loc5_.addedToParent)
{
return undefined;
}
_loc5_.removeMovieClip();
_loc3_ = this.getNextHighestDepth();
_loc2_ = index + 1;
while(_loc2_ < _loc3_)
{
this.getInstanceAtDepth(_loc2_).swapDepths(_loc2_ - 1);
_loc2_ = _loc2_ + 1;
}
this.__set__numChildren(this.__get__numChildren() - 1);
}
function setChildIndex(child, index)
{
var _loc3_ = child.getDepth();
var _loc2_ = undefined;
var _loc1_ = undefined;
if(_loc3_ == index)
{
return undefined;
}
_loc2_ = _loc3_ >= index ? -1 : 1;
_loc1_ = _loc3_;
while(_loc1_ != index)
{
child.swapDepths(_loc1_ + _loc2_);
_loc1_ += _loc2_;
}
}
function getChildIndex(child)
{
return child.getDepth();
}
function getChildAt(index)
{
return com.novelgames.flashgames.commonAS2.NewMovieClip(this.getInstanceAtDepth(index));
}
function addEventListener(type, listenerObject, listenerFunctionName)
{
switch(type)
{
case com.novelgames.flashgames.commonAS2.MouseEvent.CLICK:
this.onRelease = function()
{
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OVER:
this.onRollOver = function()
{
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OUT:
this.onRollOut = function()
{
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN:
this.onPress = function()
{
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_UP:
this.onRelease = function()
{
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
this.onReleaseOutside = this.onRelease;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_MOVE:
this.onMouseMove = function()
{
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.Event.ENTER_FRAME:
this.onEnterFrame = function()
{
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
}
}
function removeEventListener(type)
{
switch(type)
{
case com.novelgames.flashgames.commonAS2.MouseEvent.CLICK:
this.onRelease = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OVER:
this.onRollOver = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OUT:
this.onRollOut = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN:
this.onPress = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_UP:
this.onRelease = null;
this.onReleaseOutside = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_MOVE:
this.onMouseMove = null;
break;
case com.novelgames.flashgames.commonAS2.Event.ENTER_FRAME:
this.onEnterFrame = null;
}
}
function navigateToURL(urlRequest, window)
{
this.getURL(urlRequest.url,window);
}
function createMovie(name)
{
var _loc4_ = this.getNextHighestDepth();
var _loc2_ = undefined;
if(this.createMovieCount == undefined)
{
this.createMovieCount = 0;
}
if(name)
{
_loc2_ = this.attachMovie(name,name + "_" + this.createMovieCount,_loc4_);
}
else
{
_loc2_ = this.createEmptyMovieClip(name + "_" + this.createMovieCount,_loc4_);
_loc2_.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
}
_loc2_.addedToParent = false;
this.createMovieCount = this.createMovieCount + 1;
return _loc2_;
}
function createSound(name)
{
return new com.novelgames.flashgames.commonAS2.NewSound(this,name);
}
}