How to load
external text into a dynamic text field with a
scroll bar:
- Create a new dynamic
text field on the stage.
- In the properties panel:
- Set the instance name of the
dynamic text field to "my_dynamic_text".
- Set the variable name to "content".
- Then in the "actionscript"
layer select the first frame on
the timeline.
- Open the actionscript
panel and enter the following actionscript.
myData = new LoadVars();
myData.onLaod = function(success){
if (success){
my_dynamic_text.text = this.content;
}
else{
trace("Error loading external content");
}
}
myData.load("my_content_2.txt");
- Then In the components panel
- Expand the "User Interface"
category.
- Select the "UIScrollBarr".
- Drag and drop the scroll
bar UI component over the dynamic
text field.
- Then in the main menu go to
Control > Test Movie.
|