Demo Effect:
The role of the suspension label everyone may know: the role of explanation, we can see in many parts of the computer, this time we use flash to make a suspension tag.
Step1: Prepare six icons, convert them to button, instance name B1,b2,b3,b4,b5,b6.
OK, now let's do the tag:
Draw a rectangle with a rectangular tool without a border, choose the color yellow bar, press F8 to convert to movie clip, instance named Cap.
Double-click into edit state, create a new layer, then do a dynamic text box: width:100,heigth:15, Color black, instance named Desc, return to the main movie.
Step2: Create a new layer on the main movie and put the action script:
B1.onrollover = function () {
CAPTIONFN (True, "Button1", this);
This.onrollout = function () {
CAPTIONFN (FALSE);
};
};
B2.onrollover = function () {
CAPTIONFN (True, "Button2", this);
This.onrollout = function () {
CAPTIONFN (FALSE);
};
};
B3.onrollover = function () {
CAPTIONFN (True, "Button3", this);
This.onrollout = function () {
CAPTIONFN (FALSE);
};
};
B4.onrollover = function () {
CAPTIONFN (True, "Button4", this);
This.onrollout = function () {
CAPTIONFN (FALSE);
};
};
B5.onrollover = function () {
CAPTIONFN (True, "Button5", this);
This.onrollout = function () {
CAPTIONFN (FALSE);
};
};
B6.onrollover = function () {
CAPTIONFN (True, "Button6", this);
This.onrollout = function () {
CAPTIONFN (FALSE);
};
};
CAPTIONFN = function (Showcaption, CaptionText, bname) {
if (showcaption) {
_root.createemptymovieclip ("Hovercaption", this.getnexthighestdepth ());
Cap.desc.text = CaptionText;
Cap._width = 7*cap.desc.text.length;
Cap._alpha = 75;
//
if ((bname._width+bname._x+cap._width) >stage.width) {
XO = -2-cap._width;
yo =-17;
} else {
XO = 2;
yo =-17;
}
Hovercaption.onenterframe = function () {
cap._x = _root._xmouse+xo;
cap._y = _root._ymouse+yo;
Cap._visible = true;
};
} else {
Delete Hovercaption.onenterframe;
Cap._visible = false;
}
};
Ok,ctr+enter