Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








URGENT Don't Want CDATA Node To HTML Escape Characters


Guys/Gals,
I need some very urgent help for a project that is on a tight deadline. I have a CDATA node that i'm loading into Flash that has some html in it. Let's just say this is it:

You are <font color='#FFFFFF'>very pretty</font>.<br><br>

When I trace out the xml after it is loaded into flash, it comes out as this:

You are <font color=&apos;#FFFFFF&apos;>very pretty</font>.<br><br>

I need it to come through with the tags in tact. How do I go about this?

THANKS VERY MUCH, cookies to the person who helps out!




KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 08-24-2007, 04:18 PM


View Complete Forum Thread with Replies

Sponsored Links:

[F8] Help Reading From XML File CDATA Node
Hi all ,
I have a chat application which I'm storing the logged chat as an XML file, using a CDATA node to preserve the HTML formatting. However when I import the xml data in to flash, and then in to the textarea component, the HTML is displaying the source rather then the formatted text.

Also, when I edit the source of the xml file and remove the CDATA tags, the text is displayed correctly --- knowing that when flash imports the CDATA node, flash automatically removes the those tags, I'm at a loss to explain this behavior. I think that perhaps flash is automatically converting the <> etc to HTML entities, but I tried to replace these occurances (< > ) to no avail.

Please help !!! wasted a ton of time on this and its holding back the completion of the project

View Replies !    View Related
How To Write Variable To XML Node And Wrap It In CDATA
Is there any way to write a variable to an XML node and wrap that variable in CDATA tags?

For example, if I have a var _someVar, writing it into an XML node is easy; <myNode>{_someVar}</myNode> . But what happens when I want to wrap that variable in CDATA tags? I've tried everything I can think of. Can someone help?

View Replies !    View Related
Escape Characters XML
hey everyone.

i try to send xml-data to my php script.
everything works fine, except the fact that
new lines "
" are not submitted.
can anyone give me a hint?



/*
the variable myText is a multiline-textbox on the stage.
*/

function buildXML(){
temp = new Object();
plXML = new XML();

temp.thread = plXML.createElement("package");
temp.thread.attributes.action = "newEntry";
plXML.appendChild(temp.thread);

temp.user = plXML.createElement("user");
temp.user.attributes.id = userID;

temp.myTextNode = plXML.createTextNode(myText);
temp.myText = plXML.createElement("text");
temp.myText.appendChild(temp.myTextNode);

temp.myHLNode = plXML.createTextNode(myHeadline);
temp.myHeadline = plXML.createElement("headline");
temp.myHeadline.appendChild(temp.myHLNode);

temp.forum = plXML.createElement("forum");
temp.forum.attributes.id = forumID;

plXML.firstChild.appendChild(temp.user);
plXML.firstChild.appendChild(temp.myText);
plXML.firstChild.appendChild(temp.myHeadline);
plXML.firstChild.appendChild(temp.forum);
plXML.send(_root.urlPath add "insertEntry.php");


/*
//this one dind't work, so i tried sth. like this:
testXML = new XML();
testXML.parseXML("<![CDATA[" add myText add "]]>");
testXML.send(_root.urlPath add "insertEntry.php");
*/
}


