Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 24-01-2007, 10:46   #1 (permalink)
angry > always
 
Benutzerbild von ingohill
 
Registriert seit: Jul 2001
Ort: NRW
Beiträge: 1.635
<br> in xml wird nach laden zu &lt;br&gt;

hi,

in meinem xml stehen umbrüche drin (<br>), diese werden nach dem laden jedoch mit &lt;br&gt; ausgegeben. als wäre man mit htmlentities() von php drübergegangen.

kann man in flash ummwandeln?
serverseitig geht nicht wegen offline-anwendung.

-ingo
__________________

on air: caliban | neaera | heaven shall burn | hatebreed | the agony scene
ingohill ist offline   Mit Zitat antworten
Alt 24-01-2007, 10:50   #2 (permalink)
nobody is perfect
 
Benutzerbild von richtsteiger
 
Registriert seit: Jul 2004
Ort: munich
Beiträge: 876
Du hast die entsprechenden Passagen aber schon in einen CDATA-Abschnitt gepackt?
PHP-Code:
<node>
 <![
CDATA[
  
hier kommt der Text mit <b>HTML-Markierungen</brein<br />
 ]]>
</
node
richtsteiger ist offline   Mit Zitat antworten
Alt 24-01-2007, 10:52   #3 (permalink)
angry > always
 
Benutzerbild von ingohill
 
Registriert seit: Jul 2001
Ort: NRW
Beiträge: 1.635
sicher das.

-ingo
__________________

on air: caliban | neaera | heaven shall burn | hatebreed | the agony scene
ingohill ist offline   Mit Zitat antworten
Alt 24-01-2007, 10:57   #4 (permalink)
nobody is perfect
 
Benutzerbild von richtsteiger
 
Registriert seit: Jul 2004
Ort: munich
Beiträge: 876
Und das Textfeld ist sicher auch ein HTML-Textfeld. Werden andere Tags auch maskiert? Könnt ich mir vorstellen. Hast du vielleicht ein paar mehr Infos, sagen wir mal CODE.
richtsteiger ist offline   Mit Zitat antworten
Alt 24-01-2007, 11:07   #5 (permalink)
Achim Math.PI
 
Benutzerbild von bloba
 
Registriert seit: Jul 2001
Ort: cool Colonia
Beiträge: 11.642
PHP-Code:
String.prototype.htmlUnencode = function() {
    
this;
    
s.split("&amp;");
    
a.join("&");
    
s.split("&nbsp;");
    
a.join(" ");
    
s.split("&eq;");
    
a.join("=");
    
s.split("&lt;");
    
a.join("<");
    
s.split("&gt;");
    
a.join(">");
    
s.split("&quot;");
    
a.join('"');
    
s.split("&apos;");
    
a.join("'");
    return 
s;
}; 
__________________
gruß bloba

2 x onkel² b_d
bloba ist offline   Mit Zitat antworten
Alt 24-01-2007, 12:30   #6 (permalink)
angry > always
 
Benutzerbild von ingohill
 
Registriert seit: Jul 2001
Ort: NRW
Beiträge: 1.635
@bloba: vielen dank.
führt also kein weg um so ein konstrukt herum.

anführungszeichen und co werder jetzt auch fein ersetzt und richtig dargestellt, allein probleme machen die <b> </b>, diese werden im klartext angezeigt.

mein code:
ActionScript:
  1. String.prototype.htmlUnencode = function() {
  2.     s = this;
  3.     a = s.split("&amp;");
  4.     s = a.join("&");
  5.     a = s.split("&nbsp;");
  6.     s = a.join(" ");
  7.     a = s.split("&eq;");
  8.     s = a.join("=");
  9.     a = s.split("&lt;");
  10.     s = a.join("<");
  11.     a = s.split("&gt;");
  12.     s = a.join(">");
  13.     a = s.split("&quot;");
  14.     s = a.join('"');
  15.     a = s.split("&apos;");
  16.     s = a.join("'");
  17.     return s;
  18. };
  19.  
  20. ftext = new TextFormat();
  21. ftext.font = "myriad";
  22. ftext.size = 12;
  23. ftext.align = "left";
  24. ftext.color = '0x000000';
  25.  
  26. tf_text.selectable = false;
  27. tf_text.multiline  = true;
  28. tf_text.background = false;
  29. tf_text.embedFonts = true;
  30. tf_text.html       = true;
  31.  
  32. tf_text.htmlText = meinInhalt.htmlUnencode();
-ingo
__________________

on air: caliban | neaera | heaven shall burn | hatebreed | the agony scene
ingohill ist offline   Mit Zitat antworten
Alt 24-01-2007, 12:41   #7 (permalink)
notzucht
 
Benutzerbild von shorty
 
Registriert seit: Nov 2003
Ort: Potsdam
Beiträge: 2.939
ingo, es geht auch ohne split & join. Du musst den Knoten nur richtig ansprechen/auslesen > [...]firstChild.nodeValue

