-
XML loaded text
Hi!
Does anybody know whow to scroll XML loaded text?
I have some text in an XML document that I want to load into a text field which scrolls it automatically.
I used the Macromedia scroll component, but that doesn't work.
Any ideas?
Thanks
-
Senior Member
I've only ever loaded scrolled external txt file. I too am interested in how to load and scroll an XML text. I don't need to scroll it automatically though.
-
I didn't mean scroll automatically that way. I just need it to be scrollable if the text extends the length of the text field.
-
And also, is it possible to create line breaks in XML, and have Flash convert all URLs or bits of text that start with "HTTP://" into a link?
If so, how?
Thanks
-
Senior Member
**** i just wrote a thread and the dam forrum says the files size is to big . Thats no go if ya cant upload a simple fla with only one scroll com in it. Any way i got it all working. based of off this tut. Email if you want my working version of it.
heybays@yahoo.com
http://www.tupps.com/flash/
right menu.
-
There's nothing that needs to be fancy.
Any ordinary XML file would do. I just need to know how to scroll XML loaded text and create breaks in XML.
Also, and lastly, I need a code which searches the paragraph for anything that begins with http:// and converts it to the link so if I made:
And today, I visited http://www.flashkit.com and really enjoyed the tutorials.
http://www.flashkit.com would be converted to a link to this website.
Breaks would simple look like:
lalala....
lalala....
in the text box. I have added ignore whitespace, but I think there is a way to add HTML formatting such as a line break into it, but I'm not sure how.
Thanks for any help!
If you could send me a Flash file, or post some script, please help me.
Thanks
-
Actually, Jaffasoft, your demos are pretty good, but the problem is, I'm not just loading in an XML file.
I'm using a component. I have been able to load text into the fields, but not HTML formatted.
Right now, the code looks like:
blogMenu.onImage = function(att) {
title = att.title;
date = att.date;
body = att.body;
img = att.pic;
//trace (this._parent.display);
this._parent.title = title;
this._parent.date = date;
this._parent.body= body;
this._parent.placeholder.images.loadMovie(img);
};
stop();
while the XML is:
<sub callback = "onImage"
label = "Hi"
pic="123.jpg"
title="hi"
date="May 03 2003"
body="hello"
></sub>
I know its something very simple, but any help would be appreciated, as I am a newbie to scripting and XML.
-
Senior Member
Some XML text cannot be scrolled using the scrollbar component. May be it can but I don't know. So I am using my own scrollbar. See for example:
http://can_info_guide.tripod.com/tex...htmlinxml.html
You can download the file and use the scrollbar. Name scrollbar and textfield and Put this script into the frame where your textfield is located:
scrollbarName.target = textFieldName;
- The right of the People to create Flash movies shall not be infringed. -
-
Still need help with the line breaks and links though.
I see how you all did it, but I can't think of how to convert my code to work like that.
-
Senior Member
What is your code or your xml? If you look at the file, which I pointed to it is actually easy to insert urls. Flank your textnode with html tag (p) (/p) and then insert urls like (a href="myurl.html") and so on. Just do not call your textnode firstChild.nodeValue just firstChild, then it works. Show us your code. Here is also a tutorial you might want to look at:
http://can_info_guide.tripod.com/xml.../tutorial.html
particularly for urls.
- The right of the People to create Flash movies shall not be infringed. -
-
You can see my code above in one of my previous posts on this thread.
Everyting in my XML is structered in on string, which doesn't give me space to add text in between tags, or else they'll form submenus.
Is there a way to add links and breaks in a:
body="hello, this is my text which is displayed in a text field"
?
Problem is, when I add tags, it messes up the XML structure, because I'd have a tag within a tag.
Thanks
--iMat
-
Senior Member
It's important to get the right structure. I have only been learning myself ,in fact this is first one i have done. Based on that link above thread and a slight change it is showing links and breaks in the scrollbar component. More reading here about attributes.
http://www.w3schools.com/xml/xml_attributes.asp
Example on one of the buttons. text box named scroller (in instance panel) and text box var named xmlIn. And scroller companent named scroller.
on (press) {
myXML = new XML();
myXML.onLoad = DisplayData;
myXML.load("loadtxtXML.xml");
function DisplayData(success) {
if (success) {
scroller.html = true;
scroller.htmlText= this.body;
XMLin = this.body.childNodes[0].nodeValue;
}
}
}
Some place with some nice tutorials would be handy and explaining a bit more about XML and flash and what you can do with it and but with simple little tuts would be good. Sure thier somewhere just got to find them.
-
Senior Member
I am currently writing a basic xml tutorial how to get to nodes, attributes etc with search engine development as examples. Here are some files I made. You can see how one can integrate html in textnodes including links. I have not yet written explanation for this but you can guess.
- The right of the People to create Flash movies shall not be infringed. -
-
Japanese l337
Nice! Been looking for something like this, that gives examples of xml nodes to m ess around with. Problem is, I thinik i need to get a XML & Flash MX book so i can get more technical with it and fully understand the concepts with nodes.
consultant / contractor / designer
-
Senior Member
I finished my basic XML tutorial. Go to this thread for a link:
http://www.flashkit.com/board/showth...hreadid=450700
- The right of the People to create Flash movies shall not be infringed. -
-
Senior Member
Jolly good. I'm going to chellenge myself and try to make a family tree , based om what's in your tutorial so that i can see if i understand it corectly.
Hopefully we can incorporate a add new nodes and write them to the server xml for example a new babe is born. Then to just enter the new information ie name hair colour and date of birth in , input text filed on a web site and press sumbit to write up date the XML file on the server so it store the new information.
Though this will come later i will try and tackle the first bit which is your tutorial first.
Thanks for putting it up it looks like nice work and well done.
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
|