3 Replies Latest reply on Jun 22, 2006 3:32 AM by Tristamane

    Help with if statements...

    Tristamane
      I'm currently controlling text on a page with custom buttons that scroll the text up or down depending on what button they hover over. This is the lingo I have on one of the buttons:

      on mousewithin me
      sprite(1).locV = sprite(1).locV + 3
      end

      I'd like to add an if statement to the code to keep the text from continuing to scroll once the locV of the text reaches a certain value. I've tried to add the code, but I keep having problems with the syntax. Any help on this would be greatly appreciated.
        • 1. Re: Help with if statements...
          Level 7
          This will make sprite(1) move downwards as long as it is currently less
          than or equal to 100.

          on mousewithin me
          if sprite(1).locV<=100 then
          sprite(1).locV = sprite(1).locV + 3
          end if
          end
          • 2. Re: Help with if statements...
            Level 7
            But it will allow the sprite to go to 101 or 102 depending on the starting
            position. What you need if you want it to not go past 100, as an example,
            is to limit the movement.

            > on mousewithin me
            > if sprite(1).locV<=100 then
            > sprite(1).locV = min (100, sprite(1).locV + 3)
            > end if
            > end
            --
            Craig Wollman
            Word of Mouth Productions

            phone 212 928 9581
            fax 212 928 9582
            159-00 Riverside Drive West #5H-70
            NY, NY 10032
            www.wordofmouthpros.com


            "Mike Blaustein" <mblaustein@gmail.com> wrote in message
            news:e776ko$498$1@forums.macromedia.com...
            > This will make sprite(1) move downwards as long as it is currently less
            > than or equal to 100.
            >
            > on mousewithin me
            > if sprite(1).locV<=100 then
            > sprite(1).locV = sprite(1).locV + 3
            > end if
            > end


            • 3. Re: Help with if statements...
              Tristamane Level 1
              Thanks guys. Worked like a charm. Thanks again.