|
-
Banned
[RESOLVED] [CS3] xml read using anchor tag
i am using this piece of code so that when i click on a text link having an url it will open in a window. The problem i encounter now is that when you give trace to read the content, it reads well but the same conent is not poperly getting displayed in the textbox.
PHP Code:
fff = new XML();
blog_array_title = new Array();
blog_array_content = new Array();
fff.load("blog.xml");
fff.ignoreWhite = true;
fff.onLoad = function(success) {
if (success) {
hhh.htmlText = fff.firstChild.firstChild.childNodes[0].nodeValue
trace(fff.firstChild.firstChild.childNodes[0].nodeValue);
}
};
my xml file:
<blog>
<page heading="Blood Groups"><![CDATA[A blood type (also called a blood group) is a classification of blood based on the presence or absence of inherited <u><A HREF=\"asfunction: opurl, http://en.wikipedia.org/wiki/Antigen \">antigenic</A></u> substances on the surface of red blood cells (RBCs). These antigens may be proteins, carbohydrates, glycoproteins, or glycolipids, depending on the blood group system, and some of these antigens are also present on the surface of other types of cells of various tissues.]]>
</page>
</blog>
-
So to be sure, the trace works as it should and the textfield does not?
Make sure you set hhh.html = true; - Also can you show us what prints in the textfield?
-
Banned
my texbox is already set to html=true... still doesn't work.
my trace works just perfect.
This is what i get in my textbox:
A blood type (also called a blood group) is a classification of blood based on the presence or absence of inherited
.... so, i can notice that everything that comes after <u><A HREF=\"asfunction has been ignored.
-
Banned
-
Take out the escape slashes "\". You do not need to do that in XML...
-
Banned
great, so now the content is displayed in the dynamic box BUT when i click on the link, nothing happens. getURL function not working.
This is my function:
PHP Code:
function opurl(get_lnk) {
getURL(get_lnk, "_blank");
}
-
http://www.in3d.eu
Hi,
Problems are: the slashes (to esacpe quotes) and spaces inside "asfunction"
Remove the spaces between "asfunction" and colon symbol (and if any between function name -opurl- and commas):
Copy this xml:
Code:
<blog>
<page heading="Blood Groups"><![CDATA[A blood type (also called a blood group) is a classification of blood based on the presence or absence of inherited <u><a href="asfunction:opurl,http://en.wikipedia.org/wiki/Antigen">antigenic</a></u> substances on the surface of red blood cells (RBCs). These antigens may be proteins, carbohydrates, glycoproteins, or glycolipids, depending on the blood group system, and some of these antigens are also present on the surface of other types of cells of various tissues.]]>
</page>
</blog>
Kostas
-
Banned
i copied your xml code and pasted in a new xml file. still i do not get any links opening up when i click on the text link antigenic. infact, the below function is not even getting triggered when i give a trace action. My dynamic textbox is working fine.
PHP Code:
function opurl(get_lnk) {
trace("url opened:"+get_lnk);
getURL(get_lnk, "_blank");
}
-
Banned
after a couple of tests now i find that it works fine ONLY in a new fla file
...but my actual fla file uses the same code except that it stores cdata content in array and then pushes it into dynamic textbox, anyhow both does the same job.
Also my function opurl(get_lnk), is in the same frame where i have this xml parsing code. SO why this problem? Is it because i have the scripts inside Nth level movieClip?? I dont think this can cause a problem.
-
Banned
Finally............. got it working.... it was a function problem. The anchor tag was not able to recognise my function name may be because i had this function inside an MC..inside MC..inside MC.......12th level MC.. So i changed it to a global function and works perfect 
Thank you guys for helping me.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|