Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 17-10-2003, 12:34   #1 (permalink)
idi
Neuer User
 
Benutzerbild von idi
 
Registriert seit: Jun 2003
Ort: Bitburg
Beiträge: 89
Unhappy create TextField und variable höhe

hallo,

ich brauche hilfe im bezug auf create Textfield! Und zwar: wie stelle ich es an das mein textfled eine feste breite hat und nur in der höhe variable ist?

bin grad doch etwas am verzweifeln, da nix funzt was ich probiere! hier mein script:

ActionScript:
  1. for (i=0; i<10; i++) {
  2.    
  3.     a1 = "1_das hier ist ein test";
  4.     a2 = "2_djsksdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdxcvxcvxcvxcvxcvxcvxcvxcvxcvxcvxc";
  5.     a3 = "3_asdasddasdasxcvxcvxcvxcvxcvxcvx";
  6.     a4 = "4_asd";
  7.     b=_root["a"+x];
  8.     x<5 ? x++ : x=1;
  9.    
  10.    
  11.         _root.createTextField(["feld"+i], i, 10, i*50, 100, 50);
  12.         _root["feld"+i].text =b;
  13.         _root["feld"+i].border =true;
  14.         //_root["feld"+i]._width =200;
  15.         _root["feld"+i].multiline =true;
  16.         _root["feld"+i].autoSize =true;
  17. }
  18. ;

vielen dank schonmal!
__________________
werbefuchs

Geändert von idi (17-10-2003 um 12:59 Uhr)
idi ist offline   Mit Zitat antworten
Alt 17-10-2003, 13:05   #2 (permalink)
[Ernst Reiter]
 
Benutzerbild von Scrawer
 
Registriert seit: Jul 2001
Ort: austria
Beiträge: 3.691
autoSize = "left";
dann bleibt die breite fix.. und die höhe ändert sich je nach text menge

wordWrap = true; müsstest auch noch setzen!
__________________
Das Gesetz des Lebens liegt im Notwendigen. Der Reiz des Lebens liegt im Überflüssigen
m.f.g Scrawer (www.thinkspace.at)
Scrawer ist offline   Mit Zitat antworten
Alt 17-10-2003, 13:37   #3 (permalink)
idi
Neuer User
 
Benutzerbild von idi
 
Registriert seit: Jun 2003
Ort: Bitburg
Beiträge: 89
@scrawer,

vielen vielen dank, es hat geklappt!

Kann mir jetzt vielleicht noch jemand eine Anregung geben wie ich es hinbekomme, das er mir die textfelder nicht in einem festen abstand untereinander anordnet, sonder in etwa so:

y-coordinate

höhetextfeld1 +50 = ansatz texfeld2
höhetextfeld1 +50 +höhetextfeld1 +50= ansatz texfeld3
etc.???

Bin nicht "die programmiererin" brauch wohl ne schleife dafür, aber wie ich die baue????????????????????
__________________
werbefuchs
idi ist offline   Mit Zitat antworten
Alt 17-10-2003, 13:42   #4 (permalink)
Neuer User
 
Registriert seit: Jun 2001
Ort: Stuttgart
Beiträge: 6.415
(i)*(hoehe+abstand)+yGesamtVerschiebung

deluxe
Deluxe ist offline   Mit Zitat antworten
Alt 17-10-2003, 17:58   #5 (permalink)
idi
Neuer User
 
Benutzerbild von idi
 
Registriert seit: Jun 2003
Ort: Bitburg
Beiträge: 89
sorry, steh etwas auf´m schlauch - hoehe und abstand versteh ich, aber was ist y?

und wie stell ich es an die hoehe von den feldern rauszukriegen? weil die haben ja dann unterschiedliche höhe...

???
__________________
werbefuchs
idi ist offline   Mit Zitat antworten
Alt 17-10-2003, 18:06   #6 (permalink)
Revived @ Sunday
 
Benutzerbild von MacEvil
 
Registriert seit: Apr 2003
Ort: Nowhereland
Beiträge: 3.244
Die Y-Achse
MacEvil ist offline   Mit Zitat antworten
Alt 17-10-2003, 18:12   #7 (permalink)
idi
Neuer User
 
Benutzerbild von idi
 
Registriert seit: Jun 2003
Ort: Bitburg
Beiträge: 89
ah, ok, habs grad gesehn, aber trotzdem noch meine frage wie ich die höhe der einzelnen textfeldern rauskriege??? hier mal mein aktuelles script!

ActionScript:
  1. for (i=0; i<5; i++) {
  2.    
  3.     a1 = "1_das hier ist ein test";
  4.     a2 = "2_djsksdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdxcvxcvxcvxcvxcvxcvxcvxcvxcvxcvxc";
  5.     a3 = "3_asdasddasdasxcvxcvxcvxcvxcvxcvx";
  6.     a4 = "4_asd";
  7.     b=_root["a"+x];
  8.     x<5 ? x++ : x=1;
  9.    
  10.    
  11.         _root.createTextField(["feld"+i], i, 10, (i)*(h+50)+10, 200, 50);
  12.         _root["feld"+i].text =b;
  13.         _root["feld"+i].border =true;
  14.         _root["feld"+i]._height=h;
  15.         _root["feld"+i].multiline =true;
  16.         _root["feld"+i].autoSize ="left";
  17.         _root["feld"+i].wordWrap =true;
  18.        
  19. }
  20. ;

