Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 27-02-2004, 21:16   #1 (permalink)
Work. Buy. Consume. Die.
 
Registriert seit: Feb 2003
Beiträge: 216
Text schreiben mit Actionscript

Wie schreib ich denn dynamisch mit Actionscript in der Schriftart FONT in Größe POINTS an die Stelle X,Y einen Text ???

Vielen Dank für Support!

as

Geändert von Arne_Schmidt (27-02-2004 um 21:31 Uhr)
Arne_Schmidt ist offline   Mit Zitat antworten
Alt 27-02-2004, 21:28   #2 (permalink)
FlashLove@FirstSight
 
Benutzerbild von FLASHStyler
 
Registriert seit: Feb 2003
Beiträge: 2.460
PHP-Code:

function setTxt (txtxyFontArtgroeße) {
// Textfeld
   
_root.createTextField("TxtFeld"TiefexybreiteHöhe);   
      
   
// Textfeld Format
   
this.TxtFormat = new TextFormat();
   
this.TxtFormat.font FontArt
   this
.TxtFormat.size groeße;
   
this.TxtFeld.text txt;
   
this.TxtFeld.setTextFormat(this.TxtFormat);
}   

setTxt("Was gehtn"100100"Times New Roman"300); 
FLASHStyler ist offline   Mit Zitat antworten
Alt 27-02-2004, 21:49   #3 (permalink)
Work. Buy. Consume. Die.
 
Registriert seit: Feb 2003
Beiträge: 216
Danke!

Irgendwie bin ich wohl blöd, egal was ich mache, der text steht immer links oben in der ecke. Müsste das hier nicht eigentlich bewirken, dass er bei 500;500 steht?
ActionScript:
  1. setTxt("1",500, 500, "uni 05_63", 8);

und: Ich brauch den text für eine Diagramm-Beschriftung, muss also ziemlich viel text ausgeben (so vermutlich 100 Werte). Wie mach ich das denn dann am cleversten? Am liebsten würd ich irgend einmal initialisieren und dann nurnoch was kurzes in der schleife stehen haben.

as
Arne_Schmidt ist offline   Mit Zitat antworten
Alt 27-02-2004, 22:12   #4 (permalink)
FlashLove@FirstSight
 
Benutzerbild von FLASHStyler
 
Registriert seit: Feb 2003
Beiträge: 2.460
eigentlich schon...
FLASHStyler ist offline   Mit Zitat antworten
Alt 27-02-2004, 22:12   #5 (permalink)
.prof.
 
Benutzerbild von magicJ
 
Registriert seit: Feb 2004
Beiträge: 571
Man kann das ganze doch au viel einfach machen :
[ falls ihrs noch nciht wisst ]

Einfach mit ner maske den test langsam aufbauen

is doch easy
__________________
greeZz
-
vist me
magicJ ist offline   Mit Zitat antworten
Alt 27-02-2004, 22:15   #6 (permalink)
FlashLove@FirstSight
 
Benutzerbild von FLASHStyler
 
Registriert seit: Feb 2003
Beiträge: 2.460
Er wollte es ja dynamisch haben...
FLASHStyler ist offline   Mit Zitat antworten
Alt 27-02-2004, 22:35   #7 (permalink)
Work. Buy. Consume. Die.
 
Registriert seit: Feb 2003
Beiträge: 216
Das steht definitiv links oben in der ecke. ich habe einfach deinen code in eine leere fla reingeschrieben - muss ich denn sonnst noch irgendwie x&y "initialisieren"?
Arne_Schmidt ist offline   Mit Zitat antworten
Alt 27-02-2004, 22:37   #8 (permalink)
FlashLove@FirstSight
 
Benutzerbild von FLASHStyler
 
Registriert seit: Feb 2003
Beiträge: 2.460
Sorry kein Plan wieso das so ist...
__________________
www.johannes-erhardt.com | blog | xing me baby
FLASHStyler ist offline   Mit Zitat antworten
Alt 27-02-2004, 22:45   #9 (permalink)
Work. Buy. Consume. Die.
 
Registriert seit: Feb 2003
Beiträge: 216
Wenn du diesen (also deinen) Code

ActionScript:
  1. function setTxt (txt, x, y, FontArt, groeße) {
  2. // Textfeld
  3.    
  4. _root.createTextField("TxtFeld", Tiefe, x, y, breite, Höhe);   
  5.      
  6.    // Textfeld Format
  7.    this.TxtFormat = new TextFormat();
  8.    this.TxtFormat.font = FontArt
  9.    this.TxtFormat.size = groeße;
  10.    this.TxtFeld.text = txt;
  11.    this.TxtFeld.setTextFormat(this.TxtFormat);
  12. }   
  13.  
  14. setTxt("Was gehtn", 100, 100, "Times New Roman", 300);

in eine leere .fla schreibst - erscheint dann der text bei dir bei 100;100 ?

Wenn ja, dann poste doch bitte mal die entsprechende .fla !

As

PS: Hast du Flash MX ?
Arne_Schmidt 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 09:58 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele