A Flash Developer Resource Site

+ Reply to Thread
Results 1 to 10 of 10

Thread: Scrolling XML

  1. #1
    Junior Member
    Join Date
    Jul 2000
    Posts
    9
    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

  2. #2
    Junior Member
    Join Date
    Apr 2001
    Posts
    4

    ???

    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

  3. #3
    Junior Member
    Join Date
    Jul 2000
    Posts
    9
    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

  4. #4
    Junior Member
    Join Date
    Aug 2000
    Posts
    8

    uh....

    cant you just parse the XML and populate a variable?

  5. #5
    Junior Member
    Join Date
    Jul 2000
    Posts
    9

    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

  6. #6
    Junior Member
    Join Date
    Sep 2000
    Posts
    17
    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

  7. #7
    Junior Member
    Join Date
    Jul 2000
    Posts
    9
    [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.

  8. #8
    Junior Member
    Join Date
    Jul 2000
    Posts
    9

    resolved

    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

  9. #9
    Junior Member
    Join Date
    Sep 2000
    Posts
    17
    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

  10. #10
    Junior Member
    Join Date
    Jul 2000
    Posts
    9
    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




Click Here to Expand Forum to Full Width


HTML5 Development Center