so, nun mal erst das php:
verbindung steht zur DB:
PHP-Code:
if($db){
$dbconnect = mysql_select_db($database);
if($dbconnect){
if($was==test){
$i = 1;
$query = mysql_query("SELECT * FROM test");
while($row = mysql_fetch_array($query)){
$titel="titel_".strval($lang);
$info="info_".strval($lang);
echo utf8_encode("txt_test$i={$row[$titel]}&info_test$i={$row[$info]}&");
$i++;
}
}
}
}
nun actionscript:
ActionScript:
stop();
meinFormat = new TextFormat();
meinFormat.font = "Tahoma";
meinFormat.color = 0xFFFFFF;
meinFormat.size = 10;
meinLoadVars = new LoadVars();
meinLoadVars.load("inhalte.php?was=test&lang="+_root.lang);
meinLoadVars.onLoad = function(success) {
if (success) {
for (i=1; i<=3; i++) {
//movieclips erstellen
_root.createEmptyMovieClip("test"+i, 1+i);
_root["test"+i].attachMovie("area_1", "test_content_"+i, 1);
_root["test"+i]._x = 30;
_root["test"+i]._y = 190+i*30;
//textfeld
_root["test"+i]["test_content_"+i].createTextField("meinText", 0, 12, 1, 200, 20);
_root["test"+i]["test_content_"+i].meinText.autoSize = true;
_root["test"+i]["test_content_"+i].meinText.selectable = false;
if (_root.meinLoadVars["txt_test"+i].length>="11") {
_root["test"+i]["test_content_"+i].mitte._width = (_root.meinLoadVars["txt_test"+i].length)*5.7;
_root.laenge = _root["test"+i]["test_content_"+i].mitte._width;
_root["test"+i]["test_content_"+i].rechts._x = _root["test"+i]["test_content_"+i].mitte._width;
}
_root["test"+i]["test_content_"+i].meinText.setNewTextFormat(meinFormat);
_root["test"+i]["test_content_"+i].meinText.text = _root.meinLoadVars["txt_test"+i];
//button funktionen
_root["test"+i]["test_content_"+i].mitte.onPress = function() {
this._parent._parent.startDrag(false, 10, 160, 660, 560);
};
_root["test"+i]["test_content_"+i].mitte.onRelease = _root["test"+i]["test_content_"+i].mitte.onReleaseOutside=function () {
this._parent._parent.stopDrag();
if (this._parent._parent.hitTest(_root.space)) {
_root["wo_test"+i] = 1;
_root.anzeiger.text = _root["wo_test"+i];
} else {
_root["wo_test"+i] = 0;
_root.anzeiger.text = _root["wo_test"+i];
}
};
_root["test"+i]["test_content_"+i].rechts.onRelease = function() {
this._parent._parent.removeMovieClip();
};
//ab hier gehts nicht, der text aus der DB wird nicht angezeigt
_root["test"+i]["test_content_"+i].links.onRelease = function() {
if (_root["wo_test"+i] == 1) {
_root.infotext.text = _root.meinLoadVars["info_test"+i];
}
};
}
}
};
so das war der quellcode, das problem besteht darin, das das texfeld infotext nicht den text anzeigt, den die DB liefert.
die anderen texte aus der DB werden aber angezeigt (_root.meinLoadVars["txt_test"+i]

.
sebastian