Zurück   Flashforum > Flash > Stuff

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 27-10-2004, 14:25   #1 (permalink)
nky
Bontempi Punk
 
Benutzerbild von nky
 
Registriert seit: Dec 2001
Ort: Dtld/Pfalz
Beiträge: 4.185
[STUFF]Formular Package

Hi
ich habe mich ein bissel mit dem Gedanken beschäftig einfache Formulare..z.b ein Login oder eine Registrierung mit einem vorgefertigten System zu machen.
Dabei habe ich folgende XML Struktur entwickelt
PHP-Code:
<?xml version="1.0"?>
<formular action="dasScript.php" method="POST">
  <item type="wnk_TextArea"     tabIndex="0"   name="myTextArea1"   x="20"  y="50"   w="530"  h="70"  checkMethod=""          value="LALALA Ein Einführender Text"/>
  <item type="wnk_Label"        tabIndex="0"   name="FirmenLabel"   x="20"  y="130"  w="100"  h="20"  checkMethod=""          value="Firma"                                 />
  <item type="wnk_TextInput"    tabIndex="1"   name="Firma"         x="20"  y="150"  w="250"  h="20"  checkMethod=""          value=""          restriction=""              />
  <item type="wnk_Label"        tabIndex="0"   name="AbtLabel"      x="300" y="130"  w="100"  h="20"  checkMethod=""          value="Abt./Pos."                             />
  <item type="wnk_TextInput"    tabIndex="2"   name="Vorname"       x="300" y="150"  w="250"  h="20"  checkMethod=""          value=""          restriction=""              />
  <item type="wnk_Label"        tabIndex="0"   name="NameLabel"     x="20"  y="180"  w="100"  h="20"  checkMethod=""          value="Name"                                  />
  <item type="wnk_TextInput"    tabIndex="3"   name="Namen"         x="20"  y="200"  w="250"  h="20"  checkMethod="notEmpty"  value=""          restriction=""              />
  <item type="wnk_Label"        tabIndex="0"   name="TelLabel"      x="300" y="180"  w="100"  h="20"  checkMethod=""          value="Tel."                                  />
  <item type="wnk_TextInput"    tabIndex="4"   name="Telefon"       x="300" y="200"  w="250"  h="20"  checkMethod="notEmpty"  value=""          restriction="0-9"           />
  <item type="wnk_Label"        tabIndex="0"   name="StrasseLabel"  x="20"  y="230"  w="100"  h="20"  checkMethod=""          value="Strasse/Nr."                           />
  <item type="wnk_TextInput"    tabIndex="0"   name="Strasse"       x="20"  y="250"  w="250"  h="20"  checkMethod="notEmpty"  value=""          restriction=""              />
  <item type="wnk_Label"        tabIndex="0"   name="FaxLabel"      x="300" y="230"  w="100"  h="20"  checkMethod=""          value="Fax."                                  />
  <item type="wnk_TextInput"    tabIndex="0"   name="Fax"           x="300" y="250"  w="250"  h="20"  checkMethod=""          value=""          restriction="0-9"           />
  <item type="wnk_Label"        tabIndex="0"   name="PLZLabel"      x="20"  y="280"  w="100"  h="20"  checkMethod=""          value="PLZ"                                   />
  <item type="wnk_TextInput"    tabIndex="5"   name="PLZ"           x="20"  y="300"  w="250"  h="20"  checkMethod="groesser5" value=""          restriction="0-9"           />
  <item type="wnk_Label"        tabIndex="0"   name="Klicki"        x="20"  y="340"  w="100"  h="20"  checkMethod=""          value="Klicki"                                />
  <item type="wnk_CheckBox"     tabIndex="6"   name="bla1"          x="80"  y="340"  w="100"  h="25"  checkMethod=""          value="0"                                     />
  <item type="wnk_CheckBox"     tabIndex="7"   name="bla2"          x="100" y="340"  w="100"  h="25"  checkMethod=""          value="1"                                     />
  <item type="wnk_Label"        tabIndex="0"   name="Klicki"        x="20"  y="360"  w="100"  h="20"  checkMethod=""          value="Klicki"                                />
  <item type="wnk_RadioButton"  tabIndex="8"   name="bla3"          x="80"  y="360"  w="100"  h="25"  checkMethod=""          value="0"         group="MyRadioButtonGroup"  />
  <item type="wnk_RadioButton"  tabIndex="9"   name="bla4"          x="100" y="360"  w="100"  h="25"  checkMethod=""          value="1"         group="MyRadioButtonGroup"  />
  <item type="wnk_ComboBox"     tabIndex="0"   name="bla44"         x="100" y="390"  w="100"  h="25"  checkMethod=""          value="hallo"                                 />
  <item type="wnk_SubmitButton" tabIndex="10"  name="SUBMIT"        x="450" y="690"  w="100"  h="25"  checkMethod=""          value="senden"                                />
  <item type="wnk_ErrorOutput"  tabIndex="0"   name="Gewerke"       x="20"  y="700"  w="350"  h="40"  checkMethod=""          value=""          restriction=""              />
