动画剪辑内的 AS3 按钮用作滚动窗格的一部分 - 不起作用
我是一个动作脚本初学者,所以我希望你在回复时考虑到这一点。我遇到的问题是,客户要求我在滚动的文本框中放置一个号召性用语按钮。我的想法是创建一个包含文本和按钮的影片剪辑,然后将该影片剪辑放置在滚动窗格中。我整天都在胡闹,但进展甚微。我什至不确定实现这一目标的最佳方法。
如果你们中的一位学过动作脚本的人可以为我指明正确的方向,也许我可以找到自己的解决方案。
客户希望我为滚动条使用自定义图标,并且由于更改滚动条组件看起来像这样的 PIA,因此我试图避免使用组件。
任何帮助将不胜感激!
I'm a beginner actionscripter, so I hope you will take that into account when replying. The problem I am having is that a client has asked me to place a call to action button inside a textbox that scrolls. My idea was to create a movieclip containing the text and the button, then place that movieclip inside a scroll pane. I've been monkeying around with it all day and have made minimal headway. I'm not even sure of the best way to accomplish this.
If one of you learned actionscripters out there could point me in the right direction, perhaps I can find my own solution.
The client wants me to use custom icons for the scrollbars, and as altering a scrollbar component seems like such a PIA, I'm trying to avoid using components.
Any help would be appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为什么不让按钮在用户向下滚动到文本框底部时显示呢?将按钮实际上“放入”滚动框似乎不太干净,特别是如果用户再次向上滚动,则按钮将被隐藏。
假设您的舞台上有一个名为“text_txt”的 TextField、一个名为“someButton_mc”的 SimpleButton 或 MovieClip 以及一个名为“scrollBar_mc”的 UIScrollBar(来自组件);
在滚动条的属性中,将“scrollTargetName”设置为“text_txt”,以将滚动条链接到文本字段。然后编写如下代码:
给滚动条蒙皮并不像您想象的那么糟糕,至少一旦您弄清楚了。有很多关于皮肤或制作自定义滚动条的教程。让我知道这是否有帮助或者我是否误解了。
另一件事:确保“text_txt”是多行的,并且具有大量用于测试目的的文本。
Why not just have the button show up when the user scrolls down to the bottom of the textbox? Putting the button actually "in" the scroll box doesn't seem very clean, especially if the user then scrolls back up again then the button would be hidden.
Assuming on your stage have a TextField named "text_txt", a SimpleButton or MovieClip named "someButton_mc" and a UIScrollBar (from the components) named "scrollBar_mc";
In the scrollbar's properties set "scrollTargetName" to "text_txt" to link the scroll bar to the text field. Then code something like this:
Skinning the scroll bar isn't as bad a task as you'd think, at least once you figure it out. There are plenty of tutorials out there for skinning or making a custom scroll bar. Let me know if that helps or if I misunderstood.
One more thing: make sure "text_txt" is multiline and has a good amount of text for testing purposes.
您可以通过actionscript 将文本和按钮添加到scrollPane。可以在此处找到显示基础知识的好教程:
You can add your text and button to a scrollPane via actionscript. A Good tutorial showing the basics can be found here: http://www.parorrey.com/blog/flash-development/as3-add-dynamic-movieclips-to-scrollpane-component-using-flash/