actionscript
PHP-Code:
var data:XML = new XML ();
data.ignoreWhite true;
data.onLoad = function (success:Boolean)
{
    if ( 
success )
    {
        var 
tf:TextField _root.createTextField ('view'01010200300);
        
tf.html true;
        
tf.multiline true
        tf
.htmlText this.firstChild.childNodes[0].firstChild.nodeValue;
    }
};
data.load ('content.xml'); 
content.xml
HTML-Code:
<?xml version="1.0" encoding="UTF-8"?>
<root>
 <foo><![CDATA[<b>Hello world!</b><br /><i>My name is Flash</i>]]></foo>
</root>
result
Code:
Hello world!
My name is Flash
lg,
shorty
__________________
.
Flex in a week | Viertel vor halb nach Vollmond | ^^°.°^^ | Waltz with Bashir
.
shorty ist offline   Mit Zitat antworten
Alt 24-01-2007, 12:47   #8 (permalink)
angry > always
 
Benutzerbild von ingohill
 
Registriert seit: Jul 2001
Ort: NRW
Beiträge: 1.635
bedankt.
das werde ich gelich mal ausprobieren.

-ingo
__________________

on air: caliban | neaera | heaven shall burn | hatebreed | the agony scene
ingohill ist offline   Mit Zitat antworten
Alt 24-01-2007, 12:54   #9 (permalink)
angry > always
 
Benutzerbild von ingohill
 
Registriert seit: Jul 2001
Ort: NRW
Beiträge: 1.635
mhmm leider nicht.

wird wahrscheinlich an der eingebetteten schriftart liegen. aber kann man das irgendwie umgehen?

-ingo
__________________

on air: caliban | neaera | heaven shall burn | hatebreed | the agony scene
ingohill ist offline   Mit Zitat antworten
Alt 24-01-2007, 12:57   #10 (permalink)
nobody is perfect
 
Benutzerbild von richtsteiger
 
Registriert seit: Jul 2004
Ort: munich
Beiträge: 876
Speicher mal die XML in 'nem reinen Texteditor in 'nem anderen Datenformat ab. Das Problem hatte ich nämlich auch schon mal. Hab's dann probehalber mal als ANSI und später dann als UTF-8 abgespeichert und dann gings.
richtsteiger ist offline   Mit Zitat antworten
Alt 24-01-2007, 13:06   #11 (permalink)
angry > always
 
Benutzerbild von ingohill
 
Registriert seit: Jul 2001
Ort: NRW
Beiträge: 1.635
das prozedere habe ich schon hinter mir.

-ingo
__________________

on air: caliban | neaera | heaven shall burn | hatebreed | the agony scene
ingohill ist offline   Mit Zitat antworten
Alt 24-01-2007, 13:07   #12 (permalink)
notzucht
 
Benutzerbild von shorty
 
Registriert seit: Nov 2003
Ort: Potsdam
Beiträge: 2.939
Bei eingebetteten Schriften gab es einen Workarround (frag mich jetzt aber nicht wo Du den finden kannst, ich arbeite nie mit embeded Fonts), denn Du kannst pro Textfeld nur einen Schriftschnitt einbinden, also entweder italic, bold oder normal. Alle Drei zusammen funktioniert nicht.
__________________
.
Flex in a week | Viertel vor halb nach Vollmond | ^^°.°^^ | Waltz with Bashir
.
shorty ist offline   Mit Zitat antworten
Alt 24-01-2007, 13:39   #13 (permalink)
angry > always
 
Benutzerbild von ingohill
 
Registriert seit: Jul 2001
Ort: NRW
Beiträge: 1.635
@shorty: vielen dank.

naja, solange es einen workaround gibt, ist es ja nicht ganz so schlimm, werde mich erneut auf die suche machen (müssen).

-ingo
__________________

on air: caliban | neaera | heaven shall burn | hatebreed | the agony scene
ingohill ist offline   Mit Zitat antworten
Alt 24-01-2007, 14:01   #14 (permalink)
notzucht
 
Benutzerbild von shorty
 
Registriert seit: Nov 2003
Ort: Potsdam
Beiträge: 2.939
Wenn Du ihn gefunden hast, dann gib bescheid. Der fehlt mir irgendwie voll und ganz in meiner Flash-WR liste
__________________
.
Flex in a week | Viertel vor halb nach Vollmond | ^^°.°^^ | Waltz with Bashir
.
shorty ist offline   Mit Zitat antworten
Alt 24-01-2007, 14:11   #15 (permalink)
°.oO°O.o°.oO.o°O
 
Benutzerbild von bamboocha
 
Registriert seit: Jun 2005
Ort: CH
Beiträge: 1.490
Zitat:
Zitat von shorty Beitrag anzeigen
denn Du kannst pro Textfeld nur einen Schriftschnitt einbinden, also entweder italic, bold oder normal. Alle Drei zusammen funktioniert nicht.
Hi zusammen, hi shorty!

stimmt so nicht ganz! Man kann zwar nur einen Schriftschnitt pro Textfeld, es funktionieren aber mehrere zusammen...

pixelfont embed htmlText-Konflikt!!!

Hier hatte ich andretti mal erläutert, wie man mehrere (in der Library) eingebettete Schriftschnitte in ein html-Textfeld kriegt. Nicht schön, aber naja, ist halt nen Workaround...
__________________
There is no way to happiness, happiness is the way! - Buddha
bamboocha 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 21:40 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele