2 Replies Latest reply on Jan 7, 2008 6:44 AM by rafa@mediatech

    Rollover text effect

      I want to put text below a text title that after the mouse rollsover the title text the text below (or in any place of the stage) shows up.

      For example i want to put the lyrics of a music and when the mouse rolls over the title of the music the lyrics show up below

      How do i do it?
        • 1. Re: Rollover text effect
          Wolfgang Herold Level 2
          create 3 textmembers, eg TM1 = Titletxt, TM2 = textfield to show ,
          TM3 = storedText. and place TM1 and TM2 on the stage.

          on startmovie
          member("TM2").text = "" -- to clear the field

          you can clear the TM2 also with a "on beginsprite" handler

          ---spritescript for TM1--------------------

          on mouseenter me
          member("TM2").text = member("TM3").text

          on mouseleave me
          member("TM2").text = ""



          • 2. Re: Rollover text effect
            rafa@mediatech Level 1
            Hey FabM:
            You can drop this lingo on the member which will be you button. It will only show a quick swap:

            on mouseEnter me

            on mouseLeave me
            sprite(9).member=" CAST_MEMBER_NAME "

            I had a situation which I needed another member to be revealed (just like you) but I needed it to be a smooth fade in/fade out transition. For that I use the following lingo:

            property fadeSprite
            property totalSteps
            property eachStep
            property animateMe

            on getPropertyDescriptionList
            myPropList = [:]
            myPropList.addProp(#totalSteps,[#comment:"select the number of steps for the fade:",#format:#integer,#range:[#min:5,#max:20],#default:10])
            myPropList.addProp(#fadeSprite,[#comment:"enter the sprite to fade:",#format:#integer,#default:1])
            return myPropList

            on beginSprite me
            sprite(fadeSprite).blend = 0
            animateMe = true
            eachStep = 100/totalSteps

            on mouseEnter me
            animateMe = false

            on mouseLeave me
            animateMe = true

            on enterFrame me
            if animateMe then
            if sprite(fadeSprite).blend > 0 then
            sprite(fadeSprite).blend = sprite(fadeSprite).blend - eachStep
            end if
            if sprite(fadeSprite).blend < 100 then
            sprite(fadeSprite).blend = sprite(fadeSprite).blend + eachStep
            end if
            end if

            Place it on the actual button, and the use the "parameters" button on the behavior inspector window to set the desire cast member you want to affect and how smooth you want the transition to be.

            ****the fadeIn/fadeOut lingo was written by Dean Utian.