Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 25-02-2004, 10:39   #1 (permalink)
web-info.it
 
Benutzerbild von topolina
 
Registriert seit: Jul 2001
Ort: verona - italy
Beiträge: 254
createTextfield in for-Schleife

Hallo an Alle,
dieses Script sollte eigentlich ein Menu (horizontal) erzeugen. Aber es wird nur der letzte Text (text5) angezeigt und zwar auf der 1. Position (10).

Was hab' ich falsch gemacht?

larghezza = 130;
FirstxPos = 10;
for (i = 0; i < menu.length; i++) {
if (i != 0) {
xPos = (FirstxPos + larghezza)*i;
} else {
xPos = FirstxPos;
}
_root.createTextField("mytext",i,xPos,3,130,20);
mytext.multiline = false;
mytext.wordWrap = false;
mytext.border = true;

myformat = new TextFormat();
myformat.color = 0xFFFFFF;
myformat.font = "Verdana";
myformat.size = 12;
myformat.bold = true;
if (i != menu.length-1) {
abteiler = " | ";
} else {
abteiler = "";
}
mytext.text = "text" + i + abteiler;
mytext.setTextFormat(myformat);
trace (mytext.text + " - " + xPos + " - " + i);
}
__________________
:)
topolina ist offline   Mit Zitat antworten
Alt 25-02-2004, 10:43   #2 (permalink)
Steffen G.
 
Benutzerbild von Tschdaeff
 
Registriert seit: Aug 2001
Ort: Ba-Wü
Beiträge: 4.123
ActionScript:
  1. larghezza = 130;
  2. FirstxPos = 10;
  3. for (i = 0; i < menu.length; i++) {
  4. if (i != 0) {
  5. xPos = (FirstxPos + larghezza)*i;
  6. } else {
  7. xPos = FirstxPos;
  8. }
  9. _root.createTextField("mytext"+i,i,xPos,3,130,20);
  10. _root["mytext"+i].multiline = false;
  11. _root["mytext"+i].wordWrap = false;
  12. _root["mytext"+i].border = true;
  13.  
  14. myformat = new TextFormat();
  15. myformat.color = 0xFFFFFF;
  16. myformat.font = "Verdana";
  17. myformat.size = 12;
  18. myformat.bold = true;
  19. if (i != menu.length-1) {
  20. abteiler = " | ";
  21. } else {
  22. abteiler = "";
  23. }
  24. _root["mytext"+i].text = "text" + i + abteiler;
  25. _root["mytext"+i].setNewTextFormat(myformat);
  26. trace (_root["mytext"+i].text + " - " + xPos + " - " + i);
  27. }


ich hab dir auch gleich setNewTextformat gemacht


cu mfg
Tschdaeff
__________________
mod@
www.flashbattle.de
www.steffen-guse.de
------------------------------------

Tschdaeff ist offline   Mit Zitat antworten
Alt 25-02-2004, 11:09   #3 (permalink)
web-info.it
 
Benutzerbild von topolina
 
Registriert seit: Jul 2001
Ort: verona - italy
Beiträge: 254
dankeschoen, Tschdaeff,
jetzt klappt's!!!

ciao - Topolina
__________________
:)
topolina 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 01:57 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele