Hello everyone. I have a little problem which I will try to explain as best as I can.
I downloaded a nice scroll bar from this site http://www.flashscaper.com/blog/?p=3.
And here I have some code for loading external text files into text fields:
var textContainer:Sprite = new Sprite();
textContainer.x = 30;
textContainer.y = 150;
addChild(textContainer);
var tContent:TextField = new TextField();
tContent.width = 350;
tContent.height = 220;
tContent.wordWrap = true;
tContent.autoSize =TextFieldAutoSize.LEFT;
textContainer.addChild(tContent);
var cssLoader:URLLoader = new URLLoader();
var cssRequest:URLRequest = new URLRequest("myCSS.css");
cssLoader.addEventListener(Event.COMPLETE, cssLoaded);
cssLoader.load(cssRequest);
function cssLoaded(evt:Event):void{
var css:StyleSheet = new StyleSheet();
css.parseCSS(URLLoader(evt.target).data);
tContent.styleSheet = css;
}
var welcomeLoader:URLLoader = new URLLoader();
var welcomeRequest:URLRequest = new URLRequest("my.txt");
welcomeLoader.dataFormat = URLLoaderDataFormat.TEXT;
welcomeLoader.addEventListener(Event.COMPLETE, welcomeLoaded);
welcomeLoader.load(welcomeRequest);
function welcomeLoaded(evt:Event):void {
tContent.text = welcomeLoader.data;
}
What I want to do is load an external text file that uses that scrollbar, but that scrollbar is made to be used on a movie clip so that images can go along with text.
The only actionscript that goes inside the scrollbar’s fla file is:
sb.init(txt_mc, "easeOutBack",2,true,2);
sb is the instance name for the scrollbar and txt_mc is the instance name of the movie clip in which the text goes.
I have been playing for a long while with this until I got pretty frustrated.
Hopefully someone could help me.