Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 24-08-2005, 12:10   #1 (permalink)
Neuer User
 
Registriert seit: Oct 2003
Beiträge: 22
problem mit flash und php

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:
  1. stop();
  2. meinFormat = new TextFormat();
  3. meinFormat.font = "Tahoma";
  4. meinFormat.color = 0xFFFFFF;
  5. meinFormat.size = 10;
  6. meinLoadVars = new LoadVars();
  7. meinLoadVars.load("inhalte.php?was=test&lang="+_root.lang);
  8. meinLoadVars.onLoad = function(success) {
  9.     if (success) {
  10.         for (i=1; i<=3; i++) {
  11.             //movieclips erstellen
  12.             _root.createEmptyMovieClip("test"+i, 1+i);
  13.             _root["test"+i].attachMovie("area_1", "test_content_"+i, 1);
  14.             _root["test"+i]._x = 30;
  15.             _root["test"+i]._y = 190+i*30;
  16.             //textfeld
  17.             _root["test"+i]["test_content_"+i].createTextField("meinText", 0, 12, 1, 200, 20);
  18.             _root["test"+i]["test_content_"+i].meinText.autoSize = true;
  19.             _root["test"+i]["test_content_"+i].meinText.selectable = false;
  20.             if (_root.meinLoadVars["txt_test"+i].length>="11") {
  21.                 _root["test"+i]["test_content_"+i].mitte._width = (_root.meinLoadVars["txt_test"+i].length)*5.7;
  22.                 _root.laenge = _root["test"+i]["test_content_"+i].mitte._width;
  23.                 _root["test"+i]["test_content_"+i].rechts._x = _root["test"+i]["test_content_"+i].mitte._width;
  24.             }
  25.             _root["test"+i]["test_content_"+i].meinText.setNewTextFormat(meinFormat);
  26.             _root["test"+i]["test_content_"+i].meinText.text = _root.meinLoadVars["txt_test"+i];
  27.             //button funktionen
  28.             _root["test"+i]["test_content_"+i].mitte.onPress = function() {
  29.                 this._parent._parent.startDrag(false, 10, 160, 660, 560);
  30.             };
  31.             _root["test"+i]["test_content_"+i].mitte.onRelease = _root["test"+i]["test_content_"+i].mitte.onReleaseOutside=function () {
  32.                 this._parent._parent.stopDrag();
  33.                 if (this._parent._parent.hitTest(_root.space)) {
  34.                     _root["wo_test"+i] = 1;
  35.                     _root.anzeiger.text = _root["wo_test"+i];
  36.                 } else {
  37.                     _root["wo_test"+i] = 0;
  38.                     _root.anzeiger.text = _root["wo_test"+i];
  39.                 }
  40.             };
  41.             _root["test"+i]["test_content_"+i].rechts.onRelease = function() {
  42.                 this._parent._parent.removeMovieClip();
  43.             };
  44. //ab hier gehts nicht, der text aus der DB wird nicht angezeigt
  45.             _root["test"+i]["test_content_"+i].links.onRelease = function() {
  46.                 if (_root["wo_test"+i] == 1) {
  47.                     _root.infotext.text = _root.meinLoadVars["info_test"+i];
  48.                 }
  49.             };
  50.  
  51.         }
  52.     }
  53. };

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
sebas ist offline   Mit Zitat antworten
Alt 24-08-2005, 12:30   #2 (permalink)
zimmer 101
 
Benutzerbild von ricobeck
 
Registriert seit: Jul 2003
Ort: LE
Beiträge: 1.581
Zitat:
Zitat von sebas
PHP-Code:
    echo utf8_encode("&txt_test$i={$row[$titel]}&info_test$i={$row[$info]}&"); 
und wenn du das ampersand voranstellst?
__________________
Illogical comparison with NaN. Any comparison operation involving NaN will evaluate to false because NaN != NaN.
ricobeck.de
ricobeck ist offline   Mit Zitat antworten
Alt 24-08-2005, 12:38   #3 (permalink)
Neuer User
 
Registriert seit: Oct 2003
Beiträge: 22
geht leider nicht, aber danke
sebas ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an



Alle Zeitangaben in WEZ +1. Es ist jetzt 04:24 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele