Prototype Tool Tips

//Flash Prototype Tool Tips
//i found in http://www.flashzone.pl/item/731/MovieClip-setTooltip--/ and that is so useful. I copy down for future use.
//usage
//
b= new MovieClip()
s= new MovieClip()
d= new MovieClip()
b.setToolTip(" tooltip 1",6,false, 0xffffff, 0x000000);
//
s.setToolTip(" whooye mooje dzikie węże ");
//
d.setToolTip(" nie padnie zanimnnie zjedziesz z mc...",0);
// code=============================================================
MovieClip.prototype.setTooltip = function(theText, hideDelay, handcursor, text_color, bg_color, border_color){
function fadeIn (){
tip.onEnterFrame = function(){
if(tip.tooltip._alpha = (tip.hideDelay*1000) && tip.hideDelay!=0){
tip.onEnterFrame = function(){
if(tip.tooltip._alpha > 5) {
tip.tooltip._alpha -= 15 }else{tip.removeMovieClip()}
}
}
}
this.onRollOver = function(){
if (hideDelay==undefined) hideDelay = 2;
var newDate = new Date();
var f = new TextFormat("czcionka", 11);
this.useHandCursor = handcursor;
f.color = text_color;
tip = _root.createEmptyMovieClip("przechwyt", 12345);
tip.id = newDate.getTime();
tip.hideDelay = hideDelay;
tip.createTextField("tooltip", 12346, _root._xmouse + 20, _root._ymouse + 10, 150, 20);
with (tip.tooltip){
setNewTextFormat(f);
text = theText;
selectable = false;
autoSize = true;
background = true;
embedFonts = true;
border = true;
borderColor = border_color;
backgroundColor = bg_color != undefined ? bg_color : 0xFFFFEE;
_alpha = 0;
}
tip.onMouseMove = function(){
tip.tooltip._x = _root._xmouse + 20;
tip.tooltip._y = _root._ymouse + 10;
}
fadeIn.callWithDelay(0.6);
if(tip.hideDelay!=0){fadeOut.callWithDelay(tip.hideDelay+0.6)};
}
this.onRollOut = function (){
tip.hideDelay = 0.0001;
if(tip.tooltip)fadeOut();
}
};
Function.prototype.callWithDelay = function(delay,params){
var id = setInterval.apply(null,[this,1000*delay].concat(params));
var id2 = setInterval(function(){clearInterval(id);clearInterval(id2);},1000*delay);
};
Flash Prototype Tool Tips//i found in http://www.flashzone.pl/item/731/MovieClip-setTooltip--/ and that is so useful. I copy down for future use.//usage//b= new MovieClip()s= new MovieClip()d= new MovieClip()
b.setToolTip(" tooltip 1",6,false, 0xffffff, 0x000000);
//s.setToolTip(" whooye mooje dzikie węże ");
//d.setToolTip(" nie padnie zanimnnie zjedziesz z mc...",0);// code=============================================================MovieClip.prototype.setTooltip = function(theText, hideDelay, handcursor, text_color, bg_color, border_color){
function fadeIn (){tip.onEnterFrame = function(){if(tip.tooltip._alpha = (tip.hideDelay*1000) && tip.hideDelay!=0){tip.onEnterFrame = function(){if(tip.tooltip._alpha > 5) {tip.tooltip._alpha -= 15 }else{tip.removeMovieClip()}}}}
this.onRollOver = function(){if (hideDelay==undefined) hideDelay = 2;var newDate = new Date();var f = new TextFormat("czcionka", 11);this.useHandCursor = handcursor;f.color = text_color;tip = _root.createEmptyMovieClip("przechwyt", 12345);tip.id = newDate.getTime();tip.hideDelay = hideDelay;tip.createTextField("tooltip", 12346, _root._xmouse + 20, _root._ymouse + 10, 150, 20);with (tip.tooltip){setNewTextFormat(f);text = theText;selectable = false;autoSize = true;background = true;embedFonts = true;border = true;borderColor = border_color;backgroundColor = bg_color != undefined ? bg_color : 0xFFFFEE;_alpha = 0;}tip.onMouseMove = function(){tip.tooltip._x = _root._xmouse + 20;tip.tooltip._y = _root._ymouse + 10;}fadeIn.callWithDelay(0.6);if(tip.hideDelay!=0){fadeOut.callWithDelay(tip.hideDelay+0.6)};}
this.onRollOut = function (){tip.hideDelay = 0.0001;if(tip.tooltip)fadeOut();}};
Function.prototype.callWithDelay = function(delay,params){var id = setInterval.apply(null,[this,1000*delay].concat(params));var id2 = setInterval(function(){clearInterval(id);clearInterval(id2);},1000*delay);};

Advertisements

Any comments?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s