Halli Hallo zusammen,
mal wieder ein kleines Problem. Alles in dieser Funktion macht er, nur das scrollen will er mal wieder nicht machen. Er erzeugt den Bar, den Scroller, alles, aber es läßt sich dann nicht scrollen, bzw. versteckt er den Scroller nicht, wenn er nicht scrollen soll. Und ich blicks grad net mehr.
Danke schon mal dafür. Hier nun der Code und wie die XML aufgebaut ist:
Code:
PHP-Code:
// Text Funktion
function doText(xmlText:String) {
trace("Mache Text");
main.txt.removeMovieClip();
var about:XML = new XML();
about.ignoreWhite = true;
about.load(xmlText);
about.onLoad = function () {
// if(success) {
var note:Array = about.firstChild.childNodes;
for (j=0; j<note.length; j++) {
trace (note[j].attributes.texting);
main.createEmptyMovieClip("txt", 6);
main.txt.createTextField("starttxt"+j, j, note[j].attributes.x, note[j].attributes.y, note[j].attributes.width, note[j].attributes.height);
main.txt["starttxt"+j].styleSheet = ss;
main.txt["starttxt"+j].html = true;
main.txt["starttxt"+j].wordWrap = true;
main.txt["starttxt"+j].multiline = true;
main.txt["starttxt"+j].label.condenseWhite = true;
main.txt.attachMovie("scroller_hg", "bar", 1);
main.txt.bar._x = 433;
main.txt.bar._y = 45;
// main.txt.bar._alpha = 100;
main.txt.createEmptyMovieClip("scrolling"+j, j+2);
main.txt["scrolling"+j].createEmptyMovieClip("hoehe",0);
with(main.txt["scrolling"+j].hoehe) {
moveTo (0,0);
beginFill(0x000000,0);
lineTo (0,240);
lineTo (10.6,240);
lineTo (10.6,0);
endFill();
}
main.txt["scrolling"+j].hoehe._x = 433;
main.txt["scrolling"+j].hoehe._y = 56;
main.txt["scrolling"+j].attachMovie("scroller", "scroller", 1);
main.txt["scrolling"+j].scroller._x = 433;
main.txt["scrolling"+j].scroller._y = 56;
oben = main.txt["scrolling"+j].hoehe._y;
bhoehe = main.txt["scrolling"+j].hoehe._height;
khoehe = main.txt["scrolling"+j].scroller._height;
unten = (oben+bhoehe)-khoehe;
main.txt["starttxt"+j].text = note[j].attributes.texting;
trace (main.txt["starttxt"+j].length);
trace (note[j].attributes.of);
trace (oben);
trace (bhoehe);
trace (khoehe);
trace (unten);
/* }
else {
main.txt["starttxt"+j].htmlText = "<body>Text konnte nicht geladen werden</body>";
}*/
main.txt["scrolling"+j].scroller.onPress = function (){
startDrag(this, false, 433, oben, 433, unten);
}
main.txt["scrolling"+j].scroller.onRelease = function () {
this.stopDrag();
}
main.txt["scrolling"+j].scroller.onReleaseOutside = function () {
this.stopDrag();
}
main.txt["scrolling"+j].scroller.onEnterFrame = function () {
trace ("onEnter");
if(main.txt["starttxt"+j].length < note[j].attributes.of){
main.txt["scrolling"+j]._visible = false;
main.txt.bar._visible = false;
}
else{
main.txt["scrolling"+j]._visible = true;
main.txt.bar._visible = true;
main.txt["starttxt"+j].scroll = Math.round(((main.txt["scrolling"+j].scroller._y-oben)/(bhoehe-khoehe))*main.txt["starttxt"+j].maxscroll);
}
}
}
}
}
XML:
PHP-Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<texte>
<wort x='35.4' y='-167.2' width='370' height='420' of='641' texting='<span class="body"><span class="headline"><b>Ästhetische Zahnheilkunde</b></span><br /><br />Zähne sind wie eine persönliche Visitenkarte.</span>' />
</texte>