Mailing List
Home
Flash Pro
Extending Flash
Flash Macromedia Developer
Subjects
Firework Effect
setInterval bug identified and fixed
setInterval bug identified and fixed
ScrollPane component doesn 't auto update
Help: MX 2004 How to script a print button to print the entire sli
Event Dispatcher between classes
memory management removeMovieClip /
MX2004 Dataset itemClassName
Order of events per frame
XML to Object help
Textfield prototype question
Flash and QuickTime VR
Reading and displaying RSS feeds in Flash MX
Flash MX 2004 Sucks
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash Interface with 10mb xml file
Web Service Results
Listener Object 's best practice
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Tooltip

Tooltip

2004-02-17       - By JayFlash

 Back
Reply:     1     2     3     4     5     6     7  


I have a tooltip code too, but it´s very basic and won 't follow mouse moves.
In case anyone needs it:



// IMPORTANT: You will need to create a Font Symbol in the Library and
export it for actionscript for this to work
// You may get better results with biptmap fonts that don 't blur in Flash


//-- ---- ---- ---- ---- Fade-in function -- ---- ---- ---- -----

MovieClip.prototype.customFade = function(desAlpha, rate){
   this.onEnterFrame = function(){
      if (this._alpha <= desAlpha){
      this._alpha += rate;
         if(this._alpha > desAlpha){
            delete(this.onEnterFrame);
         }
      }

      if (this._alpha >= desAlpha){
      this._alpha -= rate;
         if(this._alpha < desAlpha){
            delete(this.onEnterFrame);
         }
      }
   }
}

// -- ---- ---- ---- ----- Erase -- ---- ---- ---- ---- ---- -----

eraseTip = function(mc){
   if(mc){
      removeMovieClip(mc);
   }
   clearInterval(tip_intv);
}

//-- ---- ---- ---- ------ Create -- ---- ---- ---- ---- ---- ---



createTip = function(prop,x,y){
   if(tipObj[prop].length >1){
   this.createEmptyMovieClip( "ttip ",2);
   ///////////////
   clearInterval(tip_intv);
   _global.tip_intv = setInterval(eraseTip,5000,ttip);
   /////////
   myTextFormat = new TextFormat( "Verdana ",10);
   ttip.createTextField( "field ",2,x+30,y+25,0,0);
   with(ttip.field){
      border=1;
      embedFonts=1;
      autoSize = "left ";
      _height = 200;
      text = " "+ tipObj[prop]+ " ";
      background=1
      backgroundColor = "0xFFFFCC ";
      setTextFormat(myTextFormat);
   }
   ttip._alpha=0;
   ttip.customFade(100,8);
   }else{
      removeMovieClip( "ttip ");
   }
}


//-- ---- ------ An Object to store tip text in -- ---- ---- -----

tipObj = {
   bt: "Default Tip \n with a linebreak "
}



// -- ---- ---- ---- -- Usage -- ---- ---- ---- ---- ---- ---- ---

bt.onRollOver=function(){
   createTip(this._name,this._x,this._y);
}
bt.onRollOut=function(){
   eraseTip(ttip);
}


// You may use onSetFocus to apply this to Textfields too.


Cheers,

Jay






-- --Mensagem original-- --
De: Pamisano [mailto:pamisano@(protected)]
Enviada em: terça-feira, 17 de fevereiro de 2004 06:54
Para: flashcoders@(protected)
Assunto: Re: [Flashcoders] Tooltip


I am not familiar with the MM Tool Tip component. But I have one here that
may be of use to you: http://www.archil.net/ttc/

Let me know if you need any help.

Pete



=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Supported by Fig Leaf Software
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Be sure to check the archives and the wiki:
http://chattyfig.figleaf.com/
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:104488
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe send a blank e-mail to:
Normal Mode: flashcoders-unsubscribe@(protected)
Digest Mode: flashcoders-digest-unsubscrive@(protected)