• Home
  • Free Tutorials
  • Free Video Tutorials

Adobe Photoshop
Autodesk 3ds Max
CSS
Flash
Help Center Live
iPhone
Joomla
Make Money Online!
Mambo
mIRC
Outlook Express
SEO / SEM
Simple Machine Forum
Target Explorer

Button Tooltip

Category : Flash Views : 17507
Version : 8 Rating : 
2.6/5 (34 votes)
  • Currently 2.65/5
  • 1
  • 2
  • 3
  • 4
  • 5
Type : Text Source File: button-tooltip.zip
Result: See the result


Previous | 1 | 2 | Next

Code Explanation

btn1.onRollOver = function() { tooltipTimer = setInterval(showTooltip, 1000, "This is Button 1"); }
This code sets an interval that calls the function "showTooltip" every 1000 milliseconds with the parameter "This is Button 1".

setInterval(function name, milliseconds, parameters for the function);
The third parameter for setInterval is optional.
Every setInterval returns an unique ID and this ID number is need if we want to stop calling the function "showTooltip".
That’s why we used "tooltipTimer = ...;".

btn1.onRollOut = btn2.onRollOut = btn3.onRollOut = function() { _root.Tooltip._visible = false; clearInterval(tooltipTimer); }
On the RollOut event of all button set the visibility of the tooltip to false and use the function clearInterval to stop calling "showTooltip".

clearInterval(ID number); function showTooltip(tip) { _root.Tooltip._visible = true;
Make Tooltip visible.

_root.Tooltip._x = _xmouse; _root.Tooltip._y = _ymouse;
Set Tooltip position.

_root.Tooltip.tip.text = tip; }
Set text for the tooltip.

That's the end of the tutorial. Happy coding!


del.icio.us digg it Reddit Stumble Upon Technorati

Previous | 1 | 2 | Next
How to Video Tutorials on software by Helpvids.com

Video tutorial: Forex trading



Sponsors



Advertisement









Studio | Advertisement | About Webzo | Contact Webzo | Terms of Use | Free Video Tutorials by Helpivds

Copyright © 2007 NR Concepts Ltd. All rights reserved.