//**************************************************************************** // AS2 EXEMPLE //**************************************************************************** // 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); //apply stylesheet var flash_css = new TextField.StyleSheet(); flash_css.load("http://rad2.free.fr/ccm/Essais/Bureau/styles.css"); flash_css.onLoad = function(success:Boolean) { if (success) { my_txt.styleSheet = flash_css; } else { trace("Could not load CSS file."); } }; function loadMyText(evt) { var loadit_lv:LoadVars = new LoadVars(); loadit_lv.load("http://rad2.free.fr/ccm/Essais/Bureau/text.txt"); loadit_lv.onLoad = function(success:Boolean) { if (success) { my_txt.condenseWhite = true; my_txt.htmlText = this.content; } else { trace("Could not load text file."); } }; } loadMyText();