Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 15-05-2007, 20:45   #1 (permalink)
¿
 
Registriert seit: Sep 2005
Beiträge: 86
<img>Tag in dyn. erstelltem Textfeld

Hallo zusammen,

kann mir jemand sagen, welche Parameter erfüllt sein müssen, um in einem dynamisch erstelltem Textfeld das <img> Tag verwenden zu können?

In einem von Hand erstellten (dynamischen) Textfeld (tf2) funktioniert es bei mir in einem per AS erstellten (tf1) jedoch nicht.

PHP-Code:
var lTextFormat:TextFormat = new TextFormat();

lTextFormat.font "Yella";
lTextFormat.size 8;
lTextFormat.color 0x527815;

this.createTextField("tf1"1101000)
tf1.selectable false;
tf1.autoSize "left";
tf1.embedFonts true;
tf1.multiline true;
tf1.html true;
tf1.setNewTextFormat(lTextFormat);
tf1.htmlText '<img src="linkIconHeader" vspace="4" hspace="1"><p>Test</p>';

tf2.selectable false;
tf2.autoSize "left";
tf2.embedFonts true;
tf2.multiline true;
tf2.html true;
tf2.setNewTextFormat(lTextFormat);
tf2.htmlText '<img src="linkIconHeader" vspace="4" hspace="1"><p>Test</p>'
o-nyx ist offline   Mit Zitat antworten
Alt 15-05-2007, 21:03   #2 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
Servus
So vielleicht!!
PHP-Code:
tf1.htmlText '<img src="linkIconHeader" vspace="4" hspace="1"><p>Test</p>';
tf1.setTextFormat(lTextFormat); 
__________________
Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake!
"Wer tanzen will, muß erst gehen lernen"
RustyCake ist offline   Mit Zitat antworten
Alt 15-05-2007, 21:06   #3 (permalink)
¿
 
Registriert seit: Sep 2005
Beiträge: 86
Nein, das hat leider nichts gebracht
o-nyx ist offline   Mit Zitat antworten
Alt 15-05-2007, 21:33   #4 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
WordWrap anschalten!!
PHP-Code:
var lTextFormat = new TextFormat();
lTextFormat.font "Yalla";
lTextFormat.size 18;
lTextFormat.color 0x000000;
this.createTextField("tf1"1101030020);
tf1.type "dynamic";
tf1.wordWrap true;
tf1.embedFonts true;
tf1.border true;
tf1.selectable false;
tf1.autoSize "left";
tf1.multiline true;
tf1.html true;
tf1.htmlText '<img src="clown.jpg" vspace="4" hspace="1"><p>Test</p>';
tf1.setTextFormat(lTextFormat);
tf2.selectable false;
tf2.autoSize "left";
tf2.embedFonts true;
tf2.multiline true;
tf2.html true;
tf2.htmlText '<img src="clown.jpg" vspace="4" hspace="1"><p>Test</p>';
tf2.setTextFormat(lTextFormat); 
__________________
Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake!
"Wer tanzen will, muß erst gehen lernen"
RustyCake ist offline   Mit Zitat antworten
Alt 15-05-2007, 21:42   #5 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
Aber da wirst auch nicht glücklich werden, weil wordwrap dein autosize zerschießt
__________________
Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake!
"Wer tanzen will, muß erst gehen lernen"
RustyCake ist offline   Mit Zitat antworten
Alt 17-05-2007, 10:18   #6 (permalink)
¿
 
Registriert seit: Sep 2005
Beiträge: 86
Danke für den Tipp mit WordWrap, daran lag es wirklich (was einem die Hilfe natürlich verschweigt )

Um das Problem mit autoSize konnte ich mich herummogeln. Ich setze zunächst autoSize = true und wordWrap = false, schreibe nur den Text ohne die Grafik in das TextField. Dann merke ich mir _width in einer Variable, setze autosize = false, wordWrap = true und _width wieder auf die gemerkte Breite + 10 (die breite des Bildes + 2x hspace).
PHP-Code:
var lTextFormat:TextFormat = new TextFormat();
var 
tempWidth:Number

lTextFormat.font "Yella"
lTextFormat.size 8
lTextFormat.color 0x527815

this.createTextField("tf1"1101000
tf1.selectable false
tf1.autoSize "left"
tf1.embedFonts true
tf1.multiline true
tf1.html true
tf1.setNewTextFormat(lTextFormat); 
tf1.htmlText '<p>Test</p>';
tempWidth tf1._width;
tf1.autoSize false
tf1.wordWrap true
tf1._width tempWidth+10 
tf1
.htmlText '<img src="linkIconHeader" vspace="4" hspace="1"><p>Test</p>'
o-nyx ist offline   Mit Zitat antworten
Alt 17-05-2007, 18:52   #7 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
Doch das ist schon beschrieben, aber sehr versteckt
"Bei Verwendung von HTML-formatiertem Text benötigte Eigenschaften und Syntax"
Gib des mal in der Flashhilfe ein!
__________________
Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake!
"Wer tanzen will, muß erst gehen lernen"
RustyCake ist offline   Mit Zitat antworten
Alt 17-05-2007, 19:02   #8 (permalink)
¿
 
Registriert seit: Sep 2005
Beiträge: 86
Nagut...
o-nyx 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 15:49 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele