Create a new fla file and name it ScrollbarExample.fla. Place the fla in the same folder as the biz folder. Add the folder from the McScrollBar_vert.fla file in the library of your fla. Then create an Actionscript file, name it ScrollbarExample.as and place this script.
package
{
import biz.flashscript.components.textarea.scrollBar.McScrollBar_vert;
import flash.display.Sprite;
import flash.text.TextField;
public class ScrollbarExample extends Sprite
{
public function ScrollbarExample ()
{
var textHolder:Sprite = new Sprite ();
textHolder.x = 50;
textHolder.y = 50;
addChild (textHolder);
var scrollHolder:Sprite = new Sprite();
textHolder.addChild (scrollHolder);
var myText:TextField = new TextField ();
myText.autoSize = "left";
myText.width = 195;
myText.border = true;
myText.borderColor = 0x666666;
myText.background = true;
myText.backgroundColor = 0xF1F5F9;
myText.multiline = true;
myText.wordWrap = true;
myText.htmlText = 'Yesterday I got a letter from my aunt Mary. At least the return address said so. But I was suspicious because one has to be careful with letters, Bioterrorism, you know? I looked at the letter from all sides. Yeah, there it was, a bulge, most probably powder: ANTHRAX! My God, I was frightened. I put the letter down immediately and washed my hands and rushed to get latex gloves. Horrible thoughts went through my mind about the bugs in the letter and how they are multiplying in my bloodstream, Yuk. Should I call 911 or better the FBI? Who else knew my aunts address? But most important of all, why and why me? Who hated me so much to send me a letter with deadly bacteria? Actually I am a popular guy. Yeah, thats it. Somebody is jealous about my popularity, somebody with a microbiology background or a connection to foreign terrorists. I dont know any more, I dont know. Stay calm, just stay calm. I took the letter very carefully and put it in a plastic bag. Then I drove to a nearby river and.....got rid of it, haaaa. (Cell phone rings.) Hello, aunt Mary.....for my birthday.....200 bucks in cash!';
scrollHolder.addChild (myText);
var textCover:MyMask = new MyMask();
textCover.width = 200;
textCover.height = 100;
textCover.visible = false;
textHolder.addChild (textCover);
scrollHolder.mask = textCover;
var myBar:BarShell = new BarShell();
myBar.x = textCover.x + textCover.width;
myBar.y = textCover.y;
myBar.width = 10;
myBar.height = textCover.height;
myBar.visible = false;
textHolder.addChild (myBar);
var scBar:McScrollBar_vert = new McScrollBar_vert();
scBar.visible = false;
textHolder.addChild (scBar);
var myScrollerBar:ScrollerBar = new ScrollerBar();
scBar.addChild (myScrollerBar);
scBar.arrangeStage (scrollHolder, textCover, myBar, myScrollerBar);
}
}
}
|