I used the following sample script provided by macromedia to create a scrolling
text area powered from a text file and css file, but when I move on to another
part of the FLA., the scroll bars generated by this script remain - on top of
other layers. How can I tell the scroll bars to go away?
//****************************************************************************
//Copyright (C) 2005 Macromedia, Inc. All Rights Reserved.
//The following is Sample Code and is subject to all restrictions on
//such code as contained in the End User License Agreement accompanying
//this product.
//****************************************************************************
//Handle the UIScrollBar - instance in library
this.createClassObject(mx.controls.UIScrollBar, "my_sb", 20);
// Set the target text field for the scroll bar.
my_sb.setScrollTarget(my_txt);
// Size it to match the text field.
my_sb.setSize(16, my_txt._height);
// Move it next to the text field.
my_sb.move(my_txt._x + my_txt._width, my_txt._y);
//Note: Download the TXT and CSS files to look at their structure. Use the
URLs below.
//load text
function loadMyText(evt) {
var loadit_lv:LoadVars = new LoadVars();
loadit_lv.load("projects.txt");
loadit_lv.onLoad = function(success:Boolean) {
if (success) {
my_txt.text = this.content;
} else {
trace("Could not load text file.");
}
};
}
loadMyText();
//apply stylesheet
var flash_css = new TextField.StyleSheet();
flash_css.load("levi.css");
flash_css.onLoad = function(success:Boolean) {
if (success) {
my_txt.styleSheet = flash_css;
} else {
trace("Could not load CSS file.");
}
};