Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 11-05-2009, 15:02   #1 (permalink)
live and experie
 
Benutzerbild von anjoflo
 
Registriert seit: Feb 2004
Ort: Heilsbronn / Bayern
Beiträge: 188
boolschen Wert von PHP zu Flash

Hi,

ich habe auf der Bühne mehrere Moviclips --> mc1, mc2, mc3, ...
und möchte von PHP aus die mc's entweder sichtbar oder unsichtbar machen.

Kann ich einen boolschen Wert "true" oder "false" übertragen ?

So wie unten funktioniert es leider nicht:

php:

PHP-Code:
$mc_f "false";
$mc_t "true";
echo 
"&mc1=".$mc_f."&"// unsichtbar
echo "&mc2=".$mc_t."&"// sichtbar
echo "&mc3=".$mc_f."&"// unsichtbar
echo "&mc3=".$mc_t."&"// sichtbar 

flash:

PHP-Code:
var daten = new LoadVars();
daten.sendAndLoad("datei.php?action=write&r="+random(999), daten"POST");
daten.onLoad = function(success) {
   if (
success) {
    
mc1._visible this.mc1;
    
mc2._visible this.mc2;
    
mc3._visible this.mc3;
    
mc4._visible this.mc4;
  };
}; 
Auch wenn ich im php-script bei true und false die Gänsefüsschen wegmache gehts nicht.

Wer weis mehr ?

Danke
anjoflo ist offline   Mit Zitat antworten
Alt 11-05-2009, 15:05   #2 (permalink)
Flashworker
 
Benutzerbild von sebastian
 
Registriert seit: Nov 2001
Ort: Wiesbaden
Beiträge: 10.945
ActionScript:
  1. mc1._visible = this.mc1 == "true";

gruß
sebastian ist offline   Mit Zitat antworten
Alt 11-05-2009, 15:09   #3 (permalink)
live and experie
 
Benutzerbild von anjoflo
 
Registriert seit: Feb 2004
Ort: Heilsbronn / Bayern
Beiträge: 188
Zitat:
Zitat von sebastian Beitrag anzeigen
ActionScript:
  1. mc1._visible = this.mc1 == "true";

gruß
Was passiert, wenn ein "false" übertragen wird ?

Kann es leider momentan nicht ausprobieren...
anjoflo ist offline   Mit Zitat antworten
Alt 11-05-2009, 15:12   #4 (permalink)
Flashworker
 
Benutzerbild von sebastian
 
Registriert seit: Nov 2001
Ort: Wiesbaden
Beiträge: 10.945
Alles außer "true" ergibt dann false.
sebastian ist offline   Mit Zitat antworten
Alt 11-05-2009, 15:17   #5 (permalink)
live and experie
 
Benutzerbild von anjoflo
 
Registriert seit: Feb 2004
Ort: Heilsbronn / Bayern
Beiträge: 188
Zitat:
Zitat von sebastian Beitrag anzeigen
Alles außer "true" ergibt dann false.
D.h. ich brauche "false" gar nicht übertragen, da die Variable leer und alles andere als "true" ist ?

In meinem Fall:

PHP-Code:
$mc_t "true";
echo 
"&mc2=".$mc_t."&"// sichtbar
echo "&mc3=".$mc_t."&"// sichtbar 
anjoflo ist offline   Mit Zitat antworten
Alt 11-05-2009, 15:20   #6 (permalink)
Flashworker
 
Benutzerbild von sebastian
 
Registriert seit: Nov 2001
Ort: Wiesbaden
Beiträge: 10.945
Theoretisch in dem Fall nicht. Würde es dennoch aus Gründen der
Nachvollziehbarkeit machen.
sebastian ist offline   Mit Zitat antworten
Alt 11-05-2009, 15:24   #7 (permalink)
live and experie
 
Benutzerbild von anjoflo
 
Registriert seit: Feb 2004
Ort: Heilsbronn / Bayern
Beiträge: 188
Vielen Dank, werd es dann heute abend mal testen ;-)

Gruß Jochen
anjoflo ist offline   Mit Zitat antworten
Alt 11-05-2009, 15:37   #8 (permalink)
live and experie
 
Benutzerbild von anjoflo
 
Registriert seit: Feb 2004
Ort: Heilsbronn / Bayern
Beiträge: 188
Habe da gleich noch ne Kleinigkeit:

Worum es in diesem script geht, ist eine Pinnwand mit 21 Zetteln, deren Inhalt ich austausche (Gästebuch --> Gästepinnwand)

Link Button --> Gästebuch
Ich spreche von php mit einer for-schleife alle txt's und mc's auf meiner Bühne an.
Aber ich bekomme die for-Schleife in Flash nicht gebacken.
Momentan verarbeite ich jedes txt-Feld sowie MC:

