8 Replies Latest reply on Nov 26, 2007 2:59 AM by Mike Crisp

    Tooltip

    Mike Crisp
      I am using tooltip (director MX04 library behaviour) in a project where if the user passes the cursor over a 'Button' the foriegn language version of that word appears as a tooltip - so far I have only tested it with a single language where I have manually typed the correct response. e.g. Main Selector -> Tooltip = Sélecteur principal (in French)
      HOWEVER
      The end project requires 7 different languages. I have successfully provided the user with an option to change language (using external casts and switching to the required language) but I need to know if I can get Tooltip to read from an external cast rather than from my manual input.

      Any ideas
        • 1. Re: Tooltip
          Level 7
          You would need to modify the tooltip behavior.
          I would perhaps enter English for all the tooltips and create a #movie
          script in the linked language castLib that implements a translation
          handler specific to the language chosen, and call this handler from the
          #beginSprite handler of the tooltip behavior.
          Perhaps something like:
          -- Tooltip
          <snip>
          on beginSprite me
          Initialize me
          myString = mTranslateString(myString)
          end beginSprite
          </snip>

          -- #movie script in external castLib:
          -- French cast
          on mTranslateString aString
          case aString of
          "Main Selection": return "S?lecteur principal"
          -- other cases listed here
          end case
          -- default in case no translation is provided
          return aString
          end
          • 2. Re: Tooltip
            Level 7

            "Sean Wilson" <webforumsuser@macromedia.com> wrote in message
            news:fhfhv2$8gm$1@forums.macromedia.com...
            > You would need to modify the tooltip behavior.
            > I would perhaps enter English for all the tooltips and create a #movie
            > script in the linked language castLib that implements a translation
            > handler specific to the language chosen, and call this handler from the
            > #beginSprite handler of the tooltip behavior.
            > Perhaps something like:
            > -- Tooltip
            > <snip>
            > on beginSprite me
            > Initialize me
            > myString = mTranslateString(myString)
            > end beginSprite
            > </snip>
            >
            > -- #movie script in external castLib:
            > -- French cast
            > on mTranslateString aString
            > case aString of
            > "Main Selection": return "S?lecteur principal"
            > -- other cases listed here
            > end case
            > -- default in case no translation is provided
            > return aString
            > end

            Hi,
            I would try to avoid that approach.
            If any of the strings change, you have to change them in more than one
            place.

            I usually make numbered strings, and refer to them in the behaviour (and
            everywhere alse too of course).

            Richard


            • 3. Re: Tooltip
              Level 7
              > I would try to avoid that approach.
              > If any of the strings change, you have to change them in more than one
              > place.

              I'm not sure I follow you. If any strings change, they will only need to
              be altered in a single handler.
              • 4. Re: Tooltip
                Mike Crisp Level 1
                Could I use mouseEnter and mouseLeave as a clumsy work around, I haven't tried it yet but modifying the tooltip behavior may be a programming step too far to me.
                • 5. Re: Tooltip
                  Level 7

                  "Sean Wilson" <webforumsuser@macromedia.com> wrote in message
                  news:fhg8l3$77b$2@forums.macromedia.com...
                  >> I would try to avoid that approach.
                  >> If any of the strings change, you have to change them in more than one
                  >> place.
                  >
                  > I'm not sure I follow you. If any strings change, they will only need to
                  > be altered in a single handler.

                  If the original english "Main Selection" changes to eg. "Basic Selection",
                  you must change that string for every language you have.

                  R.


                  • 6. Re: Tooltip
                    Level 7

                    "Mike Crisp" <webforumsuser@macromedia.com> wrote in message
                    news:fhk34k$f57$1@forums.macromedia.com...
                    > Could I use mouseEnter and mouseLeave as a clumsy work around, I haven't
                    > tried it yet but modifying the tooltip behavior may be a programming step
                    > too far to me.
                    >

                    Hi,
                    I could send you my solution if you want, so you can just try it out.
                    Just let me know where to send it.

                    Richard.


                    • 7. Re: Tooltip
                      Level 7
                      > modifying the tooltip behavior may be a programming step too far to me.

                      You could take up Richard on his offer, or you could implement the
                      change/s I posted earlier. My solution requires the addition of a single
                      line of code to the Tooltip behavior (in the beginSprite handler) and
                      the creation of a #movie script handler in each of your language casts.
                      • 8. Re: Tooltip
                        Mike Crisp Level 1
                        Richard

                        please send to mike.crisp@tacklesport.com

                        Thanks