将鼠标悬停在Flash CS3中的文本上时,如何显示图像? [英] How to make an image appear when hovering over text in Flash cs3?

查看:187
本文介绍了将鼠标悬停在Flash CS3中的文本上时,如何显示图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何.fla有文本,当鼠标结束,文本图像显示看起来像?



我想要使文本按钮,然后添加一些脚本....

解决方案



首先,您需要创建一个包含文本的MovieClip符号。



为该符号实例指定一个名称(比如 mClip1
然后,导入你的图像,并从中创建一个符号。将其命名(例如 img1

然后,隐藏图片

  img1.visible = false; 

接下来,将MOUSE_OVER和MOUSE_OUT事件监听器添加到 mClip1 $ b $ pre $ mClip1.addEventListener(MouseEvent.MOUSE_OVER,mOver);
mClip1.addEventListener(MouseEvent.MOUSE_OUT,mOut);

最后,声明这些事件监听器并定义它​​们。

 函数mOver(e:MouseEvent):void {
img1.visible = true;


函数mOut(e:MouseEvent):void {
img1.visible = false;



$ b

http://www.uploads.sc/download.php?file=749ce36c801a9bf18ce1b5033d8fd82f


How would the .fla that has text and when mouse is over that text an image appears look like?

I was thinking to make the text a button and then add some script....

解决方案

This is relatively simple

First, you'll need to make a MovieClip symbol containing your text.

Give that symbol instance a name (say mClip1)

Then, import your image and create a symbol from that too. Name it (e.g. img1)

Then, hide the image

img1.visible=false;

Next, add the MOUSE_OVER and MOUSE_OUT event listeners to mClip1

mClip1.addEventListener(MouseEvent.MOUSE_OVER, mOver);
mClip1.addEventListener(MouseEvent.MOUSE_OUT, mOut);

Finally, declare those event listeners and define them

function mOver(e:MouseEvent):void {
    img1.visible=true;
}

function mOut(e:MouseEvent):void {
    img1.visible=false;
}

Download the demo file (Flash CS5) from http://www.uploads.sc/download.php?file=749ce36c801a9bf18ce1b5033d8fd82f

这篇关于将鼠标悬停在Flash CS3中的文本上时,如何显示图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