[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

Scrolling Problem

Okay, here is the issue :

I have a text field that loads in an external text file that will be changed daily. I also have two buttons (one for scrolling down and one for scrolling up) .. now all i am doing now is doing text.scroll + 1 to scroll down and - 1 to scroll up.

the problem is, that if you hold down the button, it does not keep scrolling, u have to push it multiple times.

how do i do a continous loop to keep it scrolling down (And not zoom down, with a nice speed to it)

If someone mentions the word "tween" i will have experts exchange give ME money from you!! :) this is NOT static text, it is read in from a file...


okay, i await your expertise...
0
messiah
Asked:
messiah
  • 2
1 Solution
 
nobiusCommented:
Q.10262516 for Messiah


Hi!

I am not to familiar with using FLASH in a dynamic fashion as it appears you are doing but I think this will work.

1st)  I would make an "empty" movie clip that had nothing in it but frame actions. In the 1st frame of this movie, you would have an action that had a tell target statement that referenced your outer movie (the movie with the up & down buttons in it).  Inside that tell target statement you would have another action that said to "text.scroll + 1".  After that, end your tell target.  I would include samples, but I am not sure where you got the "text.scroll + 1" from.  I Assume it is moving your textbox up or down 1 pixel.  Regardless, if you can tell it to do that from the movie you are working with now, you should be able to tell it to do that from a "sub-movie" using the tell target statement.

Next add a number of frames equal to the amount of time you want it to "pause" before moving the text again.  In the last frame you would have a loop statement to loop the movie back to the beginning:
 
Go to and Play (1)

The reason you make it loop, is so that until it is explicitly told to stop it will repeat the action in the 1st frame, which creates  your scrolling effect w/o clicking.  You would make one movie like this for scrolling the text up and another for scrolling down.  That was the hard part. You could probably use one movie for both actions and pass it a variable or something to determine up or down, but that is more complicated.

2nd) Drag an instance of your empty "UP" & "DOWN" movies into the main movie with the up and down buttons.  Name the instances of those movies accordingly as "UPmovie" & "DOWNmovie" Now add an action to the "Up" button that says:

On (Press)
      Begin Tell Target ("UPmovie")
            Go to and Play (1)
      End Tell Target
End On

After that you should make add another action to the button that says:

On (Release, Drag Out, Release Outside)
      Begin Tell Target ("UPmovie")
            Stop
      End Tell Target
End On



Do the same thing for the "DOWN" movie.

By doing this you have set the button to play a looping movie that moves your text up.  So the movie is going to continue playing (and moving your text) until you release the button or drag the mouse off the button.  This will leave you with a small but fixable problem.  If the person using the button is "stupid" they may hold it down for 10min!  This means with the previous code you have the text scrolling beyond the user's view.  To fix this, you can add a check before you move the text.  You can do an "If"statement that says if text.scroll is <= "Y" then move the text.  Where "Y" is some value that you pre-specify.  Possibly set "Y" equal to the "height" of the textbox?  You would do the just the opposite for the other direction: If text.scroll >= "Y".

Anyway, I hope this helps.  I used a similar solution to determine whether or not menus in a navigation bar were exteneded or not and if they were extended, then to close them.  If you wanna e-mail me: jumand@hotmail.com
0
 
nobiusCommented:
Did you try this? Did it work for you?
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now