</formular>
In dieser Struktur lassen sich also die Formulare definieren....was die einzelnen attribute im xml bedeuten sollte eigentlich selbsterklärend sein wenn man ein bissel basiswissen hat...


So nun das "bauen" in Flash. Flash muss lediglich einen mc haben in dem das Formular gebaut werden soll - und den pfad zum xml...der rest wird in der xml definiert...
es gibt zwei arten zu erstellen - händisch - indem ich dem Form object jedes einzelne Formularitem von Hand zuweise ..also quasi eine zeile in der xml..
oder aber die fortgeschrittenere lösung - welche ich auch hier zeige..
die form durch das xml zu erstellen (wenn ihr addItem benutzt braucht ihr kein xml)

ActionScript:
  1. //Import des Frameworks
  2. import wanky.forms.WankyForm
  3.  
  4. //MC für die Form erstellen
  5. var formMC=this.createEmptyMovieClip("formular",100)
  6.  
  7. //Neue Form erstellen und mc übergeben
  8. var form:wanky.forms.WankyForm = new WankyForm(formMC);  //Der Form muss die Timeline übergeben werden
  9.  
  10. //Form via xml füllen...würde auch manuell mit addItem gehen..
  11.     form.addItemByXML("beispiel.xml")


So damit wird das Formular erstellt...
wie das aussehen kann seht ihr hier
http://www.flashgedanken.de/flashfor...ackage0.1.html

runterladen könnt ihrs hier
http://www.flashgedanken.de/flashfor...Package0.1.zip


Die Combobox funktioniert momentan nochnicht ! Das ist das einzigste was ein bissel blöd ist (aufgrund de populierung der daten) ich kann halt net einfach ein array von xml an flash schicken...da muss ich noch ein bissel bastlen..

der rest sollte fehlerfrei funktionieren...
Wäre net wenn ihr mir ein bissl Beistand leistet was das Codedesign angeht..
was kann man verbessern ? was ist nicht gut ?
Ich bin für alles offen - sogar für Variablennamen *g

Gruss nky
...hofft ihr findet es nützlich
nky ist offline   Mit Zitat antworten
Alt 27-10-2004, 21:37   #2 (permalink)
_//\\#//\\_
 
Benutzerbild von warrantmaster
 
Registriert seit: Jan 2003
Beiträge: 7.060
das hat dich infiziert !

nette idee.

grz
warrantmaster ist offline   Mit Zitat antworten
Alt 27-10-2004, 22:16   #3 (permalink)
Flashaholic
 
Benutzerbild von atothek
 
Registriert seit: Feb 2003
Ort: Berlin
Beiträge: 1.459
als eine andere idee könteste ja auch die xhtml syntax nutzen die ist vielen schon vertraut . Diese kannste dann ja entsprechend erweitern. zB

