A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Active URLs read from xml file into scrollbar

  1. #1
    Member
    Join Date
    Jan 2003
    Posts
    54

    Active URLs read from xml file into scrollbar

    I'm trying to read text from an xml file which also includes active url links in a scrollbar.

    For example if you go to www.chadtastic.com (don't mind the strange pictures) and click on The "Red" Barrett. You'll see how the text is read from an xml file, put into a scrollbar along with an active link.

    I can do all of that except I can only display the links as plain text and not active urls. Please advise.
    Thanks.

  2. #2
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    Here is an example of making the links 'real'

    http://tupps.com/flash/examples/load.../demoText.html

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  3. #3
    Member
    Join Date
    Jan 2003
    Posts
    54
    That was EXACTLY what I needed. Thanks a ton, Tupps!

  4. #4
    Member
    Join Date
    Jan 2003
    Posts
    54
    Actually I got a slight problem:

    Here's the xml:

    <a href="http://www.microflash.ca/prjtest.xml">http://www.microflash.ca/prjtest.xml</a>

    Here's the same function provided in your fla file only I've added if statements depending on which button is pressed to change the variable _root.chosen

    Code:
    function DisplayData(success) {
    	if (success) {
    
    		if (_root.chosen == "firstproject") {
    			_root.projectdescriptions.textbox.prjbox = this.firstproject.childNodes.join('').split('<a ').join('<font color="#3333ff"><u><a ').split('</a>').join('</a></u></font>');
    		}
    
    		if (_root.chosen == "secondproject") {
    			_root.projectdescriptions.textbox.prjbox = this.secondproject.childNodes.join('').split('<a ').join('<font color="#3333ff"><u><a ').split('</a>').join('</a></u></font>');
    		}
    
    	}
    
    }
    My problem is when I click the button which assigns (_root.chosen = "firstproject") it works and displays the information contained in the xml file on my textbox.
    But when I click the button which assigns (_root.chosen = "secondproject") I get 'undefined' and nothing else.

    Anyone know why it does that? Please advise, thanks.

  5. #5
    Member
    Join Date
    Jan 2003
    Posts
    54
    Here is the sample file to show the problem:
    http://www.microflash.ca/temp/prjtest.zip

    In the first frame of the main timeline. If you change the variable _root.chosen = "secondproject"
    to
    _root.chosen = "firstproject"

    You'll see that it works.

    Now change it back to
    _root.chosen = "secondproject"

    and you'll see that it's undefined.

    Please help. Thanks.
    Attached Files Attached Files

  6. #6
    Member
    Join Date
    Jan 2003
    Posts
    54
    Anyone? Thanks.

  7. #7
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    First things first you need to close your BR tags, this is the message that Safari gives me when I open your XML file:

    PHP Code:
    This page contains the following errors:

    error on line 9 at column 52Opening and ending tag mismatchbr line 0 and project1
    Below is a rendering of the page up to the first error
    .

    This is the first project 
    www
    .firstproject.com 
    You should use
    HTML Code:
    <br />
    check it with any browser pretty much all of them do XML validation and will display your xml file marked up if you get it right.

    See what happens after that.


    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  8. #8
    Member
    Join Date
    Jan 2003
    Posts
    54
    *salutes Luke*

    i forgot how many boards i posted about this in the last 2 days and got no replies.
    honestly i don't know what i would have done without your help.

    thank you very much.

    daniel

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