FLASH論壇-Flash之神魂顛倒Adobe Flash 大家園Flash學習討論區 → 幫幫我有關組件的語法

MSDN 研討會資料下載 熱門租屋行情 網路行銷秘訣大公開 磷蝦油=比魚油更強 Microsoft Silverlight
減肥診所 雷射抽脂 ASP.NET完全攻略與快速上手 買墨水送神幣喔 近視雷射手術
電波拉皮 隆乳 胎毛筆 當鋪 投影機
借錢 調整型內衣 白蟻 氣球 眼袋
虛擬主機神魂特惠 大陸新娘 NCCU集中營 網頁設計 愛情城市
保險套 液晶電視 汽車貸款 汽車借款

  共有1733人閱讀過本文章折疊列印

主題:幫幫我有關組件的語法

帥哥喲,離線,有人找我嗎?
train78
  1樓 個人化首頁 | 個人資料 | 搜尋 | EMAIL | 首頁 | |

加到: FunP 書籤加到: 黑米書籤加到: MyShare 書籤加到: 美味書籤加到: Furl  書籤加到: YaHoo 分享書籤加到: Google 書籤加到: UDN 書籤加到: Technorati 書籤



加好友 悄悄話
等級:新手上路 文章:45 經驗:343 威望:0 精華:0 註冊:2008-5-16 23:14:22
幫幫我有關組件的語法  發表心情 Post By:2008-5-20 9:34:00




我想跑這個組件

但是他都跳出找不到目標

想請問一下各位大大

目標要在哪個地方改阿

拜託了




/*
------------------------------------------------------
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


保險套 支持(0中立(0反對(0回到頂部