【发布时间】:2009-09-30 21:44:24
【问题描述】:
我有一个带有按钮的movieClip,该按钮是在我的显示类Thumbnail.as中创建的,并且我有一个按钮功能可以在我的ui类ThumbnailController.as中与之交互ThumbnailController.as。
我目前遇到的问题是;在我的 ui 类中,我无法定位在我的显示类中创建的 movieClip playGlow。
在我的显示类中创建 playGlow 按钮的代码(Thumbnail.as)
public function playBtns():void {
playThumb = new PlayThumb;
playThumb.x = 642;
playThumb.y = 22;
playThumb.alpha = 1;
playGlow = new PlayGlow;
playGlow.x = 628;
playGlow.y = 8;
playGlow.alpha = 1;
}
public function buildRow ():void{
thumbNailRow.addChild(thumbLoader);
thumbNailRow.addChild(thumbTitle);
thumbNailRow.addChild(thumbText);
thumbNailRow.addChild(playGlow);
thumbNailRow.addChild(playThumb);
playThumb.addEventListener(MouseEvent.ROLL_OVER, rowRollOver);
addChild(thumbNailRow);
}
现在是我的 ui 类中的代码 (ThumbnailController.as)
public function rowRollOver(e:MouseEvent):void
{
dispatchEvent(new Event(Event.CHANGE, true ));
TweenPlugin.activate([TintPlugin]);
TweenLite.to(playGlow, .4, {alpha:.5, tint:0x99cc00});
}
这是问题所在:TweenLite.to(playGlow, .4, {alpha:.5, tint:0x99cc00});
只有在这样的情况下才会起作用:TweenLite.to(this, .4, {alpha:.5, tint:0x99cc00});
但是如果我使用 this,整个 thumbNailRow 电影剪辑都会着色,我只想着色 thumbNailRow 内部的 playGlow 电影剪辑,但我不知道如何专门针对它。我得到 1120: Access of undefined property playGlow 否则。
如何将 playGlow 的实例传递到我的 ui 类中,以便我可以使用补间色调来定位该电影剪辑?
【问题讨论】:
标签: flash actionscript-3 class inheritance casting