|
-
I have been trying for a few days now to scroll a text field that is based on a xml document. The scrolling seems to work fine when the text field is populated from a variable, but it does not work from xml. I receive no erros of any kind so I'm clueless of what is actually happening can you please help? Thanks Webguy
-
???
Please post more details about a problem when requesting help or information (code blocks, etc). What have you read that has been either helpful or confusing?
scott
http://www.figital.com
-
ok.. here it is..
Code on Text field
//var text = " blah blah blah,,,,,,,,,,,,"
xml1 = new XML();
xml1.onLoad = myOnLoad;
xml1.load("lo.xml");
function myOnLoad (success) {
if (success)
{Text = xml1;}}
code on button
on (release) {set("text.scroll", text.scroll - 1);}
so basically what I want to do is load an xml file into an scrollable text field it works for the var text, but not for the xml load....
Thanks for the help
-
uh....
cant you just parse the XML and populate a variable?
-
Re: uh....
Originally posted by marigold
cant you just parse the XML and populate a variable?
How can you parse it? What will be the advantage of that?
Thanks
-
The advantage in parsing it would be to display only the elements of the XML file you want to display and to format it so it looks all nice and pretty.
Grab the flash slashdot news reader. Believe it is on flashkit so you can take a look at how it parses the slashdot xml file and formats it to look all nice. It even has a useful working scrollbar too.
-Hythian
-----
Quit Slashdot Today! ( not my site, but I like it )
http://www.cs.washington.edu/homes/k.../slashdot.html
-
[QUOTE]Originally posted by Hythian
[B]The advantage in parsing it would be to display only the elements of the XML file you want to display and to format it so it looks all nice and pretty.
Grab the flash slashdot news reader. Believe it is on flashkit so you can take a look at how it parses the slashdot xml file and formats it to look all nice. It even has a useful working scrollbar too.
-Hythian
QUOTE]
Thanks.. I put a search on for the "flash slashdot news reader" and I could not find it. Do you know where it is. Thanks for your help.
-
I see the parse fuction but hoe do I actually parse the xml code. The online help on the parse function is not very useful. Can anyone give me an example on parsing. ALso does the format of the xml file matters when it comes to parsing? For example an xml file file that has multiple elements as opposed to one without out any.
Thanks
-
http://www.figleaf.com/development/flash5/
The stand-alone slashdot news reader there is the Flash5 xml application I was talking about. A simple little piece of code where it loads an xml file, displays it on screen, and has a scrollbar for you to scroll the display with.
XML.load(url) loads a file external to the movie and parses the file for you.
XML.parseXML(source) takes a source variable or string and parses that for you.
Back to your original question of why the scrolling doesn't work with the XML object being sent to the text field is because you need to populate the text field with a string, and not an XML object. So use XML.toString() to get a string representation of the XML object, and send that to the text field.
-Hythian
-
It worked Thanks for your help.....
Thanks...
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
|