when i catch it with the php $_SERVER["QUERY_STRING"] statement and put it in a textfile, the output is the following
(myText is "blah1
blah2" ->newline after blah1)

//first exapmle:
<package%20action="newEntry"><user%20id="1"% 20/><text>blah1blah2</text><head
line>foren%20saugen</headline><forum%20id=""%20/></package>

//second one:
blah1blah2

this messes me up!! please help me! thanks in advance.
cheers

View Replies !    View Related
Escape Characters
Does anyone have a list of know of one for some of the escape characters used for & and + and others so that the text fields recognize them when loading them from .txt files?

View Replies !    View Related
Escape Characters % Enigma
Hi, I have this array I get from PHP and need to get it into flash:
The ; is the split character.

Code:
0,11%;0,39%;0,16%;0,20%;1,03%;0,33%;0,96%;0,09%;0,28%;0,23%;-;0,30%;0,15%;0,40%;0,17%;0,10%;0,40%;0,25%;0,15%;-;0,55%;-;0,08%
But when I get into Flash it shows this:

Code:
0,110,390,160,201,030,330,960,090,280,23-,0,300,150,400,170,100,400,250,15-,0,55-,0,08-
I tried using the escape(var) but it then gives me this:


Code:
0%2C110%2C390%2C160%2C201%2C030%2C330%2C960%2C090%2C280%2C23%2D%3B0%2C300%2C150%2C400%2C170%2C100%2C400%2C250%2C15%2D%3B0%2C55%2D%3B0%2C08%2D%3B
How can I get this array into flash to give me results like this:
0,11%
0,39%
etc...

View Replies !    View Related
Special Characters - Escape? Ü Ä ...
I have some problems with special characters (German cities ...)

In PHP I generate a XML file, like:


PHP Code:



$city = str_replace("ü","ü",$row_cities->city);

$xmlData .= " <item city_id="".$row_cities->city_id."" city="".$city."" />
"; 




If I don't do that str_replace then Flash will stop when i'm trying to read the XML results.

But flash doesn't show the "ü"...

With this: <item city_id="1093" city="Würzburg" />
I am getting: <item city_id="1093" city="Wrzburg" />

I was trying to work with escape and unescape but nothing seems to work,
anyone has a clew?

View Replies !    View Related
How To Ignore Escape Characters?
Hi,
When I receive a string from an external source, I want to be sure that for example "C:
ew folder" the
is NOT read as "new line". ("new folder" is just an example, it can be anything else though).
When I use escape("C:
ew folder") I get the following:
C%3A%0Aew%20folder
and it should be
C%3A%5Cnew%20folder

How can I ignore the escape characters?

View Replies !    View Related
Escape Characters For Imported Text?
Does anyone out there know the escape characters to use in Flash to format imported text?
In particular I'm looking for an escape character for "&" and a line wrap.

View Replies !    View Related
Quotation Mark Escape Characters?
I'm using AS 2.0

I'm reading from an XML file and putting values into String format...however, the quotation marks that are in some XML entries, when I play the movie, do this:

This is a &apos;veFlash&apos;ve movie

This is when I put for escape characters. It doesn't work when I don't have the backslashes either.

View Replies !    View Related
Escape() Sending Wierd Characters
I'm having a wierd issue. I have to URL encode some non-english characters that are being sent to an asp script. If I use escape(); it sends the wrong values. If I unescape() within flash it's fine, but when sent externally, it's sending the wrong values for non-english characters like é and è. Any ideas? Thanks.

View Replies !    View Related
What The Pork? My Escape Characters Aren't Working
Hey there,

Can someone tell me if escape characters are supported when loading an external file? If so, can you show me what i should be typing to display the "&" and a bullet, i would appreciate it!

/n & /n?

Thanks...

View Replies !    View Related
Reading 1byte+2byte Characters From Single Xml Node
I have an xml file that contains some text in English then straight after some double-byte text in Japanese in the same node. I'm reading it into Flash using node value. Is there any way I can seperate out the English from the Japanese either in the xml or in AS so that I can place the English in one text field and he Japanese in another?

If I could just place some kind of marker character in between the two portions, then look out for that in AS and use it to split the text, that would be fine.

thanks
mark

View Replies !    View Related
XML CDATA - Formating HTML
Hi there my load of xml goes okay but all html styles as... strong.. color
and image dont work

what am I doing wrong


AS:
-------------------------------------------------------------------------
var mydata:XML = new XML("data.xml")
mydata.ignoreWhite = true;
mydata.onLoad = function(success:Boolean) {
cont = mydata.firstChild.firstChild.childNodes
tmptxt = mydata.firstChild.firstChild.childNodes
cont2=tmp.text
};

cnt_txt.html = true;
mydata.load("data.xml")

-------------------------------------------------------------------------

XML

<?xml version="1.0" encoding="utf-8" ?>
<content>
<txt><![CDATA<div><img alt="" src="../Uploads/flashtest/dv-cam.jpg" border="0" /> This is <strong>BOLD and this <span style="COLOR: #ff0000">red</span></strong></div>]]></txt>
</content>

View Replies !    View Related
CDATA Problem With HTML
Hello all.

I am pulling a XML node in with CDATA and html tages, e.g.
<fill><![CDATA[<font color='#FFFF00'>Recruitment: apply locally work globally</font></fill>

for some reason when i trace my var it looks :
<font color=&apos;#FFFF00&apos;>Recruitment: apply locally work globally</font>

and is literally writing out the html instead of displaying it within the textfield.
My textfield is set to html and I am using .htmlText.

Any ideas?

View Replies !    View Related
Xml CDATA Formating Html
Hi there my load of xml goes okay but all html styles as... strong.. color
and image dont work

what am I doing wrong


AS:
-------------------------------------------------------------------------
var mydata:XML = new XML("data.xml")
mydata.ignoreWhite = true;
mydata.onLoad = function(success:Boolean) {
cont = mydata.firstChild.firstChild.childNodes
tmptxt = mydata.firstChild.firstChild.childNodes
cont2=tmp.text
};

cnt_txt.html = true;
mydata.load("data.xml")

-------------------------------------------------------------------------

XML

<?xml version="1.0" encoding="utf-8" ?>
<content>
<txt><![CDATA<div><img alt="" src="../Uploads/flashtest/dv-cam.jpg" border="0" /> This is <strong>BOLD and this <span style="COLOR: #ff0000">red</span></strong></div>]]></txt>
</content>

View Replies !    View Related
Html In XML...CDATA Not Working.
Hey everyone. I'm trying to do a player roster for a sports team. I used the VERY helpful grid gallery I found on here as a template (THANK YOU). However, I'm having a bit of an issue. I want to be able to format the xml using html in the xml file itself...for example I'd like to be able to insert pictures, make text bold, etc. using html tags in my dynamic text field. I enabled the "render as html" button thing. When I put


Code:
<caption><![CDATA[<font size="14">this is a <b>TEST</b></font>]]></caption>
in my xml, i just get: <font size="14">this is a <b>TEST</b></font> in my caption box. What am I doing wrong?

View Replies !    View Related
HTML In Cdata Issue
I am trying to load an xml file into a flash movie with CDATA in it and my text is coming out as disassembled html markup. Here is an example of my xml file with the nodes being supplied by form fields running tinyMCE.


Code:
<?xml version="1.0" encoding="UTF-8"?>
<specialsInfo>
<sunday><![CDATA[<p>Sunday</p>]]></sunday>
<monday><![CDATA[<p>Monday</p>]]></monday>
<tuesday><![CDATA[<p>Tuesday</p>]]></tuesday>
<wednesday><![CDATA[<p>Wednesday</p>]]></wednesday>
<thursday><![CDATA[<p>Thursday</p>]]></thursday>
<friday><![CDATA[<p>Friday</p>]]></friday>
<saturday><![CDATA[<p>Saturday</p>]]></saturday>
</specialsInfo>
and it comes out like the following

<p>Thursday<p>

If I follow the thread below

http://www.sitepoint.com/forums/show...ead+html+cdata

and write the following code into my AS file


Code:
specialtxt.html = true;
specialtxt.htmlText = totalDays[today].childNodes;
specialtxt.html = true;
specialtxt.htmlText = specialtxt.text;
it seems to work fine but I was hoping someone could shed some light on the reason why this my be doing this and how I might correct it without what seems to be a work around.

Thanks in advance

View Replies !    View Related
Cdata And Html Tags Not Displaying From XML
After searching high and low for solution, found the following:

<caption2><![CDATA[<font color=blue>"Called to Serve"</font>]]></caption2>

and thought all was well till i tried it....dont work.

The actual characters are displayed. Have text being rendered as HTML tried it without it. tried using escape characters instead of <> etc.

Any thoughts or snipets that have worked?....confused...lost.

View Replies !    View Related
CDATA To Pass HTML Via XML Into Flash
My apologies if this has already been answered, but its driving my up the wall how HARD it still is for flash to even import data. It's amazingly annoying trying to convert data into XML and than be readble by flash, why can't macromedia be 'normal' and have some connector that can directly connect to a SQL database, how annoying!!

Anyway enough about my rant...

I have a WYSIWYG html editor on my website that generates flash readable HTML code and we use PHP to store the information that is generated as a .xml file to be readable by our flash file. The data is passed via XML but trying to get the HTML tags through without the XML parser thinking its XML and interfering, and I've managed to research find the CDATA tag to pass information in (please note, i dont know much XML, just basics to get it to work) but it doesn;t work!!

When I try to HTML code that is wrapped in the CDATA than it just shows as "null" on my flash file, but if i remove the CDATA tag and put in simple text it seems to work ok! even if i put in


Code:
<b>you better work, damn you!</b> this part is not bold, but doesnt show anyway
than the part in bold shows as bold but anything after that has disappeared

Any ideas how I can effeciently put HTML into flash and get flash to successfully render it as HTML?!? Please note I've already used a .txt file unsucessfully and it seems to have LOTS of issues with special characters

Any working examples? Can i get source code?

View Replies !    View Related
Textfield Not Rendering Html In CDATA... ?
I'm using CDATA to display text in a textfield that has "render text as html" selected, but it's not rendering the html tags within the CDATA.

here's the xml code:

Code:
<pic>
<image>images/01_img.jpg</image>
<description title="Title 1" price="$$$$$">
<![CDATA[2007, acrylic on canvas,<br>20" x 40"</br>]]>
</description>
<thumbnail>thumbs/01_thb.jpg</thumbnail>
</pic>
I'm not 100% sure that my AS is correct for the path to the CDATA. I have this...

legend.txtLegend.facts.text = description[p].firstChild.nodeValue;

Could someone possibly point out why the html tags are not being rendered and also tell me if the path I have to the CDATA is correct. It works, but I wanted to make sure it was correct.

thanks for the help.

View Replies !    View Related
CDATA Issue With HTML Text
Hello,
I have an htmlTextField that I am loading html text from a xml doc. the problem is that the text is not rendering as html. so all my HTML is displayed in the textField.

here is the XML:

Code:
<description><![CDATA[<b>Recipe</b> for a tremendously ... ]]></description>
here is the AS:

Code:
myDescription.htmlText = pageDescription[m];
but if i do this:

Code:
myDescription.htmlText = "<b>Recipe</b> for a tremendously ... ";
the html displays correct. so I know that the textField is setup to display the html. when I trace pageDescription I get:

Code:
<b>Recipe</b> for a tremendously ...
I'm not sure how to fix this. Can anyone help me? thanks.

View Replies !    View Related
XML And CDATA Not Formatting As HTML Text
Last edited by yakken : 2007-12-16 at 20:37.
























I have a site that uses XML to load text, pics etc. but I have a problem using the CDATA tag in my XML files and afterwards rendering the text as HTML.

The XML could be

HTML Code:
<?xml version="1.0" encoding="UTF-8"?>
<events>
<event pic="largePicture.png" header="Headline" caption="Subheadline" smallpic="thumbnail.png">
<description>
<![CDATA[<b>I would like to use HTML here</b><br>Next line!]]>
</description>
</event>
</events>
Loading the XML works fine and I have everything saved in arrays (the text I need here, would be in the "descriptions" array - see below), that I can access, but when I try to throw my the <description> content into a textbox, it displays everything as it is typed above - including the tags etc. I would be setting up the text like this (taken out of context and boiled down a bit to make it easy on the eye):

ActionScript Code:
//this is the i'th element that I am loading
["mc_text"+i].descrip.html=true;
["mc_text"+i].descrip.multiline = true;
["mc_text"+i].descrip.autoSize = true;
["mc_text"+i].descrip.htmlText= descriptions[i];

where the "decrip" text field would be the one containing my text.

It does, however, not format my text as HTML (the autosize attribute works though). A direct link to one of the subpages, not showing my text properly is here: http://www.vanity.dk/oceanclub/test.swf
Pres the last button on the right...

Help is appreciated!

I can see that this guy seems to have the same troubles as I:
HTML Links in xml.
but none of the suggestions in that thread seems to do the trick

View Replies !    View Related
Render XML CDATA To HTML In Text Field?
I know I'm probably missing something simple, but I can't for the life of me get the following to render as HTML in flash.

Actionscript:


Code:
content_txt.html = true;
topicNavXml = new XML();
topicNavXml.ignoreWhite = true;
topicNavXml.load("pageBuildNav.xml");
topicNavXml.onLoad = function() {
pageInfo =
topicNavXml.firstChild.childNodes[0].childNodes[0].firstChild;
content_txt.htmlText = pageInfo;
};
XML:


Code:
<?xml version="1.0" encoding="ISO-8859-1"?> <topicNavigation>
<topicPages>

<page><![CDATA[<p><font><b>General</b></font></p><p><font>Here is some text</p><p></p><p>In here is more text</font></p>]]></page>
</topicPages>
</topicNavigation>

What I get is the native format displaying in content_txt as follows:

<p><font><b>General</b></font></p><p><font>Here is some text</p><p></p><p>In here is more text</font></p>

I'd like this to be rendered as HTML in the content_txt field.


Any ideas?

Thanks!

View Replies !    View Related
Html Formattig With CDATA When NodeValue Shows XML?
Hi all!

I've been looking around the forums and this question seems to have been asked 100 times before. I think I have a slight twist on it though...

I am loading an xml document into Flash (exporting for player v6, AS1) and want HTML formatting in my dynamic HTML text fields. I've got CDATA there and using eg childNodes[i].chldNodes the text renders the tags and everything. If i use childNodes[i].nodeValue, the text field remains empty.

When I trace the nodeValue is comes out as 'null' and the nodeType is shown to be type 1 - element_node.

So the (for me) 1 000 000 000 kronor question is: am i missing something that defines a text node?

Here's an extract from the XML:


Code:
<page>
<name>Arbetsskada</name>
<avtalText>Som arbetsgivare är du skyldig att göra en anmälan till försäkringskassan.</avtalText>
<header>På blanketterna till försäkringskassan och till AFA ska du som arbetsgivare endast intyga anställningsförhållandena, inte bedöma om det föreligger

arbetsskada, eller ej. Utredningen och ställningstagandet görs av försäkringskassan och AFA men underlättas av din redogörelse. </header>
<pic>arbetsskada.jpg</pic>
<contents>
<subHead>
<name>Den skadade anmäler</name>
<cont><![CDATA[Den skadade ska anmäla arbetsskadan till:
<li>Arbetsgivaren</li>
<li>AFA - på blankett aLink2</li>]]></cont>
<pic>skadAnmal.jpg</pic>
</subHead>
<subHead>
<name>Arbetsgivaren anmäler</name>
<cont>Som arbetsgivare ska du:
- Anmäla arbetsskadan till försäkringskassan. Försäkringskassan tillhandahåller blankett, du hittar den också här: aLink1.
- Du ska också komplettera blanketten aLink2, som den anställde fyllt i, med hans/hennes anställningsuppgifter och sedan underteckna den. Den ska sedan skickas till

AFA. </cont>
<pic>arbGiv2Sub.jpg</pic>
</subHead>
</contents>
</page>
All wise words greatly appreciated!

samiam

View Replies !    View Related
XML Content In CDATA Not Ready HTML Tags
I have HTML tags in my XML content file, but need to wrap CDATA around it to prevent illegal characters from doing wrong stuff.

My XML node looks like this:
<pageintro><![CDATA[First paragraph of page content.<br />Second paragraph of <b>Page</b><i>content</i>]]></pageintro>

in my XML actionscript I parse the node like this:
intro_txt.htmlText = content_xml.firstChild.childNodes[i].firstChild;

and in my actionscrip I have also specified
intro_txt.html = true;

the intro_txt textfield has the html button ticked as well.

BUT it is not reading the html tags for some reason. It is just displaying them as characters so <br /> is not a line break it is written out like so: "<br />"

Any idea what I am missing in order for the html tags to be parsed properly?

View Replies !    View Related
Cdata W/html Tags Not Displaying Correctly [mx]
Hi,

i am having an annoying problem with an xml document and flash.

i have a dynamic textfield on the stage and this is set to render html.

in the xml doc i have a child node that is wrapped around cdata (as in the kirupa tut). No matter what i do, i can't get flash to correctly parse and display the text.

i.e.

in the xml:



<![CDATA[<b>make this bold</b>]]>



so in flash i get this in the text field:
<b>make this bold</b>

tried it with different tags, and read all sorts of forums including this:
http://www.kirupa.com/forum/showthre...a+dynamic+text

all i really want to do is hav line breaks in my block of text (i have some bulleted points and then a paragraph of text).

any help is really appreciated.

thanx

View Replies !    View Related
Embedding HTML In XML Using CDATA Problem (urgent)
Can someone help me please with this, i'm having MAJOR issues, I'll post the code for my actionscript and my XML. Everything looks like it should work, but I still see the HTML tags in my text boxes when I play the movie. Need this ASAP. I'm just trying to get the first node figured out using this test sample. Need immidiate help, please.

Appreciate it

Actionscript

Code:
myTextField.html = true;
var myXMLObject:XML = new XML();
myXMLObject.ignoreWhite = true;
myXMLObject.load("myData.xml");
myXMLObject.onLoad = function() {
var myText:XMLNode = myXMLObject.childNodes[0];
if (myText.nodeName == "navigation") {
for (var count = 0; count<myText.childNodes.length; count++) {
var currentNode:XMLNode = myText.childNodes[count];
set("text_"+(count+1), currentNode.childNodes[0].nodeValue);
set("title_"+(count+1), currentNode.attributes.Title);
myTextField.text = text_1;
myTitleText.text = title_1;
}
}
};
stop();
XML:

Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<navigation>
<myText Title="News"><![CDATA[Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque sodales, <b>ante in tincidunt gravida</b>, est ante lacinia nisl, sit amet rutrum nibh tellus a dui. Etiam tellus <b>lorem</b>, facilisis luctus, aliquam et, molestie ac, libero. Curabitur purus. In nec mi. Nulla elit. Suspendisse sagittis lectus sit amet nisl. <b>Vestibulum aliquet</b> tellus eget metus. In posuere neque. Praesent placerat. Maecenas libero. Donec scelerisque convallis metus.]]> </myText>
<myText Title="BIOGRAPHY">Biography</myText>
<myText Title="Media">This is where Media will go.</myText>
<myText Title="Photos">This is where Photos will go.</myText>
<myText Title="Tours">This is where Tours will go.</myText>
<myText Title="Community">This is where a Link to the boards will go.</myText>
<myText Title="Links">This is where Links will go.</myText>
</navigation>

View Replies !    View Related
Cdata W/html Tags Not Displaying Correctly [mx]
Hi,

i am having an annoying problem with an xml document and flash.

i have a dynamic textfield on the stage and this is set to render html.

in the xml doc i have a child node that is wrapped around cdata (as in the kirupa tut). No matter what i do, i can't get flash to correctly parse and display the text.

i.e.

in the xml:



<![CDATA[<b>make this bold</b>]]>



so in flash i get this in the text field:
<b>make this bold</b>

tried it with different tags, and read all sorts of forums including this:
http://www.kirupa.com/forum/showthre...a+dynamic+text

all i really want to do is hav line breaks in my block of text (i have some bulleted points and then a paragraph of text).

any help is really appreciated.

thanx

View Replies !    View Related
Parsing Html Embed In Xml Cdata Tags
Hello:

I'm dealing with an XML document, that has embed an html document, it looks like this:

<node>
<![CDATA[<b>SOME BOLDED TEXT</b>]>
</node>

the problem is that when I parse de xml document, what I found is something like

<b> some bolded text </b>

so, when I try to embed this into a textarea component, or a textfield, it shows the <>, instead of the formated HTML code.

Does any body has a clue of whats missing here? I have seen posts over the internet, where people said they have just done it, but none explains how.

Thanks in advance.

Mark

View Replies !    View Related
MX2004: XPathAPI CDATA SelectSingleNode And HTML Formatting
Hello,

my subject is pretty much my problem, i am using MX2004's XPathApi 'selectSingleNode' which is working nicely, i have done a wee bit of fiddling;


Code:
_root.selectedText = "About Us "
centreMe.textContent.htmlText = mx.xpath.XPathAPI.selectSingleNode(this.firstChild, "/data/item[@name = '"+ _root.selectedText + "']/*");
I would like to be able to change the content depending on what the variable is, and this seems to work fine. The content should be formatted text (with <p> etc...), so i am using CDATA tags to make sure no confusion is made with <>'s (and if i dont it only pulls in a small section - as expected).

Only problem is that for some reason it forgets it is a html formatted bit of CDATA and spits out the <p> tags with the rest of the content... i have placed in "centreMe.textContent.html = true;" make sure it knows its html but it really doesnt want to know.

I tried using selectNodeList to an array and printing this - which works, without CDATA tags, but adds a really annoying "," at the end of each "array item" it is printing.

Any help would be fantastic as i have also been through an entire saga to get here trying different techniques to get html tags displaying correctly within CDATA - and i guess this is ultimately my problem?

Thanks for your time!
Løque

--------
edit > now i am having a really "noobie" problem (if my one above wasnt already enough)

this works;


Code:
bla.html = true;
bla.htmlText = "this is frustrating?";
but this doesnt display anything in my dynamic textbox;


Code:
bla.html = true;
bla.htmlText = "<b> this is frustrating?</b>";
why does actionscript hate me? its player 7 with as2

View Replies !    View Related
XML - <[CDATA[ Enclosed HTML Tags Appearing On Output
Hi,
I'm having some trouble getting HTML tags to be parsed and not appear when displaying them in a dynamic text field;

here is the actionscript i'm using to display the data:

var XMLDoc:XML = new XML();

XMLDoc.ignoreWhite = true;
XMLDoc.onLoad = processXML;
XMLDoc.load ("XML/copy.xml");

function processXML(success:Boolean):Void {
if (success) {
trace ("Success");
_level0.txt_Headline.htmlText = XMLDoc.firstChild.firstChild.childNodes[1].attributes.headline;
_level0.txt_Body.htmlText = XMLDoc.firstChild.firstChild.childNodes[1].childNodes[0].firstChild;
} else {
trace ("Error.");
}
}

here is the XML that im pulling out:
<subnav name = "Overview" headline = "WHO WE ARE">
<body><![CDATA[<p>Next to our reputation, our greatest asset is our people. Design Forum’s team includes designers, strategists, brand experts, architects, engineers, implementation specialists, store planners, researchers and dozens of behind-the-scenes people who make it all happen.</p><p>We work with clients across all categories, including: retail, automotive, financial services, restaurants, as well as consumer products manufacturers.</p><p>The barn-inspired corporate headquarters is a paradigm of Design Forum’s approach and a symbol of our Midwestern work ethic. Built on the site of an old Ohio farm, its open spaces nourish a creative culture.</p>]]></body>
</subnav>

can't figure out why the <p></p> tags are appearing and not being parsed.

what am i doing wrong?

thanks for any help.
ian

View Replies !    View Related
Getting Html Text To Display From Xml File Usning CDATA
Hi
I am trying to get a link to work in the body text of a text block.
I am using CDATA but can not get this to translate to html in the flash. I have checked that the 'Render text as html' box is checked.
What is it that I am not doing? or not doing right?

Below is my AS and below that is my XML

========================
xml menu stripped down
======================


function CreateMenu(menu_xml) {
var items = menu_xml.firstChild.firstChild.childNodes;
for (var i = 0; i < items.length; i++)
{
if (items[i].attributes.type == "news")
{
var header = items[i].firstChild;
var article = items[i].childNodes[1];
var item_mc = menu_mc.attachMovie("menu_item", "item" + item_count, item_count);
item_mc._y = item_count * item_spacing;
item_count++;
item_mc.header_txt.text = header.firstChild.nodeValue; //
item_mc.main_mc.content_text = article.firstChild.nodeValue; // this is the content but is I use htmlText it throws an error
item_mc.main_mc.onRelease = DisplayInfo;
}
}
}
var news_xml = new XML();
news_xml.ignoreWhite = true;
news_xml.onLoad = function(success) {
if (success)
{
CreateMenu(this);
}
else
{
trace("Error loading XML file");
}
};
news_xml.load("news_url.xml");


===================
xml file below
==================


<?xml version="1.0" encoding="utf-8"?>
<menu>
<menuitems>
<item type="news">
<header>Heading</header>
<article><![CDATA[Some <br>text here<br><font size="16" color="#999999">And some text <a href="http://www.website.com" target="_blank"><b>here</b></a></font> <img src="any.jpg"/>]]></article>
</item>

</menuitems>
</menu>

View Replies !    View Related
XML/HTML/CDATA Into TextField With Mixed Bold And Embeded Fonts
Hi guys,

I've been looking for 3 days solid on an answer to this and wandered if you'd be able to shed some light. I have the following node in an XML file:


Code:
<Synopsis>
<![CDATA[If you know the names of the team member you wish to contact then you can email them by using the following:<br><b>firstname@website.co.uk<br />(e.g. joe@website.co.uk)</b> Alternatively please forward any queries or information to <b>info@website.co.uk</b><br /><br />Or call us on <b>0207 XXX XXXX</b> and we will be more than happy to help you with your query.<br /><br /><b>If you are coming to visit us we have provided useful links below to help make your journey easier to plan..]]>
</Synopsis>
In my fla I've imported a font library which works. I then dynamically create a textfield to hold the above.


Code:
var tf = new TextFormat();
tf.size =12;
tf.color=0x838383;
tf.font="45 Helvetica_Font Library";

var synopsis = find_us_mc.createTextField("synopsis_txt",find_us_mc.getNextHighestDepth(), 0, 5, 300, 50);
synopsis.setNewTextFormat(tf);
synopsis.html = true;
synopsis.autoSize = true;
comingFrom.embedFonts=true;
synopsis.multiline = true;
synopsis.wordWrap = true;
synopsis.htmlText = my_xml.firstChild.childNodes[1].childNodes[0].firstChild.nodeValue;
If I don't embed the font then it displays in arial like:


Quote:




Alternatively please forward any queries or information to info@website.co.uk.. blah blah




- all correct apart from the font family.

If I embed the font then the text appears in normal with no bold bits.

I have tried putting a dynamic text box on the stage of my main movie in my imported font with bold selected, pressed the bold button and included every single glymph under the sun. But it still doesn't work. I know it's got something to do with the way the font is embeded.. I just can't find the solution and it's drving me nuts!!

Is there an actual solution for this? I don't really want to have to hack the XML as I may need it for a non-flash site.

H e l p !!

View Replies !    View Related
How Do I Render Html Tags Within A Cdata Section Of An Xml File Correcetly?
Hi guys

I've got an xml file which uses <![CDATA[ ]]> tags. I've got simple html code within these tags like <b> and <p>

when I read the content of these nodes into flash it is displaying the tags like this:
hi<br/>my<br/>name<br/>is<br/>Joe<br/>

and not

hi
my
name
is
Joe



Can anyone tell me what i'm doing wrong?

Thanks

View Replies !    View Related
Can HTML Be In An XML Node?
is it possible to have HTML in XML? I have a piece of xml that looks like this:


Code:
<root>
<entry day="4"month="February"year="2006">This is my text. Here is a <a href=http://website.com ><b>link</b></a>to my website. </entry>
</root>
but when i am bringing it into Flash, it gets hungup and traces:


Code:
<root>
<entry day="4"month="February"year="2006">This is my text. here is a</entry></root>

View Replies !    View Related
HTML In An XML Node
I know I'm missing something basic here. If I have a simple XML document and it contains html that will be displayed in a html textfield (see code snippet) how do you get around the fact that the a tag is seen as a node? So if I'm using something like firstChild.childNodes[0].nodeValue - how can I get this to include the html tag? Do I have to indicate that the node is something other than text, is there such a things as a html node? Or do I have to excape somehow? Thanks.








Attach Code

<something><a href="#">click here</a></something>

View Replies !    View Related
Html Referance In XML Node
What I have is a bunch of simple text html pages. I have a flash file that's reading in a xml file with other data. Some of the data tags need to reference these html pages. So instead of having all the text in the same xml page I could just reference the html page from the xml through flash and it would read the text in the html and display it in a textfiled in flash. Just like it was taking it directly from the xml node.

Can this be done.

View Replies !    View Related
Read XML Node And Format As HTML-possible?
Hi everyone. Is it possible to read a child of an XML file and format it as HTML in flash? I'm asking this because I want to include a description text as a child of a node and I need to know if there is a way to insert a line brake in the text...

View Replies !    View Related
Insert Html Tags Inside XML Node
What would be the correct way to insert a block of html inside an xml node?

Code:
<root>
<text>html goes here</text>
</root>
html block to go into the node:


Code:
<P><FONT>Hello <B>World</B></FONT></P><P><FONT>Hi you!</FONT></P>
Any help would be greatly appreciated.

View Replies !    View Related
Cdata Xml Problem Rendering "html" Formatet Text
Im having a problem with cdata markup text. For some reason flash will not render my html formatet text.


Code:
<text>
<![CDATA[My <b>html</b> formatet text ]]>
</text>
When i try to display my xml node in a text box in flash, my html markup gest displayed as regular text, including font tags ect...

I have tryed to use toString, but that somehow does not work either.


ActionScript Code:
var description1_obj:Object = content_xml.firstChild.childNodes.nodeValue;

var description1= description1_obj.toString();

this.content_txt.htmlText = description1;

Can anybody help me on this... Please
Regards Martin

View Replies !    View Related
[FMX04] AS - Showing Text Field As HTML Field With XML/CDATA.
Hey all -

Trying to get a text field in my Flash MX movie to pull from and XML file with CDATA tags to show as HTML. I've checked the box to render as HTML for the text data field... but I'm having problems with the Actionscripting.

The field from this line is what I need to recognize as HTML reading CDATA tags:

this.ref["textField"+i].text = subnodes[3].firstChild.toString()

I know I need to do more than just change it to ".html" instead of ".text" and have tried a couple things, but nothing seems to work.

Any help greatly appreciated!


Code:
//Create the XML Object
myXML = new XML ();
myXML.load(newXml);
myXML.ignoreWhite = true;

//Load XML file
myXML.load("PBintro.xml");
//Make a reference to current timeline
myXML.ref = this
// Parse XML and fetch
myXML.onLoad = function(success){
if(success){
var root = this.firstChild ;
nodes = root.childNodes
for(var i=0; i<nodes.length; i++) {
this.ref["Title_txt"+i].text = nodes[i].attributes.name
subnodes = nodes[i].childNodes
this.ref["Comments_txt"+i].text = subnodes[0].firstChild.toString()
this.ref["Link_txt"+i].text = subnodes[0].firstChild.toString()
this.ref["Link_txt"+i] = subnodes[1].firstChild.toString()
this.ref["holder_mc"+i].loadMovie(subnodes[2].firstChild.toString())
this.ref["textField"+i].text = subnodes[3].firstChild.toString()
this.ref["textField"+i] = subnodes[4].firstChild.toString()
}
} else trace("Error loading XML document")
}

View Replies !    View Related
Html Text - Dynamic Text Field - Escape?
I am trying to embed a link into a html external text document that I am importing into a dynamic text box.

The url is passing a variable to a cgi script and has a "?" and a "&" in it.

Is there a way to escape these characters or another way to get this url into my text field?

Thanks!

View Replies !    View Related
Using XFTree: Getting The Parent Node Of Selected Node?
I'm using the XFTree component (great component) and I'm hoping there is a way to return the parent node of whatever node is selected in the tree. Does anyone know.

I can use getSelectedNode() to return the selected node for example, but I can't use: getSelectedNode().ParentNode for instance since the selected node that is returned is no longer attached to its original XML object.

Also, (and this is the larger issue) I really have no idea where the documentation is for this. Is there any? Aside from the list o' methods in the actionscript panel I mean.

Thanks in advance!

View Replies !    View Related
Finding A Node In XML File Via Node Attrib?
Hi guys,

I thought this was going to be easy! I would like to search an XML file for a particular data set i.e. set of nodes depending on a passed variable. However, storing a subset of my XML file via
ActionScript Code:
var gallery = this.firstChild;
and then searching 'gallery' as you would an array-using a for()-doesn't work since this.firstChild isn't returning an array . Any ideas?
A sample of my XML and function are below.

Cheers!




Code:
<gallery>
<collection title="Christmas 2004">
<picture title="Tiny Disk" thumb="portfolio_images/thumbs/tinydisk.jpg" description="portfolio_text/tinydisk.txt" image="portfolio_images/tinydisk.jpg"/>
<picture title="Plug" thumb="portfolio_images/thumbs/plug.jpg" description="portfolio_text/plug.txt" image="portfolio_images/plug.jpg"/>
</collection>
<collection title="Christmas 2004">
<picture title="Tiny Disk" thumb="portfolio_images/thumbs/tinydisk.jpg" description="portfolio_text/tinydisk.txt" image="portfolio_images/tinydisk.jpg"/>
<picture title="Plug" thumb="portfolio_images/thumbs/plug.jpg" description="portfolio_text/plug.txt" image="portfolio_images/plug.jpg"/>
</collection>
</gallery>
And the AS function....


ActionScript Code:
function getCollection(collection) {    //set the popup invisble when choosing a new gallery    var gallery_xml = new XML();    gallery_xml.ignoreWhite = true;    gallery_xml.onLoad = function(success) {        if (success) {            trace("XML loaded");            var gallery = this.firstChild            trace("gallery:" +gallery instanceof Array);            for(var i=0; i< gallery.length; i++){                trace("searching for collection...");                //find collection data                if(gallery[i].attributes.title==collection) {                    trace(collection+ " collection found");                    //store collection parent node                    var collection = gallery[i].childNodes;                    collectionInfo.text = collection.attributes.title;                    var totalItems = collection.childNodes.length;                    buildGallery(collection, totalItems);                    break;                } else if(i==gallery.length) {                    trace("Collection not found!");                    galleryInfo.text = "Not found";                    break;                }            }                    } else {            trace("Error loading XML file");        }    };    gallery_xml.load("gallery.xml");}

View Replies !    View Related
Special HTML Characters
Hi guys!
Here's my question. I have a movie with a dynamic textfield whose content comes from a txt file. In this file txt I have some tags such as <b></b>, <br>... and they work properly. Now I need to place a percent character in this text but Flash doesn't displays it. Is there any way to make it work? What's wrong with it (... or with me )?
Thanks!

View Replies !    View Related
Special Characters Html
Hi all.

I would like to show an html text in a TextField in flashlite 2.1. My problem is that some special characters are not shown correctly(& for instance). I have put in the first frame System.useCodePage = true, but the problem remains... What could I do?

Thank you in advance.

View Replies !    View Related
HTML Special Characters How?
Hi,

I am loading a text var. It works fine but I have two characters that will not load.

&eacute; é é lowercase e, acute accent &ecirc; ê ê lowercase e, circumflex accent
On the Adobe page these charatcers are %E1 and %EA. But they do not work. I tired other charecters such as the "~" (tilda) and that worked fine.

Any Ideas?

Ponyack

View Replies !    View Related
Html Text And <> Characters
I'm trying to load a bunch of code from a text file. It's bombing at the point it sees the < and > characters (i.e., it just stops rendering beyond that point). I've tried the %3e and %3c solutions, no go. I've tried <, as Moock suggests. I've tried .

Anyone know the secret?

Here's my code:

loadText = new LoadVars();
loadText.load("potential_win.txt");
//creating the loadVarsText function
loadText.onLoad = function() {
scroller.htmlText = this.myText;
};

Thanks!

Rick

View Replies !    View Related
Special Characters Within External HTML
I am trying to import text from a text file using loadVariables.

Whenever there is an ampersand symbol it won't read past it.

Please can someone help, I am going out of my tiny little mind.

Thanks.

View Replies !    View Related
Special Characters In Flash HTML
Hello,
I am using a Dynamic text field with a scroll bar in Flasg MX. I need to encode a Registered Trademark, but I cannot figure out how to do it. I have tried &reg; but that does not work. Is this possible? If so, please enlighten me.

Thanks!

View Replies !    View Related
XML Displaying Html Excape Characters
Hello,

I am having a great success using flash mx2004 xml functions to populate text fields from xml files. I have a project where I am populating these fields in different languages such as Russian.

My problem is that I can't seem to print escape characters such as ampersands without them showing up as html escape characters.

for example if I try to print this in a text field: joe's, it comes out as
Quote:




joe&s




. Now this occurs weather or not I format the xml file as
Quote:




joe's




or
Quote:




joe&s




Is there anyway around this?

Thanks,
Clem C

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved