tombotxp
%Europe/Berlin %523 %2005, 13:33
Ik gebruik onderstaande code voor een ToolTip. Wat moet ik nu allemaal veranderen om de tooltip een vaste breedte te geven? Ook wil ik dat de tooltip nooit buiten de swf kan komen, wat nu wel het geval is.
Alvast bedankt voor het helpen,
Tom
// create the tooltip clip
_root.createEmptyMovieClip("ToolTip", 15999);
// add the tooltip background box
_root.ToolTip.createEmptyMovieClip("TipBackground", 1);
with (_root.ToolTip.TipBackground) {
beginFill(0xCCCCCC, 100);
lineStyle(1, 0x666666, 100);
moveTo(0, 0);
lineTo(110, 0);
lineTo(110, 20);
lineTo(0, 20);
lineTo(0, 0);
endFill();
}
// add the tooltip textfield. you could easily apply a
// textFormat to this to customise the text more.
_root.ToolTip.createTextField("TipText", 2, 2, 0, 100, 20);
_root.ToolTip.TipText.type = "dynamic";
// hide the tip initially
CloseTip();
// mouse listener for tooltips
TipMover = new Object();
TipMover.onMouseMove = function() {
ToolTip._x = _xmouse+20;
ToolTip._y = _ymouse+20;
};
// adds a text-description of the buttons function
function DisplayTip(tip) {
Mouse.addListener(TipMover);
ToolTip._x = _xmouse+20;
ToolTip._y = _ymouse+20;
ToolTip._visible = true;
ToolTip.swapDepths(_root.getNextHighestDepth());
ToolTip._alpha = 75;
ToolTip.TipText.text = tip;
ToolTip.TipText._width = ToolTip.TipText.textWidth + 10;
ToolTip.TipBackground._width = ToolTip.TipText.textWidth + 15;
}
// hide tip
function CloseTip() {
Mouse.removeListener(TipMover);
ToolTip._visible = false;
ToolTip._alpha = 0;
ToolTip.TipText.text = "";
}
Alvast bedankt voor het helpen,
Tom
// create the tooltip clip
_root.createEmptyMovieClip("ToolTip", 15999);
// add the tooltip background box
_root.ToolTip.createEmptyMovieClip("TipBackground", 1);
with (_root.ToolTip.TipBackground) {
beginFill(0xCCCCCC, 100);
lineStyle(1, 0x666666, 100);
moveTo(0, 0);
lineTo(110, 0);
lineTo(110, 20);
lineTo(0, 20);
lineTo(0, 0);
endFill();
}
// add the tooltip textfield. you could easily apply a
// textFormat to this to customise the text more.
_root.ToolTip.createTextField("TipText", 2, 2, 0, 100, 20);
_root.ToolTip.TipText.type = "dynamic";
// hide the tip initially
CloseTip();
// mouse listener for tooltips
TipMover = new Object();
TipMover.onMouseMove = function() {
ToolTip._x = _xmouse+20;
ToolTip._y = _ymouse+20;
};
// adds a text-description of the buttons function
function DisplayTip(tip) {
Mouse.addListener(TipMover);
ToolTip._x = _xmouse+20;
ToolTip._y = _ymouse+20;
ToolTip._visible = true;
ToolTip.swapDepths(_root.getNextHighestDepth());
ToolTip._alpha = 75;
ToolTip.TipText.text = tip;
ToolTip.TipText._width = ToolTip.TipText.textWidth + 10;
ToolTip.TipBackground._width = ToolTip.TipText.textWidth + 15;
}
// hide tip
function CloseTip() {
Mouse.removeListener(TipMover);
ToolTip._visible = false;
ToolTip._alpha = 0;
ToolTip.TipText.text = "";
}