3 Replies Latest reply on Aug 10, 2009 9:50 AM by RyanAckley

    Hover Caption (Two or three lines of text.)

    RyanAckley Level 1

      Any help would be greatly appreciated.

       

      I am very, very new to ActionsScript and somewhat new to Flash.

       

      My question is in regards to Hover  Captions and specifically multiple lines of text.

       

      Like others who have posted here I am using the AS2 from kirupa.com to create  the hovering captions.  I can get it working no problem.

       

      The problem I do have is trying to figure out how to get it to do more than a  single line of text.

       

      So for example the first Caption in this code is "E-mail!".  I would wan,

       

      "E-mail!"        (Line 1)

      "Name!"         (Line 2)

      "Last Name!"  (Line 3).

       

      What I am hoping to do is have two or more lines of text in a single hover  caption.

       

      I have looked high and low on the web for answers and found none that work.

       

      Like I said before any help would be greatly appreciated and the simpler the better.

       

      Thank you.

       

       

      Kirupa.com Script.

       

      b1.onRollOver = function() {
      captionFN(true,           "E-Mail!", this);
      this.onRollOut = function() {
      captionFN(false);
      };
      };
      b2.onRollOver = function() {
      captionFN(true,           "Portable Devices", this);
      this.onRollOut = function() {
      captionFN(false);
      };
      };
      b3.onRollOver = function() {
      captionFN(true,           "Security", this);
      this.onRollOut = function() {
      captionFN(false);
      };
      };
      b4.onRollOver = function() {
      captionFN(true,           "Regional Settings", this);
      this.onRollOut = function() {
      captionFN(false);
      };
      };
      b5.onRollOver = function() {
      captionFN(true,           "Home Networking", this);
      this.onRollOut = function() {
      captionFN(false);
      };
      };
      b6.onRollOver = function() {
      captionFN(true,           "Add/Remove Programs", this);
      this.onRollOut = function() {
      captionFN(false);
      };
      };
      captionFN = function (showCaption,      captionText, bName) {
      if (showCaption) {
      _root.createEmptyMovieClip("hoverCaption",                this.getNextHighestDepth());
      cap.desc.text = captionText;
      cap._width = 7*cap.desc.text.length;
      cap._alpha = 75;
      //
      if ((bName._width+bName._x+cap._width)>Stage.width) {
      xo = -2-cap._width;
      yo = -17;
      } else {
      xo = 2;
      yo = -17;
      }
      hoverCaption.onEnterFrame = function() {
      cap._x = _root._xmouse+xo;
      cap._y = _root._ymouse+yo;
      cap._visible = true;
      };
      } else {
      delete hoverCaption.onEnterFrame;
      cap._visible = false;
      }
      };