Scrollbar Component


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. var scr = new AS3Scrollbar();
  2. addChildAt(scr,0);
  3.  
  4. var maskBox:MovieClip = new MovieClip();
  5. maskBox.width = 200;
  6. maskBox.height = 200;
  7. maskBox.x = 0;
  8. maskBox.y = 0;
  9. addChild(maskBox);
  10.  
  11. var myTextField:TextField = new TextField();
  12. myTextField.width = 200;
  13. myTextField.autoSize = TextFieldAutoSize.LEFT;
  14. myTextField.wordWrap = true;
  15. myTextField.text = "The quick brown fox jumped over the lazy dog. TThe quick brown fox jumped over the lazy dog. TThe quick brown fox jumped over the lazy dog. TThe quick brown fox jumped over the lazy dog. TThe quick brown fox jumped over the lazy dog. TThe quick brown fox jumped over the lazy dog. TThe quick brown fox jumped over the lazy dog. TThe quick brown fox jumped over the lazy dog. TThe quick brown fox jumped over the lazy dog. TThe quick brown fox jumped over the lazy dog. TThe quick brown fox jumped over the lazy dog. TThe quick brown fox jumped over the lazy dog. TThe quick brown fox jumped over the lazy dog. TThe quick brown fox jumped over the lazy dog. TThe quick brown fox jumped over the lazy dog. TThe quick brown fox jumped over the lazy dog. TThe quick brown fox jumped over the lazy dog. TThe quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog.";
  16.  
  17. var textGroup:MovieClip = new MovieClip();
  18. textGroup.addChild(myTextField);
  19. addChild(textGroup);
  20.  
  21. scr.id = 1;
  22. scr.x = 317;
  23. scr.y = 0;
  24. scr.height = 200;
  25. scr.activeColor = 0x666666;
  26. scr.inactiveColor = 0xFFFFFF;
  27. scr.trackColor = 0xCCCCCC;
  28. scr.autohide = false;
  29. scr.hideOnStart = false;
  30. scr.allowScrollButtons = true;
  31. scr.blurring = true;
  32. scr.ease = "easenone";
  33. scr.scrolltime = 0.25;
  34.  
  35. scr.content = textGroup;
  36. scr.__mask = maskBox;
  37. scr.init();

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.