Formular Input - Wie komme ich an die Eingaben? [Flash 10]
| 02.03.2009, 18:21 | | Beiträge: 3 Registriert: Feb 2009
| Formular Input - Wie komme ich an die Eingaben? Hallo,
ich hätte nicht gedacht, dass ich dazu einen Thread aufmachen muss, aber nach 3 Stunden Suche und keinem Quäntchen Fortschritt bleibt mir wohl nichts anderes übrig.
Im Grunde will ich nur ein InputFeld erstellen und das, was man eingegeben hat, dann abfragen:
ActionScript:1 2 3 4 5 6 7 8 9 | _root.mailFormName = _root.mailForm.createTextField("MailFormName", _root.mailForm.getNextHighestDepth(), 0, 0, 120, 20);
_root.mailFormName.selectable = true;
_root.mailFormName.multiline = false;
_root.mailFormName.type = "input";
_root.mailFormName.text = "Name*";
_root.mailFormName.wordWrap = false;
_root.mailFormName.embedFonts = true;
form_name = _root.mailFormName.text;
_root.mailFormName.setTextFormat(fmt_mailForm);
|
Das wäre zum Beispiel ein solches Textfeld. Die Formatierung funktioniert einwandfrei und man kann auch etwas eingeben. Jetzt drückt man auf einen Knopf und die Funktion checkForm() wird aufgerufen.
ActionScript:1 2 3 4 5 6 7 8 | _root.mailFormButtonSendenPress.onRelease = function(){
checkForm();
}
function checkForm(){
trace(form_name);
}
|
Hier erhalte ich aber nicht den Text, den ich eingegeben habe, sondern immer noch das, was zuvor als Standard-Text eingebeben war. Ich werd mich wahrscheinlich gleich selbst ohrfeigen, weil die antwort so simpel ist. Aber ich bin mal gespanntund natürlich wie immer für jeden Vorschlag sehr dankbar.
Gruß,
Mathias | |
| 02.03.2009, 20:31 | Re2 | Beiträge: 153 Wohnort: Saarbrücken Registriert: Feb 2006
| ich hab's mal umgeschrieben, kannst ja die formatierungen noch erweitern...
ActionScript:1 2 3 4 5 6 7 8 9 10 11 12 13 | _root.mailFormButtonSendenPress.onRelease = function(){
checkForm();
}
function checkForm(){
trace(_root.mailFormName.text);
}
_root.createTextField("mailFormName", this.getNextHighestDepth(), 0, 0, 120, 20);
_root.mailFormName.selectable = true;
_root.mailFormName.multiline = false;
_root.mailFormName.border = true;
_root.mailFormName.type = "input";
_root.mailFormName.text = "";
_root.mailFormName.wordWrap = false;
|
gruss
mist da war einer schneller :-)function foo(); | Geändert von fevzi am 02.03.09 um 20:35 Uhr
| |
|
| | | nicht sichtbar bei eingeloggten Mitgliedern | 
|
| 02.03.2009, 20:45 | Re3 | Beiträge: 989 Wohnort: ..::LAGE::.. Registriert: Apr 2006
| na komm, da setz ich noch einen drauf :)
du kannst auch bei jeder eingabe deinen text auslese...
dazu musst du dem textfeld einen listener anhängen. etwa so:
ActionScript:1 2 3 4 5 6 7 8 | aufpasser = new Object();
aufpasser.onChanged = function( _tf )
{
trace( _tf.text );
}
mailFormName.addListener( aufpasser );
aufpasser.onChanged( mailFormName );
|
vielleicht hilfts dir ja mal weiter
gruß
flowww.heimatdesign.com
Florin Sans - Buy on myFonts / Fontspring | |
| 02.03.2009, 20:47 | Re4 | Beiträge: 3 Registriert: Feb 2009
Themenautor/in
| Ich wusste es, ich würde mich ärgern. Vielen Dank an euch beide, das war das Problem.
Inzwischen habe ich das nächste Problem. Sollte es nicht eigentlich möglich sein, den Inhalt eines Textfeldes an jeder beliebigen Stelle zu ändern?
ActionScript:1 2 3 4 5 6 | _root.mailFormButtonResetPress.onRelease = function(){
_root.mailFormName.text = "Name*";
_root.mailFormMail.text = "E-Mail*";
_root.mailFormBetreff.text = "Betreff*";
_root.mailFormNachricht.text = "Nachricht*";
}
|
Das ganze soll passieren, wenn man den Resetbutton drückt. Tut es aber nicht. Habt ihr eine Idee?
Gruß,
Mathias | |
| | Themen Ähnliche Beiträge zum Thema | 06.05.2010 - stereobrain 19.07.2011 - schlampe 06.04.2011 - Tacco 20.09.2011 - daxs |
|
Flashhilfe.de Flash Platform Tipps & Tutorials Flash Platform Andere Programmiersprachen Jobangebote Diskussionen
Flashhilfe News 
Regeln & Bedingungen
|