Code:
<?xml version="1.0"?>
<form action="dasScript.php" method="POST">
	<input type="text" name="inputTxt" tabindex="0" x="50" y="20" w="" h="" value="" />
	<select name="comboBox" tabindex="0" x="" y="" w="" h="">
		<option value="0">Titel1</option>
		<option value="1" selected="selected">Titel2</option>
	</select>
	<textarea name="" tabindex="0" x="" y="" w="" h="">
	</textarea>
</form>
also sich an html orientieren.

mfg
alex
__________________
TVNEXT Solutions
atothek ist offline   Mit Zitat antworten
Alt 27-10-2004, 22:19   #4 (permalink)
nerdig working
 
Benutzerbild von michael
 
Registriert seit: Jul 2001
Ort: Hamburg
Beiträge: 5.832
Zitat:
Zitat von nky
Die Combobox funktioniert momentan nochnicht ! Das ist das einzigste was ein bissel blöd ist (aufgrund de populierung der daten) ich kann halt net einfach ein array von xml an flash schicken...da muss ich noch ein bissel bastlen..
habe mir den code noch nicht zu gemüte geführt, aber die anwendung sieht doch super aus.

zur combobox:
wozu arrays von xml an flash senden wenn xmlknoten in flash wie arrays ansprechbar sind?
du köntest die combobox doch einfach mit childNodes von item realisieren.

also statt:
HTML-Code:
<item type="wnk_ComboBox" tabIndex="0" name="bla44" x="100" y="390"  w="100"  h="25"  checkMethod="" value="hallo" />
sowas wie
HTML-Code:
 <item type="wnk_ComboBox" tabIndex="0" name="bla44" x="100" y="390" w="100" h="25" checkMethod="" value="hallo">
	  <label="tralala" data="lala" />
	  <label="trilili" data="lili" />
	  <label="trululu" data="lulu" />
	  <label="trololo" data="lolo" />
  </item>
ich bin auch kein freund von xml das fast nur aus attributen besteht, das macht immer nur äger wenn irgendwelche sonderzeichen dargestellt werden müssen. da könnte ich mir eine andere strukur vorstellen. mehr verschachtelte koten, weniger attribute, aber das ist wohl geschmackssache.

Edit: die idee von atothek find ich auch ganz prima


gruß
michael

Geändert von michael (27-10-2004 um 22:27 Uhr)
michael ist offline   Mit Zitat antworten
Alt 28-10-2004, 10:53   #5 (permalink)
nky
Bontempi Punk
 
Benutzerbild von nky
 
Registriert seit: Dec 2001
Ort: Dtld/Pfalz
Beiträge: 4.185
Hi ihr alle danke für die rege Anteilnahme

@ Warrant *g So isses - extremer CMS Junky *g
@atothek geniale Idee ! Wer ich umbauen !
@gutknut Auch super Idee mit der Combo ! Werd ich ebenfalls einbauen (halt in xhtml style)

Hier mal ein Entwurf
findet Ihrs Ok von der Struktur ? Viel lesbarer isses net geworden - dafür kürzer und konformer..

PHP-Code:
<?xml version="1.0"?>
<form action="dasScript.php" method="POST">

  <input type="text" name="input" tabindex="0" checkMethod="" x="50" y="20" w="" h="" value=""/>

  <input type="checkBox" name="checkBox" tabindex="0" checkMethod="" x="50" y="20" w="" h="" value="true"/>

  <input type="radioButton" name="radioButton" tabindex="0" checkMethod="" x="50" y="20" w="" h="" value="true"/>

  <select name="comboBox" tabindex="0" x="" y="" w="" h="" checkMethod="">
    <option value="0">Titel1</option>
    <option value="1" selected="selected">Titel2</option>
  </select>

  <input type="label" name="label" x="50" y="20" w="" h="" value=""/>

  <textarea name="" tabindex="0" x="" y="" w="" h="">
    Das ist der Text in der Textarea
  </textarea>

  <input type="submit" name="submitButton" x="50" y="20" w="" h="" value="true"/>
  <input type="errorOutput" name="errormsg" x="50" y="20" w="" h="" value="true"/>
</form>
nky 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 18:29 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele