ActionScript 3 鼠标事件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ActionScript 3 鼠标事件相关的知识,希望对你有一定的参考价值。

//nextButton functionality;
nextButton.buttonMode = true;
nextButton.useHandCursor = true;
nextButton.mouseChildren = false;
nextButton.addEventListener(MouseEvent.MOUSE_DOWN,nextPhoto);
nextButton.addEventListener(MouseEvent.MOUSE_OVER, nextTextVisible);
nextButton.addEventListener(MouseEvent.MOUSE_OUT, nextTextInvisible);

//Tweener.addTween(nextButton, {_color:0x0000ff, time:.5, transition:"easeOutQuart";
//Tweener.addTween(nextButton, {_color:null, time:1, transition:"easeOutQuart"
function nextTextVisible(e:MouseEvent):void
{
	Tweener.addTween(nextTextText, {alpha:1, time:.5, transition:"easeOutQuart"});
}
function nextTextInvisible(e:MouseEvent):void
{
	Tweener.addTween(nextTextText, {alpha:0, time:.5, transition:"easeOutQuart"});
}

function nextPhoto(e:MouseEvent)
{
	if (photoCounter != totalPhotos)
	{
		trace(photoCounter);
		Tweener.addTween(this["photo"+photoCounter], {alpha:0, time:.5, transition:"easeOutQuad", onComplete:fadeInNext});
		photoCounter = photoCounter + 1;
	}
	else
	{
		Tweener.addTween(this["photo"+photoCounter], {alpha:0, time:.5, transition:"easeOutQuad", onComplete:fadeInNext});
		photoCounter = 1;
	}
}

以上是关于ActionScript 3 鼠标事件的主要内容,如果未能解决你的问题,请参考以下文章

ActionScript 3 鼠标事件

actionscript 3按钮操作[监听单个事件。例如,鼠标向上移动]

Flash actionscript 3 功能需要鼠标点击事件吗?

ActionScript 3 鼠标事件使用AS3的简单绘图应用程序

Actionscript 3将对象旋转到鼠标

在 Actionscript 3 中拖动时检测鼠标离开阶段