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?)
-
Have you tried passing getNextHighestDepth() as the third parameter of attachMovie()? http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00001303.html . The following are worth a look too: http://help.adobe.com/it_IT/AS2LCR/Flash_10.0/help.html?content=00002309.html and http://goflashgo.wordpress.com/2007/04/19/simple-depth-manager/ – AsTheWormTurns Dec 26 '11 at 10:48
-
Please give a bit of code that shows what is being done. Is this exclusively in AS3 (FlashBuilder, etc.) or is it in the Flash IDE? By "changing position", does this mean x,y or does it mean depth level in the object stack? – iND Jan 01 '12 at 16:46
1 Answers
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.)

- 2,663
- 1
- 16
- 36
-
-
@iND: iND, sorry, it was my fault: I wanted to upvote your rich reply but I downvoted... If you edit a little your reply it seems I can upvote. – AsTheWormTurns Jan 04 '12 at 08:31
-