11. september 2001 - 22:43Der er
9 kommentarer og 1 løsning
loading external text (and extending its textbox)
im loading text with loadVariables into a text box and in order to properly use my fine and dandy scroll bar, I need the text box to expand if loaded text is bigger than the original text box. the textbox expands if I just cut and paste text into a predefined text box, but not if I load it in from a text document. any ideas?
Once your text has loaded, you\'ll have to check the maxScroll property to see by how many lines your text exceeds the visible text. The purpose of your scrollbar should be just that.
scrollUp/down actions could be as simple as
on (press) { if (textField.scroll < textField.maxscroll) { textField.scroll++; } }
or
on (press) { if (textField.scroll > textField.maxscroll) { textField.scroll--; } } To Control the layout of the dynamic text you can include forced line breaks. Inserting the \\n or newline keyword in the external string controls the exact location of your line breaks.
eg. \"DynamicTextVar = this is\\na test\" displays the string as
The dimensions of the Dynamic Text Field does not expand automatically to accomodate more lines in the Player, as this only happens in the authoring mode. That is also why we should include scrollbuttons and scrollbar functions if the number of lines change dynamically.
i didn\\t want to expand the text field, i just wanted to be able to see all the text that was loaded into it when i scrolled. until i understood the maxscroll function i could only scroll through as much text as would fit in my text box, then for example 20 lines loaded into a 10 line text box would scroll, but would only reveal 10 of the 20 lines cutting off my paragraph half way. thanks for your help.
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.