actionscript3 在按钮悬停时打印数组值

发布于 2024-08-08 08:27:49 字数 188 浏览 3 评论 0原文

我创建了一个英国的 Flash 地图,它分为多个区域,每个区域都是一个按钮,在未滚动时完全可见,在滚动时完全半透明(以不同的颜色显示相同的区域)。我现在需要的是,当按钮滚动时,我需要它显示区域名称,我有一个区域名称数组,我希望可以将 AS 写入单独的文件中,然后将其链接到 SWF 。这可能吗?我将如何编写该函数?

谢谢西科

87

I have created a flash map of the uk which is splti into regions, each region is a button that is fully visible when not rolled on and and fully transluscent when rolled over(to show the same region in a different color). What I need now is for when the button is rolled over I need it show the region name, I have an array of the region names and I was hoping it would be possible to write the AS in seperate file and then link it to the SWF. Is this possible and how would I write the function?

Thanks

Sico87

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

拥抱影子 2024-08-15 08:27:49

好的。 你不需要上课。这些区域是静态形状。将他们的名字放在它们下面,并在动画中将 alpha 更改为 0 以显示区域名称和背景颜色。

如果您喜欢使用类:

  1. 如果您从代码构建场景:为按钮行为创建基本类(使用事件扩展 Sprite 的类)并使用区域代码扩展它。

  2. 如果您在 Flash 中构建场景:使用鼠标事件处理程序创建扩展 Sprite 的类。在 MouseEvent.ROLL_OVER 和 Mouse Event.ROLL_OUT 上,为其属性或子属性设置动画。使用 getChildByName("Name in stage")

在库末尾选择“export for ActionScript”。在“基础班级”中写下您的班级名称。

Ok. You don't need a class. The regions are static shapes. Put theirs names under them and in animation change alpha to 0 to show name of region and background color.

If you like to use class:

  1. If you build scene from code: create basic class for button behaviour (class extending Sprite with events) and extend it with code of region.

  2. If you build scene in flash: Create class extending Sprite with mouse events handlers. On MouseEvent.ROLL_OVER and Mouse Event.ROLL_OUT animate it property or childrens properties. Use getChildByName("Name in stage")

At the end in library select "export for ActionScript". In "Basic class" write your class name.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文