如何在 ScrollPane 内显示工具提示而不让 Flash 8 隐藏工具提示?

发布于 2024-12-22 19:24:12 字数 125 浏览 0 评论 0原文

我有一个滚动窗格的内容,单击该内容时,会显示带有 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 技术交流群。

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

发布评论

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

评论(1

歌入人心 2024-12-29 19:24:12

我假设您正在 ScrollPanecontentPath 内加载影片剪辑。该影片剪辑动态加载另一个影片剪辑,即工具提示。如果您以这种方式加载工具提示,深度并不重要:ScrollPane 对象内的所有内容都会被剪切,您将永远无法查看下面的内容。当然,这就是 ScrollPane 类的全部要点;它一次只显示一点底层内容,并允许用户滚动。

下面是可以复制该问题的代码:

this.attachMovie("tooltip1","tooltip1A", 100); //note the high level     
var mouseListener:Object = new Object();
mouseListener.onMouseMove = function() {
    tooltip1A._x = _xmouse;
    tooltip1A._y = _ymouse;
    updateAfterEvent();
};

Mouse.addListener(mouseListener);

将其放入库影片剪辑中(将其称为 paneContentMC)。打开属性。选中“Export for Actionscript”并将“Identifier:”文本设置为“paneContentMC1”。关闭属性,然后在 paneContentMC 的时间轴上创建一些随机图形。

创建另一个名为 tooltip 的影片剪辑。打开属性。选中“Export for Actionscript”并将“Identifier:”文本设置为“tooltip1”。

最后,在场景的主时间轴上,创建一个 ScrollPane 并将“contentPath”属性设置为“paneContentMC1”。在 Actionscript 中为此时间线的第一帧放置一个 stop(); 命令。

那里有一个被剪裁的工具提示。你如何解决这个问题?

您需要将工具提示附加到 ScrollPane 内容之外的对象。由于您不知道运行时舞台上可能存在或不存在哪些对象,因此请选择一个全局对象,例如_root

进入 paneContentMC 内的 Actionscript。将代码更改为:

var mc1:MovieClip = _root.attachMovie("tooltip1","tooltip1A", _root.getNextHighestDepth());

var mouseListener:Object = new Object();
mouseListener.onMouseMove = function() {
    _root.tooltip1A._x = _xmouse;
    _root.tooltip1A._y = _ymouse;
    updateAfterEvent();
};

这并不能完全解决问题,因为 tooltip1A 正在跟随鼠标在 ScrollPane 之外移动。但是,如果 tooltip1A 正在监听来自 paneContentMC 而不是来自鼠标的移动事件,那么这应该可以解决。

(编辑以修复投票错误。)

I assume you are loading a movieclip inside the ScrollPane's contentPath. This movieclip dynamically loads another movieclip, the tooltip. If you are loading the tooltip this way, the depth doesn't matter: everything within the ScrollPane object is clipped, and you will never be able to view what is underneath. This is the whole point of a ScrollPane 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:

this.attachMovie("tooltip1","tooltip1A", 100); //note the high level     
var mouseListener:Object = new Object();
mouseListener.onMouseMove = function() {
    tooltip1A._x = _xmouse;
    tooltip1A._y = _ymouse;
    updateAfterEvent();
};

Mouse.addListener(mouseListener);

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 in paneContentMC.

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 a stop(); 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:

var mc1:MovieClip = _root.attachMovie("tooltip1","tooltip1A", _root.getNextHighestDepth());

var mouseListener:Object = new Object();
mouseListener.onMouseMove = function() {
    _root.tooltip1A._x = _xmouse;
    _root.tooltip1A._y = _ymouse;
    updateAfterEvent();
};

This does not solve the problem entirely, since tooltip1A is following the mouse around outside the ScrollPane. But if the tooltip1A is listening for movement events from the paneContentMC rather than from the mouse, this should work out.

(Edited to fix a voting error.)

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