in altering this code so that it will support CDATA in my XML file? I am in desperate need of assistance. I have no idea where to begin. I have also included a zip file with the fla and associated XML file.
now, the problem ... I cant extract the [CDATA[57.14]],[CDATA[14.29]] & ![CDATA[28.57]] to use it ... I tried several things with firstChild,ChildNodes, but no luck ... any one has a simple solution to put all this in an Array so i can get the stuff out to use it ..
I'm trying to include some JavaScript (JSON 2, to be precise)in with some ActionScript 3 classes. I'm using the inline XML method (E4X) of declaring the data. It looks like this:
public static var JSON_2:XML = <data><![CDATA[ if (!this.JSON) { JSON = function () {[code]....
Actually, this is only about a quarter of what I need to include but this is where it breaks down. Right after the second slash in the last line, Flash reports: TypeError: Error #1091: XML parser failure: Unterminated CDATA section.
In fact, as you can see this is a perfectly valid CDATA section and isn't being terminated anywhere (there is no instance of "]]>" anywhere in the data). Unfortunately, Flash doesn't think so and seems to think that the backslash is an XML node directive. how to effectively deal with this? The JSON source code has *many* backslashes so not having to convert them would be *very* useful.
<EventDays> <EventDaysInfo year = "2012" month = "0"> <![CDATA[<Days day="0" name="sdfds" desc="fgfds" _img=""/>]]> <![CDATA[<Days day="0" name="sdf" desc="" _img=""/>]]> <![CDATA[<Days day="0" name="dsf" desc="dsfd" _img=""/>]]> ..... This is the structure of my XML, and I tried in some ways, but I can't able to get Character DATA as XML data. Is this any way to convert CDATA into XML in AS3?
So i stand corrected. the <a href is screwing up my XML data.If I plop a CDATA tag in the XML obviously it works fine. But is there any other options to keep that tag out of the XML file?If I can somehow include it in Flash (which logically doesn't make sense) that would be great. The XML is generated server side and I can't get them to mod it.
I am loading up xml(rss2) in AS3, then trying to get something out of the description tag from each item. The description usually looks like this[code]...
I need to have two links in an XML document. This XML document would be loaded into Flash.
The first link I would need is a mailto: link for e-mail. The second link would be a regular hyperlink. Now, first, how could I accomplish this? Render the text as html I was told, but how should write the links? Does Flash have to parse such data?
I encountered a problem on a website when i use xml CDATA and whitespace. It works fine in Firefox but once again IE gives me problem. My whitespace which works in Firefox is not the same in IE, it is all messed up instead of lined up.
The CDATA is working for me, but it will not show certain HTML tags, such as <ul><ul><li> and <up> <ul><li> is fine, but if I do another level, second levels are on the first level.
I am trying to add an html link inside a parapgraph of text that is loaded through an xml document. I have done some research and it appears I need to set my actionscript to read the html. When I add the href in the text it reads literally as the code instead of creating a hyperlink in the paragraph. My problem is I did not set up the original flash document and I anot sure where to add the htmlText=true; and so on.
Here is the link. The problem is in the "press" section. last line in the paragraph of text. You can see the aref code not working.
I have an XML object that I want to send to my player via HTTP POST. This is all good when using XML.sendAndLoad.The problem is that when the XML object I generate contains CDATA, the CDATA is stripped out before the POST occurs.so if I have:
var xml:XML = new XML("<root><tag><![CDATA[hello]]></tag></root>")
when I do a sendAndLoad this is what gets POSTed:
<root><tag>hello</tag></root>
the same occurs when I try to create the XML using XMLDOM methods like createElement, createTextNode, and appendChild.the AS2 docs say that CDATA is not supported. Is there a workaround for this? I'm thinking that it could be fixed by extending and overriding the XML class, but I haven't found a way to do it yet. I can't use LoadVars here either because it will attach a variable name, and we don't want that.
I have read through most of the numerous posts relating to this topic (and there are quite a few) but I am still unable to solve my problem. I have a simple AS2 script:
[Code]...
</example>Unfortunately (unless I am missing the concept of CDATA in xml) my text is rendered in flash as:see google <a href="http:google.com>here</a>My ultimate goal is to generate text in flash that is generated from xml and that have a link to external urls. I do not have much experience with xml in flash, i have been looking online but can't seem to figure out what to do. Any ideas?
This has got to be easy, just escaping me, and sick of searching for "almost" the right answer. I'm trying to get at the actual data enclosed within a CDATA tag in an XML file.
Here's a sample of the XML file :
Code: <?xml version="1.0" encoding="ISO-8859-1"?> <webdata> <page id = "Page1">
[Code].....
What do I need to change so I just extract the data within the CDATA tag?
Completely at a loss for words...it is there in the xml file. The XML throws no errors. And yet when I try to access the CDATA section it says that its null. What does that mean? Here is my test source, and the link to the location of the XML doc (its a hard coded link in the AS).
I'm working with Scotty's image gallery code and I would like to use CDATA instead of a node attribute to supply captions for the images. The reason being that it should be *easy* to apply HTML formatting to the CDATA, including bolding and line breaks. At this stage I have two issues:
1) The only way to get the HTML to display is to apply a stylesheet. For some reason the stylesheet isn't working here (even though the exact same code works for me in a different file).
2) I don't know how to iterate through the nodes to pull the appropriate CDATA when a thumbnail button is clicked. I do know how to target the very first CDATA node value so that's what you see displayed. But I'm not figuring out how to loop through them properly.
I'm trying to do a player roster for a sports team. I found on here as a template. 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
I know that you can format text in XML through CDATA and htmlText option in flash.. my question is if one can format the content of an attribute in the same way.. i.e:If I have the following line in my XML file:
<main Name="Hello World" Link="home.swf"/>
is it possible to format the "Hello World" text? Can I for example put the CDATA option in the content of the "Name" -tag like so:
I've used CDATA tags many times, but I am writing the XML slightly differently then usual. Where do I put the cdata tags within this example so i can control the href links in the last section:
Code: <item number="04" name="WE SELL ART" /> <item number="05" name="CONTACT" action="gotoFrame" variables="vitals" sectionNumber="05" sectionContent="POST. 123 Street Address, City, Country PHONE. 123-456-7890 ELECTRIC. <a href="mailTo:info@test.com">info@test.com</a>"/>
<headline2 width="500"><![CDATA[<spane class='Headline'><span class='LinkTo'><a href="/us/success/collateral.aspx">your collateral<br /><span class='HeadlineSmall'>get info about it here</span></a></span></span>]]>
How would I retrieve the URL contained in the a href attribute? I have tried a number of ways: @a, @ahref, @href, as well as CDATA.@a, CDATA.@ahref, CDATA.@href and am stumped.