This chapter will show you how to create horizontal or vertical text, text fields that bring in text from an external document, make text scroll, and create text fields where someone can enter information themselves.
This sample is taken from Chapter 12: "Working with Text" of the glasshaus title "Flash MX H.O.T"
4. Scrollable Dynamic Text Fields
In the previous two exercises, you have been
working with Dynamic Text fields. This exercise will take the project file
one step further: You will learn to make the Dynamic Text scroll.
1. You should still have the dynamicText.fla file open from
the last exercise.
12_04_01
2. Select the Dynamic Text field on the Stage. In the Property
Inspector, type learnText in the Instance Name box. This
will assign the instance name learnText to the Dynamic Text field.
12_04_02
3. On the Main Timeline, lock
the holder layer and click the Insert Layer button to add
a new layer. Rename the layer buttons. Position the buttons layer
below the actions layer.
12_04_03
4. Open the Library (F11) and notice that it contains
two Buttons: btnDown and btnUp. Drag an instance of each Button
onto the Stage. Position the btnDown Button under the btnUp
Button, as in the picture above.
5. Select the btnUp Button on the Stage and press F9
to open the Actions panel.
12_04_04
6. In the Actions panel Toolbox, choose Objects > Movie
> TextField > Properties. Double-click on the scroll property
to add it to the Script pane.
12_04_05
7. In the Expression box, place your cursor before .scroll
and type the instance name of the Dynamic Text field: learnText. After
the word scroll, type += 1. The expression should now read learnText.scroll
+= 1. This tells Macromedia Flash MX that, when a user clicks on the Up
Button, it should take the learnText instance (the Dynamic Text field) and
scroll it up 1 line.
8.
Select the btnDown Button on the Stage
and press F9 to open the Actions panel. Choose Objects
> Movie > TextField > Properties and double-click on the scroll
property to add it to the Script pane.
12_04_06
9. In the Expression box, place your cursor before .scroll
and type learnText. After the word scroll, this time type
-= 1. The expression should now read learnText.scroll -=
1. This will tell Macromedia Flash MX that, when a user clicks on the
Down Button, it should take the learnText instance (the Dynamic Text field)
and scroll it down 1 line.
12_04_07
10. Choose Control > Test Movie to try out your new scroll buttons!
DMXzoneGeorge Petrov is a renowned software writer and developer whose extensive skills brought numerous extensions, articles and knowledge to the DMXzone- the online community for professional Adobe Dreamweaver users. The most popular for its over high-quality Dreamweaver extensions and templates.
George is also the founder of Wappler.io - the most Advanced Web & App Builder
See All Postings From George Petrov >>
Comments
asdf
great!!
Perfect to start working with text.
It was so helpful to me.
But I get and error in the username/password example. If somebody can give a hand i will very greatful.
It seems everthing is ok, but it doesn't verify the password , whatever I write I go always to frame 10 (pass) and never reach the frame 20 (fail). :-) thank you
nice tutorial...but...
Multiline Text
Indeed, this is very useful information. I apologize if this is not the correct forum for asking questions. But I have the same problem as Stefaan. How do you keep a mulitline text box from starting a new line with a space character? It's very annoying besides ugly. Thanks.
You must me logged in to write a comment.