1 Replies - 1181 Views - Last Post: 27 May 2008 - 03:17 PM

#1 reyco1  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 43
  • Joined: 20-March 05

toolTip

Posted 18 February 2006 - 06:25 AM

Description: place prototype in your fla file. use it like this:

myMC.toolTip("hello world");add a tooltip to any object
MovieClip.prototype.toolTip = function(msg:String) {
     this.onRollOver = function() {
          timer = setInterval(showTip, 500);
          theObject = this._name.toString();
          function showTip() {
               clearInterval(timer);
               _root.createTextField("toolTip", 1000, _root._xmouse+10, _root._ymouse-30, 10, 10);
               _root.toolTip.autoSize = true;
               _root.toolTip.border = true;
               _root.toolTip.background = true;
               _root.toolTip.backgroundColor = 0xFFFFC9;
               var myformat:TextFormat = new TextFormat();
               myformat.font = "Arial";
               myformat.size = 10;
               _root.toolTip.text = msg;
               _root.toolTip.setTextFormat(myformat);
               onEnterFrame = function () {
                    _root.toolTip._x = _root._xmouse+10;
                    _root.toolTip._y = _root._ymouse-30;
               };
          }
     };
     this.onRollOut = function() {
          _root.toolTip.removeTextField();
          clearInterval(timer);
     };
};
//-< use it like this >--\
my_mc.toolTip("Hi there.");


Is This A Good Question/Topic? 0
  • +

Replies To: toolTip

#2 jrue  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 27-May 08

Re: toolTip

Posted 27 May 2008 - 03:17 PM

Great script. I love it! But I don't understand why you declare theOject as a string of the instance name. theObject = this._name.toString(); I don't see it used anywhere. Otherwise, it works fantastic! Thanks a bunch.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1