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

    Rollover text effect

    FabM
      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.

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

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

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

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

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

          ------------------------------------------------

          regards
          wolfgang

          • 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
            sprite(9).member="CAST_MEMBER_NAME"
            sprite(29).loch=-280

            on mouseLeave me
            sprite(9).member=" CAST_MEMBER_NAME "
            sprite(29).loch=-280
            end

            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
            end


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


            on mouseEnter me
            animateMe = false
            end


            on mouseLeave me
            animateMe = true
            end


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

            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.