1 Reply Latest reply on Oct 22, 2007 6:54 AM by robdillon

    How to swap text members

    ububub
      Hi to all and PLEASE HELP!

      First I'm a total beginner and nonprogrammer.
      I recently started a "must end" project and it's almost finished. But i've got one last problem.

      I want to swap a scrolling text sprite with another scrolling text sprite when user clicks a button.
      But without moving the framehead into another frame. My movie has 7 scrolling texts.

      I'm trying to do it with this primitive method:

      I placed 6 of them out of the stage where no one can see.
      And I inserted these scripts to the button which "swaps" the text sprites (or better to say: relocates them).

      This is the script inserted into the button which shows the sprite textone:

      on mouseUp me
      sprite("textone").locH = 177
      sprite("textone").locV = 460

      sprite("texttwo").locH = -600
      sprite("texttwo").locV = -600

      sprite("textthree").locH = -600
      sprite("textthree").locV = -600

      --note: I wrote the first three. it's actually 7
      end

      And this is the script inserted into the button which shows the sprite texttwo:

      on mouseUp me
      sprite("textone").locH = -600
      sprite("textone").locV = -600

      sprite("texttwo").locH = 177
      sprite("texttwo").locV = 460

      sprite("textthree").locH = -600
      sprite("textthree").locV = -600

      --note: I wrote the first three. it's actually 7
      end

      This script works and changes the positions of my text sprites. AND HERE IS THE PROBLEM:
      After the text sprite positions are changed they don't scroll down or up.
      What is the problem in this case? And I'm sure there are many other ways to swap sprites.
      How do I solve this issue? Sorry for my poor English and thanks for any help.
        • 1. Re: How to swap text members
          robdillon Most Valuable Participant
          Rather than moving sprites around, you might want to just exchange the member of the sprite. You would then use something like this for each of the buttons:

          on mouseUp me
          sprite("textOne").member = member("firstText")
          end

          This way you only need one sprite, you don't need to worry about locations.

          I have no idea why a text member would not scroll after its been moved.