Hmm...
Nochmal alles überprüfen.
Die Textbox in der Hauptzeitleiste zeigt den Wert der Variable tickertext an, ist das richtig?
Wie sieht dieser Wert aus? Irgendwelche Sonderzeichen, die Actionscript Probleme machen könnten? Oder ist es ein Strang mehrerer Variablen, die von Flash automatisch geparst werden und dadurch in anderen Variabeln gespeichert werden (Beispiel: value1=bla&value2=babl; dann müßtest Du value1 abfragen, statt tickertext)?
Wenn Du in deinem MC eine Textbox manuell statt per AS erstellst mit der Variable _root.tickertext wird dann ebenfalls nichts angezeigt?
Vielleicht muß mein Beispiel auch nur angepasst werden:
_root.watch("tickertext",setmytickertext);
function setmytickertext(prop,oldval,newval,userData){
newstext.htmlText =newval;
newstext2.htmlText = newval;
_root.unwatch("tickertext");
}
Hast Du schon versucht text statt htmlText zu verwenden?
Nurmal um alle Fehler auszuschliessen.
Werden die Textfelder vielleicht außerhalb der Bühne generiert und sind gar nicht zu sehen? Siehst Du die Textfelder, wenn Du newstext.htmlText = "Testing, testing, 1, 2, testing" verwendest?
Ja saugeil! Funktioniert!!!!
Jetzt gibt es nur noch ein Problem zu lösen.
Wie formatiere ich nun den Text?
Gruss flo
Welche Lösung hat denn Funktioniert?
Wenn Du noch weiterhin dynamische Textfelder mit htmlText verwendest mußt Du zum formatieren nur textformat definieren.
Im Beispielscript erhalten ja die Textfelder die Zuweisung
newstext.setTextFormat(textformat);
newstext2.setTextFormat(textformat);
textformat muß aber vorher erstmal definiert werden.
Ungefähr so:
textformat= new TextFormat();
textformat.bold=true;
textformat.font="Verdana";
textformat.color=0xFF0000;
textformat.align="center";
[etc. ... ]
Danke für deine tolle und kompetente Hilfe.
Ich verstehe deinen Ansatz, jedoch ändert sich das Erscheinungsbild noch nicht.
hmm
gruss
Komisch...
Wie sieht denn jetzt das vollständige Skript auf diesem Frame aus?
_root.watch("tickertext",setmytickertext);
function setmytickertext(prop,oldval,newval,userData){
newstext.htmlText = newval;
newstext2.htmlText = newval;
_root.unwatch("tickertext");
}
System.useCodepage=true;
news = tickertext;
geschwindigkeit = 1;
x = 0;
y = 50;
tiefe = 1;
createTextField("newstext", tiefe, x, y, 200, 20);
newstext.html = true;
newstext.selectable = false;
newstext.htmlText = news;
newstext.autoSize = "left";
createTextField("newstext2", tiefe+1, x, y, 200, 20);
newstext2.html = true;
newstext2.selectable = false;
newstext2.htmlText = news;
newstext2.autoSize = "left";
textformat=new TextFormat();
textformat.bold=true;
textformat.font="Verdana";
textformat.color=0x666666;
newstext.setTextFormat(textformat);
newstext2.setTextFormat(textformat);
newstext2._x = newstext._width;
onEnterFrame = function() {
newstext._x -= geschwindigkeit;
newstext2._x -= geschwindigkeit;
if(newstext2._x <= x) {
newstext._x = x;
newstext2._x = newstext._width + x;
}
}
[/url]
_root.watch("tickertext",setmytickertext);
function setmytickertext(prop,oldval,newval,userData){
newstext.htmlText = newval;
newstext2.htmlText = newval;
_root.unwatch("tickertext");
textformat=new TextFormat();
textformat.bold=true;
textformat.font="Verdana";
textformat.color=0x666666;
newstext.setTextFormat(textformat);
newstext2.setTextFormat(textformat);
}
System.useCodepage=true;
news = tickertext;
geschwindigkeit = 1;
x = 0;
y = 50;
tiefe = 1;
createTextField("newstext", tiefe, x, y, 200, 20);
newstext.html = true;
newstext.selectable = false;
newstext.htmlText = news;
newstext.autoSize = "left";
createTextField("newstext2", tiefe+1, x, y, 200, 20);
newstext2.html = true;
newstext2.selectable = false;
newstext2.htmlText = news;
newstext2.autoSize = "left";
newstext2._x = newstext._width;
onEnterFrame = function() {
newstext._x -= geschwindigkeit;
newstext2._x -= geschwindigkeit;
if(newstext2._x <= x) {
newstext._x = x;
newstext2._x = newstext._width + x;
}
}
Versuch das mal. Meine Vermutung ist, dass die Formatierung wieder gelöscht wird, wenn dem Textfeld per htmlText=... ein neuer Inhalt zugewiesen wird.
So, jetzt mach ich aber erst mal Feierabend.
Hoffe es funktioniert jetzt.
Bumm. Funktionert.
Vielen Vielen Dank.
PErfekt!
ICh werde nachher noch das fertige Script dann posten
ffranke schrieb
ICh werde nachher noch das fertige Script dann posten
wäre toll, wenn das noch kommen würde! 🙂
Ei loggisch:
Flash, 1 Frame:
myVars = new LoadVars();
myVars.onLoad = function () {
text = this.meine_var; //hier werden die PHP -variablen deinen Textfeldern, oder was auch immer zugewiesen.
}
myVars.load("abfrage.php");
MovieClip Ticker (mit dank an Flashhilfe.de) Actionscript
_root.watch("text",setmynewtext);
function setnewtext(prop,oldval,newval,userData){
newstext.htmlText = newval;
newstext2.htmlText = newval;
_root.unwatch("text");
textformat=new TextFormat();
textformat.bold=false;
textformat.size=10;
textformat.font="Verdana";
textformat.color=0x666666;
newstext.setTextFormat(textformat);
newstext2.setTextFormat(textformat);
}
System.useCodepage=true;
news = text;
geschwindigkeit = 1;
x = 0;
y = 50;
tiefe = 1;
createTextField("newstext", tiefe, x, y, 200, 20);
newstext.html = true;
newstext.selectable = false;
newstext.htmlText = news;
newstext.autoSize = "left";
createTextField("newstext2", tiefe+1, x, y, 200, 20);
newstext2.html = true;
newstext2.selectable = false;
newstext2.htmlText = news;
newstext2.autoSize = "left";
newstext2._x = newstext._width;
onEnterFrame = function() {
newstext._x -= geschwindigkeit;
newstext2._x -= geschwindigkeit;
if(newstext2._x <= x) {
newstext._x = x;
newstext2._x = newstext._width + x;
}
}
PHP Datei im Stammverzeichnis von Typo3:
<?php
include('connecttodatabase.php');
$abfrage_meinevar = "SELECT bodytext FROM tt_content WHERE uid=99";
$meine_var = mysql_fetch_array(mysql_query($abfrage_meinevar));
echo $meine_var['bodytext'];
?>
Die entsprechende UID findet ihr mit dem PhpMyAdmin im Backend raus.
Viele Grüße
Florian