//##########################################################
//XML
text_xml = new XML();
text_xml.ignoreWhite = true;
text_xml.load("text.xml");
text_xml.onLoad = function(status) {
if (status) {
xmltext = "Alternativtext<br><br><br><br><br><br><br><br>Alternativtext<br><br><br><br><br><br><br><br>Alternativtext<br><br><br><br><br><br><br><br>Alternativtext<br><br><br><br><br><br><br><br>Alternativtext<br><br><br><br><br><br><br><br>Alternativtext<br><br><br><br><br><br><br><br>Alternativtext<br><br><br><br><br><br><br><br>Alternativtext<br><br><br><br><br><br><br><br>Alternativtext<br><br><br><br><br><br><br><br>Alternativtext<br><br><br><br><br><br><br><br>Alternativtext<br><br><br><br><br><br><br><br>Alternativtext<br><br><br><br><br><br><br><br>Alternativtext<br><br><br><br><br><br><br><br>Alternativtext<br><br><br><br><br><br><br><br>Alternativtext<br><br><br><br><br><br><br><br>"//text_xml.firstChild.firstChild.nodeValue;
delete text_xml;
textcontent();
}
};
// Variablen zur Textformatierung
var textcolor = 0x333333;
var font = "Verdana";
var fontsize = 20;
var align = "left";
//##########################################################
//##########################################################
// VARIABLEN
//
// Positionierung der Elemente
// position des gesamten elements
var main_xpos = 20;
var main_ypos = 20;
// position der contentbox innerhalb des hauptelements
var content_xpos = 0;
var content_ypos = 0;
// eigenschaften der contentbox --> sollten >= der eigenschaften des textfeldes sein
var contentwidth = 200;
var contentheight = 3300;
// textfeldeigenschaften innerhalb der contentbox
var textwidth = 200;
var textheight = 3300;
// x-position des scrollers
var scroller_xpos = contentwidth;
// eigenschaften der bounding-box
var boundbox_height = 450;
var boundbox_width = contentwidth;
// eigenschaften der buttons
var btn_width = 15;
var btn_height = 15;
var btn_up_ypos = 0;
var btn_down_ypos = boundbox_height-btn_height;
var btn_color = 0xFFFFFF;
var btn_transparency = 100;
var btn_borderthickness = 0;
var btn_bordercolor = 0x000000;
var btn_bordertransparency = 100;
// eigenschaften des draggers
var dragger_width = 15;
var scroller_size_factor = 2.833;
var dragger_height = Math.round((boundbox_height-(btn_height*2))/scroller_size_factor);
var dragger_ypos = content_xpos+btn_height;
var dragger_color = 0xFFFFFF;
var dragger_transparency = 100;
var dragger_borderthickness = 0;
var dragger_bordercolor = 0x000000;
var dragger_bordertransparency = 100;
// eigenschaften der scrollbar
var bar_width = 15;
var bar_height = boundbox_height;
var bar_ypos = 0;
var bar_color = 0xCCCCCC;
var bar_transparency = 50;
var bar_borderthickness = 0;
var bar_bordercolor = 0x777777;
var bar_bordertransparency = 50;
//
// Scroll Speed 1-15
var scroll_speed = 5;
var path = this;
//##########################################################
//##########################################################
// Erstelle Container
path.createEmptyMovieClip("container", 1000);
with (path.container) {
_x = main_xpos;
_y = main_ypos;
}
path.container.createEmptyMovieClip("boundbox", 1001);
with (path.container.boundbox) {
_width = boundbox_height;
_height = boundbox_height;
_x = 0;
_y = 0;
}
path.container.createEmptyMovieClip("mask_mc", 1004);
with (path.container.mask_mc) {
beginFill(0xff0000, bar_transparency);
moveTo(content_xpos, content_ypos);
lineTo(content_xpos+boundbox_width, content_ypos);
lineTo(content_xpos+boundbox_width, content_ypos+boundbox_height);
lineTo(content_xpos, content_ypos+boundbox_height);
lineTo(content_xpos, content_ypos);
}
path.container.createEmptyMovieClip("contentbox", 1002);
with (path.container.contentbox) {
_x = content_xpos;
_y = content_ypos;
setMask(path.container.mask_mc);
}
//##########################################################
// erstelle Textfeld für den Inhalt
function textcontent() {
path.container.contentbox.createTextField("textfield", 1003, 0, 0, textwidth, textheight);
textproperties = new TextFormat();
textproperties.color = textcolor;
textproperties.font = font;
textproperties.size = fontsize;
textproperties.align = textausrichtung_kb;
with (path.container.contentbox.textfield) {
autosize = "center";
border = true;
multiline = true;
wordWrap = true;
html = true;
embedFonts = false;
htmlText = xmltext;
setTextFormat(textproperties);
}
}
// zeichne Bar
path.container.createEmptyMovieClip("bar", 1010);
path.container.bar.createEmptyMovieClip("bar_border", 1011);
with (path.container.bar) {
beginFill(bar_color, bar_transparency);
moveTo(bar_xpos, bar_ypos);
lineTo(bar_xpos+bar_width, bar_ypos);
lineTo(bar_xpos+bar_width, bar_ypos+bar_height);
lineTo(bar_xpos, bar_ypos+bar_height);
lineTo(bar_xpos, bar_ypos);
endFill;
}
with (path.container.bar.bar_border) {
lineStyle(bar_borderthickness, bar_bordercolor, bar_bordertransparency);
moveTo(scroller_xpos, bar_ypos);
lineTo(scroller_xpos+bar_width, bar_ypos);
lineTo(scroller_xpos+bar_width, bar_ypos+bar_height);
lineTo(scroller_xpos, bar_ypos+bar_height);
lineTo(scroller_xpos, bar_ypos);
}
// zeichne Griff
path.container.createEmptyMovieClip("dragger", 1012);
path.container.dragger.createEmptyMovieClip("dragger_border", 1013);
with (path.container.dragger) {
beginFill(dragger_color, dragger_transparency);
moveTo(scroller_xpos, dragger_ypos);
lineTo(scroller_xpos+dragger_width, dragger_ypos);
lineTo(scroller_xpos+dragger_width, dragger_ypos+dragger_height);
lineTo(scroller_xpos, dragger_ypos+dragger_height);
lineTo(scroller_xpos, dragger_ypos);
endFill;
}
with (path.container.dragger.dragger_border) {
lineStyle(dragger_borderthickness, dragger_bordercolor, dragger_bordertransparency);
moveTo(scroller_xpos, dragger_ypos);
lineTo(scroller_xpos+dragger_width, dragger_ypos);
lineTo(scroller_xpos+dragger_width, dragger_ypos+dragger_height);
lineTo(scroller_xpos, dragger_ypos+dragger_height);
lineTo(scroller_xpos, dragger_ypos);
}
// zeichne Schalter "UP"
path.container.createEmptyMovieClip("btn_up", 1014);
path.container.btn_up.createEmptyMovieClip("btn_up_border", 1015);
with (path.container.btn_up) {
beginFill(btn_color, btn_transparency);
moveTo(scroller_xpos, btn_up_ypos);
lineTo(scroller_xpos+btn_width, btn_up_ypos);
lineTo(scroller_xpos+btn_width, btn_up_ypos+btn_height);
lineTo(scroller_xpos, btn_up_ypos+btn_height);
lineTo(scroller_xpos, btn_up_ypos);
endFill;
}
with (path.container.btn_up.btn_up_border) {
lineStyle(btn_borderthickness, btn_bordercolor, btn_bordertransparency);
moveTo(scroller_xpos+btn_borderthickness, btn_up_ypos+btn_borderthickness);
lineTo(scroller_xpos+btn_width-(btn_borderthickness*2), btn_up_ypos+btn_borderthickness);
lineTo(scroller_xpos+btn_width-(btn_borderthickness*2), btn_up_ypos+btn_height-(btn_borderthickness*2));
lineTo(scroller_xpos+btn_borderthickness, btn_up_ypos+btn_height-(btn_borderthickness*2));
lineTo(scroller_xpos+btn_borderthickness, btn_up_ypos+btn_borderthickness);
}
// zeichne Schalter "DOWN"
path.container.createEmptyMovieClip("btn_down", 1016);
path.container.btn_down.createEmptyMovieClip("btn_down_border", 1017);
with (path.container.btn_down) {
beginFill(btn_color, btn_transparency);
moveTo(scroller_xpos, btn_down_ypos);
lineTo(scroller_xpos+btn_width, btn_down_ypos);
lineTo(scroller_xpos+btn_width, btn_down_ypos+btn_height);
lineTo(scroller_xpos, btn_down_ypos+btn_height);
lineTo(scroller_xpos, btn_down_ypos);
endFill;
}
with (path.container.btn_down.btn_down_border) {
lineStyle(btn_borderthickness, btn_bordercolor, btn_bordertransparency);
moveTo(scroller_xpos+btn_borderthickness, btn_down_ypos+btn_borderthickness);
lineTo(scroller_xpos+btn_width-(btn_borderthickness*2), btn_down_ypos+btn_borderthickness);
lineTo(scroller_xpos+btn_width-(btn_borderthickness*2), btn_down_ypos+btn_height-(btn_borderthickness*2));
lineTo(scroller_xpos+btn_borderthickness, btn_down_ypos+btn_height-(btn_borderthickness*2));
lineTo(scroller_xpos+btn_borderthickness, btn_down_ypos+btn_borderthickness);
}
//##########################################################
//##########################################################
// Technik --> Scrollbar
_root.onLoad = function() {
difference_y = boundbox_height-path.container.btn_up._height-path.container.btn_down._height;
border_top = content_ypos;
bottom = content_ypos+boundbox_height-(path.container.dragger._height+path.container.btn_up._height+path.container.btn_down._height);
};
function scrollbar() {
var scrollmax = boundbox_height-dragger_height-2*btn_height;
path.container.contentbox._y = -(path.container.dragger._y/scrollmax)*(contentheight-boundbox_height);
}