ActionScript:
  1. var daten = new LoadVars();
  2. daten.f0001 = "a01";
  3. daten.f0002 = seite;
  4. daten.sendAndLoad("datei.php?action=write&r="+random(999), daten, "POST");
  5. daten.onLoad = function(success) {
  6.     if (success) {
  7.         gb_back.loadMovie(this.gb_back);
  8.         weiter = this.weiter;
  9.         if (weiter>=20) {
  10.             bt_weiter._visible = true;
  11.         } else {
  12.             bt_weiter._visible = false;
  13.         }
  14.         mc1._visible = this.mc1 == "true";
  15.         txt1a.text = this.txt1a;
  16.         txt1b.text = this.txt1b;
  17.         txt1c.text = this.txt1c;
  18.         mc2._visible = this.mc2 == "true";
  19.         txt2a.text = this.txt2a;
  20.         txt2b.text = this.txt2b;
  21.         txt2c.text = this.txt2c;
  22.         mc3._visible = this.mc3 == "true";
  23.         txt3a.text = this.txt3a;
  24.         txt3b.text = this.txt3b;
  25.         txt3c.text = this.txt3c;
  26.         mc4._visible = this.mc4 == "true";
  27.         txt4a.text = this.txt4a;
  28.         txt4b.text = this.txt4b;
  29.         txt4c.text = this.txt4c;
  30.         mc5._visible = this.mc5 == "true";
  31.         txt5a.text = this.txt5a;
  32.         txt5b.text = this.txt5b;
  33.         txt5c.text = this.txt5c;
  34.         mc6._visible = this.mc6 == "true";
  35.         txt6a.text = this.txt6a;
  36.         txt6b.text = this.txt6b;
  37.         txt6c.text = this.txt6c;
  38.         mc7._visible = this.mc7 == "true";
  39.         txt7a.text = this.txt7a;
  40.         txt7b.text = this.txt7b;
  41.         txt7c.text = this.txt7c;
  42.         mc8._visible = this.mc8 == "true";
  43.         txt8a.text = this.txt8a;
  44.         txt8b.text = this.txt8b;
  45.         txt8c.text = this.txt8c;
  46.         mc9._visible = this.mc9 == "true";
  47.         txt9a.text = this.txt9a;
  48.         txt9b.text = this.txt9b;
  49.         txt9c.text = this.txt9c;
  50.         mc10._visible = this.mc10 == "true";
  51.         txt10a.text = this.txt10a;
  52.         txt10b.text = this.txt10b;
  53.         txt10c.text = this.txt10c;
  54.         mc11._visible = this.mc11 == "true";
  55.         txt11a.text = this.txt11a;
  56.         txt11b.text = this.txt11b;
  57.         txt11c.text = this.txt11c;
  58.         mc12._visible = this.mc12 == "true";
  59.         txt12a.text = this.txt12a;
  60.         txt12b.text = this.txt12b;
  61.         txt12c.text = this.txt12c;
  62.         mc13._visible = this.mc13 == "true";
  63.         txt13a.text = this.txt13a;
  64.         txt13b.text = this.txt13b;
  65.         txt13c.text = this.txt13c;
  66.         mc14._visible = this.mc14 == "true";
  67.         txt14a.text = this.txt14a;
  68.         txt14b.text = this.txt14b;
  69.         txt14c.text = this.txt14c;
  70.         mc15._visible = this.mc15 == "true";
  71.         txt15a.text = this.txt15a;
  72.         txt15b.text = this.txt15b;
  73.         txt15c.text = this.txt15c;
  74.         mc16._visible = this.mc16 == "true";
  75.         txt16a.text = this.txt16a;
  76.         txt16b.text = this.txt16b;
  77.         txt16c.text = this.txt16c;
  78.         mc17._visible = this.mc17 == "true";
  79.         txt17a.text = this.txt17a;
  80.         txt17b.text = this.txt17b;
  81.         txt17c.text = this.txt17c;
  82.         mc18._visible = this.mc18 == "true";
  83.         txt18a.text = this.txt18a;
  84.         txt18b.text = this.txt18b;
  85.         txt18c.text = this.txt18c;
  86.         mc19._visible = this.mc19 == "true";
  87.         txt19a.text = this.txt19a;
  88.         txt19b.text = this.txt19b;
  89.         txt19c.text = this.txt19c;
  90.         mc20._visible = this.mc20 == "true";
  91.         txt20a.text = this.txt20a;
  92.         txt20b.text = this.txt20b;
  93.         txt20c.text = this.txt20c;
  94.         mc21._visible = this.mc21 == "true";
  95.         txt21a.text = this.txt21a;
  96.         txt21b.text = this.txt21b;
  97.         txt21c.text = this.txt21c;
  98.     }
  99. };

Das geht doch auch einfacher, oder?
anjoflo 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 21:36 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele