XML_flash_links_?
- Started
- Last post
- 12 Responses
- ganon
so i have a scrollable dynamic text box, which i am loading an external XML doc into...it is a news section, with each "item" node containing event info...for some of the events, there is a corresponding URL..is there a way to define and make this loaded XML text links where necessary...?
thanks
- ganon0
thanks, looking through this now...anyone have a solution with, err, a bit more explanation...?
- unfittoprint0
it's the link an node atrribute or is it included in the nodeVaue [text]?
- ganon0
it is an attribute...i am trying to have, lets say, a link at the bottom of each news item for further info....
- unfittoprint0
let's just say then when you parse the XML you would do something like:
myXML.onLoad = function(success){
if(succes){
content = this.firstChild.childNodes
for (i=0; i { content.length; i++){
textBox.htmlText += content[i].nodeValue;
textBox.htmlText +="{BR}";
//link
textBox.htmlText +="{a href='" + content[i].attribute.link+'}go to link {/a}";
textBox.htmlText += "{BR}{BR}";
}
} else {
trace("error");
}
}
- ganon0
thank you...so i must have a seperate text box for the link?..i have the XML loading into a single text box currently, which has a scrollbar...there is no way to format the text and box, similar to PBS or NTB...?
- unfittoprint0
textBox is the only textfield the info is being pasted.
Don't forget to check the html output innnn hte properties box.
I forgot the closing {|a}.
So that line should look like:
textBox.htmlText +="{a href='" + content[i].attribute .link+'}go to link {|a}";
- ganon0
what i mean is can i format a single text box of XML like this..:
HEADLINE HERE_title
description description description description description description
LINK HERE_click me
--------------------------
HEADLINE2 HERE_title
description2 description2 description2 description2 description2 description2
LINK2 HERE_click me
----------------------
etc....
- unfittoprint0
yes. See the code.
Extract the the node title attribute.
insert newline or a BR
Extract the the node Value
insert newline or a BR
Extract the the node link attributeif this is a new thing I would advise to check the following links:
http://actionscript-toolbox.com/…
http://www.kirupa.com/developer/…
http://www.kirupa.com/developer/…
http://www.kirupa.com/developer/…
http://www.kirupa.com/developer/…
- ganon0
thanks unfit, i will do some more reading....
- ganon0
great, so i have the xml, links and all, loading into my dynamic text box...now i have all these formatting html tags in my actionscript...does flash support XSL to specify format...?
- sauerbraten0
ganon, is it possible for you to post your source?