如何在 ScrollPane 内显示工具提示而不让 Flash 8 隐藏工具提示?
我有一个滚动窗格的内容,单击该内容时,会显示带有 AttachMovieClip 的工具提示影片剪辑;问题是第一行附加的影片剪辑位于 ScrollPane 的边框下方并且部分不可见。 有没有办法解决这个问题(不改变附加影片剪辑的位置?)
I have the content of a scrollpane that, when clicked, show a tooltip movieclip with attachMovieClip; the problem is that the attached movie clip, for the first rows, goes under the border of the ScrollPane and is partially invisible.
Is there a way to solve this problem (without changing the position of the attached movie clip?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您正在
ScrollPane
的contentPath
内加载影片剪辑。该影片剪辑动态加载另一个影片剪辑,即工具提示。如果您以这种方式加载工具提示,深度并不重要:ScrollPane 对象内的所有内容都会被剪切,您将永远无法查看下面的内容。当然,这就是 ScrollPane 类的全部要点;它一次只显示一点底层内容,并允许用户滚动。下面是可以复制该问题的代码:
将其放入库影片剪辑中(将其称为
paneContentMC
)。打开属性。选中“Export for Actionscript”并将“Identifier:”文本设置为“paneContentMC1”。关闭属性,然后在paneContentMC
的时间轴上创建一些随机图形。创建另一个名为
tooltip
的影片剪辑。打开属性。选中“Export for Actionscript”并将“Identifier:”文本设置为“tooltip1”。最后,在场景的主时间轴上,创建一个
ScrollPane
并将“contentPath”属性设置为“paneContentMC1”。在 Actionscript 中为此时间线的第一帧放置一个stop();
命令。那里有一个被剪裁的工具提示。你如何解决这个问题?
您需要将工具提示附加到 ScrollPane 内容之外的对象。由于您不知道运行时舞台上可能存在或不存在哪些对象,因此请选择一个全局对象,例如
_root
。进入
paneContentMC
内的 Actionscript。将代码更改为:这并不能完全解决问题,因为
tooltip1A
正在跟随鼠标在ScrollPane
之外移动。但是,如果tooltip1A
正在监听来自paneContentMC
而不是来自鼠标的移动事件,那么这应该可以解决。(编辑以修复投票错误。)
I assume you are loading a movieclip inside the
ScrollPane
'scontentPath
. This movieclip dynamically loads another movieclip, the tooltip. If you are loading the tooltip this way, the depth doesn't matter: everything within theScrollPane
object is clipped, and you will never be able to view what is underneath. This is the whole point of aScrollPane
class, of course; it shows only a bit of the underlying content at a time, and allows the user to scroll around.Here is code that can replicate the problem:
Put this inside a library movieclip (call it
paneContentMC
). Open the Properties. Check "Export for Actionscript" and make the "Identifier:" text "paneContentMC1". Close the Properties, and then create some random graphics on the timeline inpaneContentMC
.Create another movieclip called
tooltip
. Open the Properties. Check "Export for Actionscript" and make the "Identifier:" text "tooltip1".Finally, on the scene's main timeline, create a
ScrollPane
and make the "contentPath" property "paneContentMC1". Put astop();
command in the Actionscript for the first frame of this timeline.There you have a clipped tooltip. How do you fix this?
You need to make the tooltip attach to an object outside the
ScrollPane
's content. Since you do not know what objects may or may not exist on the stage at runtime, pick a global object, like_root
.Go into the Actionscript inside
paneContentMC
. Change the code to:This does not solve the problem entirely, since
tooltip1A
is following the mouse around outside theScrollPane
. But if thetooltip1A
is listening for movement events from thepaneContentMC
rather than from the mouse, this should work out.(Edited to fix a voting error.)