我想跑這個組件
但是他都跳出找不到目標
想請問一下各位大大
目標要在哪個地方改阿
拜託了
/*
------------------------------------------------------
Zoomer Component, v2.2.2
------------------------------------------------------
updated august 30 2002
Martijn de Visser - <martijn@rubberduck.nl>
www.flashcomponents.net
------------------------------------------------------
Public methods:
enable() enables the component
disable() disables the component
isEnabled() returns state of component
*/
#initclip
// construct
ZoomerClass = function(){
// enable by default
this.enabled = true;
// initialize
this.init();
}
// register class
Object.registerClass("ZoomerClassSymbol", ZoomerClass);
// initialize component
ZoomerClass.prototype.init = function()
{
if (this._targetInstanceName.length > 0)
{
this.zoomTarget = this.targetInstance = this._parent[this._targetInstanceName];
if (this.zoomTarget instanceof MovieClip)
{
if ((!this.scaleX)&&(!this.scaleY)) { this.enabled = false; }
this._visible = false;
this.resizing = false;
this.mouseSwitched = false;
this.minZoomX = this.zoomTarget._xscale;
this.minZoomY = this.zoomTarget._yscale;
this.oldDepth = this.zoomTarget.getDepth();
if (this.maxZoom < 100) {this.maxZoom = 100;}
if (this.zoomSpeed < 0.01) {this.zoomSpeed = 0.01;}
if (this.startZoomedIn)
{
this.forward = false;
this.zoomTarget._xscale = this.maxZoom;
this.zoomTarget._yscale = this.maxZoom;
}
else
{
this.forward = true;
}
}
else
{
trace("Zoomer Component: no target movieclip found...");
this.enabled = false;
}
}
}
ZoomerClass.prototype.onMouseMove = function()
{
if (this.enabled)
{
if(this.zoomTarget.hittest(_root._xmouse,_root._ymouse, this.respectShape))
{
// mouse comes within target clip area
if (this.mouseSwitched)
{
this.mouseSwitched = false;
this.mouseEnter();
}
}
else
{
// mouse goes out of target clip area
if (!this.mouseSwitched)
{
this.mouseSwitched = true;
this.mouseLeave();
}
}
}
}
ZoomerClass.prototype.mouseEnter = function()
{
if (!this.resizing)
{
this.resizing = true;
this.forward = true;
}
else
{
if (!this.forward)
{
this.forward = true;
}
else
{
this.forward = false;
}
}
}
ZoomerClass.prototype.mouseLeave = function()
{
if (!this.resizing)
{
this.resizing = true;
this.forward = false;
}
else
{
if (!this.forward)
{
this.forward = true;
}
else
{
this.forward = false;
}
}
}
ZoomerClass.prototype.onEnterFrame = function()
{
if (this.enabled)
{
if(this.zoomTarget.hittest(_root._xmouse,_root._ymouse, this.respectShape))
{
// mouse comes within target clip area
if (this.mouseSwitched)
{
this.mouseSwitched = false;
this.mouseEnter();
}
}
else
{
// mouse goes out of target clip area
if (!this.mouseSwitched)
{
this.mouseSwitched = true;
this.mouseLeave();
}
}
if (this.resizing)
{
if (this.forward)
{
// zoom in
this.zoomTarget.swapDepths(1000);
if (this.scaleX) { this.zoomTarget._xscale = this.zoomTarget._xscale + (this.zoomSpeed*(this.maxZoom-this.zoomTarget._xscale)); }
if (this.scaleY) { this.zoomTarget._yscale = this.zoomTarget._yscale + (this.zoomSpeed*(this.maxZoom-this.zoomTarget._yscale)); }
if ((this.zoomTarget._xscale >= this.maxZoom-1) || (this.zoomTarget._yscale >= this.maxZoom-1))
{
// end of zoom in routine
if (this.scaleX) { this.zoomTarget._xscale = this.maxZoom; }
if (this.scaleY) { this.zoomTarget._yscale = this.maxZoom; }
this.resizing = false;
this.forward = false;
}
}
else
{
// zoom out
if (this.scaleX) { this.zoomTarget._xscale = this.zoomTarget._xscale - (this.zoomSpeed*(this.zoomTarget._xscale-this.minZoomX)); }
if (this.scaleY) { this.zoomTarget._yscale = this.zoomTarget._yscale - (this.zoomSpeed*(this.zoomTarget._yscale-this.minZoomY)); }
if (((this.scaleX) && (this.zoomTarget._xscale < this.minZoomX+1)) || ((this.scaleY) && (this.zoomTarget._yscale < this.minZoomY+1)))
{
// end of zoom out routine
if (this.scaleX) { this.zoomTarget._xscale = this.minZoomX; }
if (this.scaleY) { this.zoomTarget._yscale = this.minZoomY; }
this.resizing = false;
this.forward = true;
this.zoomTarget.swapDepths(this.oldDepth);
}
}
}
}
}
// disable Zoom behaviour
ZoomerClass.prototype.disable = function()
{
this.enabled = false;
}
// enable Zoom behaviour
ZoomerClass.prototype.enable = function()
{
this.enabled = true;
}
// return enabled state
ZoomerClass.prototype.isEnabled = function()
{
return this.enabled;
}
#endinitclip