actionscript3 在按钮悬停时打印数组值
我创建了一个英国的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的。 你不需要上课。这些区域是静态形状。将他们的名字放在它们下面,并在动画中将 alpha 更改为 0 以显示区域名称和背景颜色。
如果您喜欢使用类:
如果您从代码构建场景:为按钮行为创建基本类(使用事件扩展 Sprite 的类)并使用区域代码扩展它。
如果您在 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:
If you build scene from code: create basic class for button behaviour (class extending Sprite with events) and extend it with code of region.
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.