4 Replies Latest reply on Nov 6, 2006 7:49 AM by patmck47

    tool tips

    patmck47
      I have a really nice tool tip code but I can't figure out how to format the text. can anyone help?

      thank you.
        • 1. Re: tool tips
          kglad Adobe Community Professional & MVP
          html-formatting or you want to control things like the font type, color font size? are you trying to embed a font and use the textformat class?
          • 2. Re: tool tips
            patmck47 Level 1
            i'd like to change the type from serif to arial and change size. there's a main script and then code also for each button that has the tool tip.

            i'm not savvy enough to know which way would be best.
            • 3. Re: tool tips
              kglad Adobe Community Professional & MVP
              is the textfield created with actionscript or in the authoring environment?
              • 4. Re: tool tips
                patmck47 Level 1
                This code is in the main timeline with the movieclip of the 4 buttons:

                // create the tooltip clip
                _root.createEmptyMovieClip("ToolTip", 15999);

                // add the tooltip background box
                _root.ToolTip.createEmptyMovieClip("TipBackground", 1);
                with (_root.ToolTip.TipBackground)
                {
                beginFill (0xffffff, 100);
                lineStyle (1, 0x000000, 100);
                moveTo (0, 0);
                lineTo (110, 0);
                lineTo (110, 20);
                lineTo (0, 20);
                lineTo (0, 0);
                endFill();
                }

                // add the tooltip textfield. you could easily apply a
                // textFormat to this to customise the text more.
                _root.ToolTip.createTextField("TipText", 2, 2, 0, 100, 20);
                _root.ToolTip.TipText.type = "dynamic";

                // hide the tip initially
                CloseTip();

                // mouse listener for tooltips
                TipMover = new Object();
                TipMover.onMouseMove = function()
                {
                ToolTip._x = _xmouse;
                ToolTip._y = _ymouse + 20;
                }

                // adds a text-description of the buttons function
                function DisplayTip(tip)
                {
                Mouse.addListener(TipMover);

                ToolTip._x = _xmouse;
                ToolTip._y = _ymouse + 20;
                ToolTip.swapDepths(15999);

                ToolTip._alpha = 100;

                ToolTip.TipText.text = tip;
                ToolTip.TipText.width = ToolTip.TipText.textWidth;
                ToolTip.TipBackground._width = ToolTip.TipText.textWidth + 8;

                }

                // hide tip
                function CloseTip()
                {
                Mouse.removeListener(TipMover);
                ToolTip._alpha = 0;
                ToolTip.TipText.text = "";
                }

                this.onRollOut = this.onDragOut = function() {
                hide();
                }

                Then this code is in the symbol editing timeline for each button:
                // code from on a button
                on(rollOver)
                {
                _root.DisplayTip("Rewind");
                }
                on(rollOut)
                {
                _root.CloseTip();
                }


                I found this code for text formatting, but i don't know where to put it. I tried a few places in the main timeline code, but no dice:

                myFormat = new TextFormat();
                myFormat.font="Arial";
                myFormat.size=12;
                TipText.setTextFormat(myFormat);

                what to do?

                Thank you.

                Text