Quantunet.com

My Account

Joins Us
Flash 8 Actionscript 2.0 QuickSkills

Load External Text With A Scroll Bar

 

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.
 

Note: Make sure the variable name of the dynamic text field matches the variable in the external .txt file.

© 2007 Quantunet LLC All Rights Reserved | Intellectual Property | Terms of Use | Privacy
Home | About Quantunet | FAQ's | Contact Us