Good day,
I know that this has been discussed in other threads, but I can not seem to get the code adjusted to work with my file. The tutorial: http://www.kirupa.com/developer/mx2004/hover_captions.htm would be perfect… if I could get the code to work with what I want to do, but I couldn’t do it quickly so I had to do it all manually like with regular button instances.
This is what I have:
- A map (image in behind everything)
- Buttons
- each button contains a movie clip icon (so that I could apply a Tint to it easily), and on the Over and Down sections they have a movie clip that has dynamic text fields that pull from a .txt file. That was a pain in itself because I couldn’t think of a way to dynamically load the data into a generic instance of a movie clip (I know it’s possible… but I can’t seem to figure it out).
I need it so that when I mouse over a button, that particular button is elevated to the highest depth so that it overlaps all the rest, however when you mouse over the next button it now becomes the highest.
I’ve tried just doing:
us.onRollOver = function() {
moveup = this.getNextHighestDepth();
this.swapDepths(moveup);
};
and this:
us.onRollOver = function() {
this.getNextHighestDepth();
};
also (attempted adjustment from the tutorial, with bHover as the name of the movie clip that has all the info in it):
be.onRollOver = function() {
captionFN(true, hovcap_be, this);
this.onRollOut = function() {
captionFN(false);
};
};
captionFN = function (showCaption, bHover, bName) {
if (showCaption) {
_root.createEmptyMovieClip(“hoverCaption”, this.getNextHighestDepth());
hoverCaption = bHover
bHover._alpha = 75;
if ((bName._width+bName._x+bHover._width)>Stage.width) {
xo = -2-bHover._width;
yo = -17;
} else {
xo = 2;
yo = -17;
}
hoverCaption.onEnterFrame = function() {
bHover._x = _root._xmouse+xo;
bHover._y = _root._ymouse+yo;
bHover._visible = true;
};
} else {
delete hoverCaption.onEnterFrame;
bHover._visible = false;
}
};
And neither work. I’ve tried modifying the code for the tutorial I posted above… but I need it to load a pre-created hover clip, or to somehow (quickly) figure out how to create dynamic loading hover captions with multiple lines pulling from different variables in a .txt file.
**If I could even get code to link the proper variables from my txt file into the dynamic text fields in the movie clip when you mouse over different buttons (it would change depending on the button you were over) and have the moused-over button be the highest depth… that is my ideal solution. Be darned if I can figure it out myself though… it’s been weeks (between this and all the financial stuff I also do for the company… no time for self-development).
I’d prefer not to post the fla and txt files as it is for a client, but if you really need to see it to know what I’m talking about… just ask.
I appreciate any help that anyone can provide, and I apologize for posting something that seems so similar to other posts… I just can’t get their solution code to work for me.