so wie ich´s mir gedacht hatte (siehe script) gehts jedenfalls nicht... :-(
__________________
werbefuchs
idi ist offline   Mit Zitat antworten
Alt 17-10-2003, 18:20   #8 (permalink)
Revived @ Sunday
 
Benutzerbild von MacEvil
 
Registriert seit: Apr 2003
Ort: Nowhereland
Beiträge: 3.244
ActionScript:
  1. trace(textfield._height);
MacEvil ist offline   Mit Zitat antworten
Alt 17-10-2003, 18:29   #9 (permalink)
idi
Neuer User
 
Benutzerbild von idi
 
Registriert seit: Jun 2003
Ort: Bitburg
Beiträge: 89
will nicht nerven, aber ich bin noch as-anfänger und kann damit jetzt nix anfangen :-(

das soll mir helfen die hoehen rasuzukriegen? muß ich net irgendwie ne schleife machen damit er mir die koordinate für das jeweils nächste textfeld errechnen kann?

weil um das dritte textfeld anzusetzen brauch ich ja theoretisch
höhe textfeld1 + 50 + höhe textfeld2 +50
und so weiter....

sorry, nochmal, aber ich hab keine ahnung wie das zu realisieren ist :-(

nadine
__________________
werbefuchs
idi ist offline   Mit Zitat antworten
Alt 17-10-2003, 18:36   #10 (permalink)
Revived @ Sunday
 
Benutzerbild von MacEvil
 
Registriert seit: Apr 2003
Ort: Nowhereland
Beiträge: 3.244
ActionScript:
  1. for (i=0; i<5; i++) {
  2.        
  3.         a1 = "1_das hier ist ein test";
  4.         a2 = " 2_djsksdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsd
  5.         fsdxcvxcvxcvxcvxcvxcvxcvxcvxcvxcvxc";
  6.         a3 = "3_asdasddasdasxcvxcvxcvxcvxcvxcvx";
  7.         a4 = "4_asd";
  8.         b=_root["a"+x];
  9.         x<5 ? x++ : x=1;
  10.        
  11.        
  12.         _root.createTextField(["feld"+i], i, 10, (i)*(h+50)+10, 200, 50);
  13.         _root["feld"+i].text =b;
  14.         _root["feld"+i].border =true;
  15.         _root["feld"+i]._height=h;
  16.         _root["feld"+i].multiline =true;
  17.         _root["feld"+i].autoSize ="left";
  18.         _root["feld"+i].wordWrap =true;
  19. if (i == 1) {
  20. _root["feld"+i]._height = 50;
  21. }else {
  22.          _root["feld"+i]._height = _root["feld"+i-1]._height+50;
  23. }
  24. };
MacEvil ist offline   Mit Zitat antworten
Alt 17-10-2003, 18:49   #11 (permalink)
idi
Neuer User
 
Benutzerbild von idi
 
Registriert seit: Jun 2003
Ort: Bitburg
Beiträge: 89
@MacEvil

vielen vielen dank das du mir helfen willst, aber...

boah, wahrscheinlich geh ich dir tierisch auf die nüsse.....

hast du das getestet? bei mir gehts nämlich nicht :-(

nadine
__________________
werbefuchs
idi ist offline   Mit Zitat antworten
Alt 17-10-2003, 18:52   #12 (permalink)
Revived @ Sunday
 
Benutzerbild von MacEvil
 
Registriert seit: Apr 2003
Ort: Nowhereland
Beiträge: 3.244
Nein, teste meine Skripts nie.
Wenn du if(i == 0) schreibst sollte es eigentlich gehen..
MacEvil ist offline   Mit Zitat antworten
Alt 17-10-2003, 18:56   #13 (permalink)
idi
Neuer User
 
Benutzerbild von idi
 
Registriert seit: Jun 2003
Ort: Bitburg
Beiträge: 89
hmm, ne leider nicht :-(

muß die zeile

ActionScript:
  1. _root["feld"+i]._height=h;

eigentlich drin bleiben wenn ich das script so ergänze wie du gesagt hast???

und ist die zeile korrekt???

ActionScript:
  1. _root.createTextField(["feld"+i], i, 10, (i)*(h+50)+10, 200, 50);
__________________
werbefuchs
idi ist offline   Mit Zitat antworten
Alt 17-10-2003, 18:57   #14 (permalink)
HAY
Neuer User
 
Benutzerbild von HAY
 
Registriert seit: Aug 2002
Ort: Faust-Stadt
Beiträge: 2.577
hi
eher so.
ActionScript:
  1. h=50
  2. for (i=0; i<5; i++) {
  3.          a1 = "1_das hier ist ein test";
  4.         a2 = "  2_djsksdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfsdxcvxcvxcvxcvxcvxcvxcvxcvxcvxcvxc";
  5.         a3 = "3_asdasddasdasxcvxcvxcvxcvxcvxcvx";
  6.         a4 = "4_asd";
  7.         b=_root["a"+x];
  8.         x<5 ? x++ : x=1;
  9.          _root.createTextField(["feld"+i], i, 0,0,200, 0);
  10.         _root["feld"+i].text =b;
  11.         _root["feld"+i].border =true;
  12.         _root["feld"+i]._height=h;
  13.         _root["feld"+i].multiline =true;
  14.         _root["feld"+i].autoSize ="left";
  15.         _root["feld"+i].wordWrap =true;
  16.         _root["feld"+i]._y=h
  17.          h+=_root["feld"+i].textHeight+10
  18. };
__________________
gruß Harry
HAY ist offline   Mit Zitat antworten
Alt 17-10-2003, 19:03   #15 (permalink)
idi
Neuer User
 
Benutzerbild von idi
 
Registriert seit: Jun 2003
Ort: Bitburg
Beiträge: 89
wow - das funzt!!! vielen vielen dank!!!

dir aber auch MacEvil für deine mühe!!!!!

ihr seid die gößten!!!

trotzdem noch ne ganz kleine frage - wieso ist das erste textfeld was er mir ausgibt immer leer??? wo steckt denn da mein fehler?
__________________
werbefuchs
idi 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:39 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele