|
-
I can make the scroll bar component work fine if the data is in the text field when the movie is initialized, but if i put the data in the text field after the movie is initialized, and the text field was empty when it was initialized, the scrollbar component does not allow any scrolling. The slider and up and down arrows don't work? Am i missing something?
-
click on the scrollBar, look in the properties window and make sure that the Target Text Field is set.
or
use this script:
myScrollBar.setScrollTarget(myTextBox);
to make the scrollbar sit at the bottom of the text box use this in a clip event like enter frame.
myScrollBar.setScrollPosition(myTextBox.maxscroll) ;
-
Or you can just drag the scrollbar onto the text field and it will snap into place.
-
but you must have the 'snap' function on and even then it still doesnt work somtimes
-
here is the problem.. I really really can make the component scroll bar work when the data is in the text field IF THE DATA IS IN THE FIELD from the start!
The problem is when i have dynamically added data to the field.
For example, i have a scrollbar component linked to a BLANK text field, and everytime i click a button, i want to ADD information into the text field. As i add data and the text field begins to overflow the text field, the scrolling doesn't start working.
After looking at the code, it seems, ( i could be wrong) that the scrolling decisions are made, when the component is initiallized, therefore, if the text is not in the box when it is initiallized, it thinks there is nothing to scoll.
-
maybe try setting them using an onClipEvent(enterFrame) handler?
-
Originally posted by jamesbooth97
here is the problem.. I really really can make the component scroll bar work when the data is in the text field IF THE DATA IS IN THE FIELD from the start!
The problem is when i have dynamically added data to the field.
For example, i have a scrollbar component linked to a BLANK text field, and everytime i click a button, i want to ADD information into the text field. As i add data and the text field begins to overflow the text field, the scrolling doesn't start working.
After looking at the code, it seems, ( i could be wrong) that the scrolling decisions are made, when the component is initiallized, therefore, if the text is not in the box when it is initiallized, it thinks there is nothing to scoll.
Did you find a solution to the Dynamic text problem? If so, I'd be interested in knowing what it turned out to be!
Thanks.
-
ok, looks like you have to call this method:
scrollBar.setScrollProperties(5, 0, 15);
look under Flash UI Components in the Reference for more info on this. But you must set the (5, 0,15) to whatever you need.
that will get the scrollbar working, if you have added text to it after it was initiallized.
If there is an easier way, someone let me know..
-
Well, I found an easier way.. all you have to do is put the information into the instance names property.
for example with myinstancename being the instance name of the text field and "text" being a property of the dynamic text field)
myinstancename.text = "blah blah blah what ever you want"
that will activate the scroll bars in the component (if there is enough data to require scrolling).
the incorrect way to do it is the way we used to do it in flash 5, by sticking the info directly into the variable.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|