当前位置:知识问问>生活百科>如何使用FLASH组件实现下拉条功能(2)(AS3)

如何使用FLASH组件实现下拉条功能(2)(AS3)

2024-12-21 13:13:44 编辑:join 浏览量:591

如何使用FLASH组件实现下拉条功能(2)(AS3)

下拉条是制作FLASH课件时经常会用到的组件,但是对于不怎么会代码的同学,制作这样的效果就比较难了。在这里讲使用UIScrollBar组件结合动态文本框实现文字内容下拉效果的方法。

打开制作软件,新建AS3文档。

打开组件面板,快捷键(Ctrl+F7)。

找到UIScrollBar组件,用鼠标拖到舞台上。

在舞台添加一个动态文本框,大小可设置如下,并使用任意变形工作对刚才拖出来的组件进行大小调整,如下。

动态文本框属性设置如下。

下拉条组件属性设置如下。

选择下拉条组件,并在属性面板点击显示参数。设置scrollTargetName为txt

主时间轴加如下代码:

txt.text="asdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfaasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nsdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\nasdfasdfasdfasdfasdfasdf\n";

其中\n是换行标识符。导出效果如下

标签:FLASH,下拉条,AS3

版权声明:文章由 知识问问 整理收集,来源于互联网或者用户投稿,如有侵权,请联系我们,我们会立即处理。如转载请保留本文链接:https://www.zhshwenwen.com/life/481244.html
热门文章