How do I show tooltips inside ScrollPane without letting Flash 8 hide the tooltip?

I have the contents of scrollpane which, when clicked, shows a movieclip tooltip with attachMovieClip; the problem is that the attached video clip for the first lines goes under the ScrollPane border and is partially invisible. Is there any way to solve this problem (without changing the position of the attached movie clip?)

+4
source share
1 answer

I assume that you are loading a movie clip inside the ScrollPane contentPath . This movie clip dynamically loads another movie clip, a tooltip. If you load the tooltip this way, the depth doesn't matter: everything inside the ScrollPane object ScrollPane cropped and you can never see what is below. Of course, this is the whole point of the ScrollPane class; it only shows a little basic content at a time and allows the user to navigate.

Here is the code that could 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 the movieclip library (name it paneContentMC ). Open Properties. Check the box "Export for Actionscript" and make the text "Identifier:" "paneContentMC1". Close properties, and then create custom timeline graphics in paneContentMC .

Create another movie clip called tooltip . Open Properties. Check the "Export for ActionScript" checkbox and enter the text "Identifier:" "tooltip1".

Finally, on the main timeline of the scene, create a ScrollPane and create the contentPath property "paneContentMC1". Put the stop(); command stop(); in ActionScript for the first frame of this timeline.

There you have a cropped tip. How do you fix this?

You need to make a tooltip attached to the object outside the contents of the ScrollPane . Since you do not know what objects may or may not exist on stage at runtime, select a global object, such as _root .

Go to 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 completely, since tooltip1A follows the mouse around the ScrollPane . But if tooltip1A listens for motion events from paneContentMC and not from the mouse, this should work.

(Edited to correct voting errors.)

+3
source

Source: https://habr.com/ru/post/1387781/


All Articles