dcsimg
A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 26 of 26

Thread: hyperlinks in xml data?

  1. #21

    solution?

    did u find a solution bytemonster ???

    cheers
    alex

  2. #22
    Member
    Join Date
    Oct 2000
    Location
    Los Angeles
    Posts
    71
    ok, here's what I did. All the xml info is in nodes, including the url. I could never get more than 128 characters out of the html href link in the xml, so I put a button over the text box, imported the url as a variable into the getURL function and it worked fine with some tweeking. You can see the temporary results at http://micasa.bytemonster.com. I'm still working on the sections.
    ---------------
    bytemonster

  3. #23
    Member
    Join Date
    Jan 2003
    Location
    Australia, Adelaide (SA)
    Posts
    97
    Hi all,

    In regards to the 128 character limit on links, there is a reasonably simple workaround.

    In your XML, you will need to store your links seperately, and give each one a unique ID, eg:
    PHP Code:
    <FILM>
      <
    LINKS>
        <
    LINK id="link1" href="http://weblogs.asp.net/TWalters/?bigString=0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789" target="_blank" />
      </
    LINKS>
      <
    TITLE>
        <
    font color="#0000FF">
          <
    a href="asfunction:openLink,link1">About Schmidt</a>
        </
    font>
      </
    TITLE>
      <
    CLIENT>New Line Cinema</CLIENT>
      <
    PROJECT>Mixing and Mastering in 5.1 2.0</PROJECT>
    </
    FILM
    Now, when you render this it will look fine, but the link won't do anything, so you need to add this magic little function to your code:
    code:

    function openLink( linkID )
    {
    // assuming the XML document is 'xmlFilms'
    var xmlLinkNode = xmlFilms[ linkID ];
    getURL( xmlLinkNode.attributes.href, xmlLinkNode.attributes.target );
    }


    This works because the getURL method isn't limited by the 128 character restriction.

    Let me know if you have any troubles getting this to work.

    Hope this helps!
    Tim Walters
    Senior Developer
    XML Evangelist
    "XML isn't a language, it's a way of life!"

  4. #24
    Member
    Join Date
    Oct 2000
    Location
    Los Angeles
    Posts
    71
    Thanks I'll give that a try and let you know how it goes.
    ---------------
    bytemonster

  5. #25
    could you put the fla/xml files online so i can look at the code as i want to use this for my portfolio section?

    thanks
    a

  6. #26
    Junior Member
    Join Date
    Oct 2003
    Posts
    1
    okay.... I have read this thread and tried to make links working with plain xml, but in vain.

    My code goes like this:
    PHP Code:
    <Lista>
     <
    DVD>
      <
    Ostovuosi>2003</Ostovuosi>
      <
    Genre>Toiminta</Genre>
      <
    Nimi>Testi</Nimi>
      <
    Region>R2</Region>
      <
    Arvostelu></Arvostelu>
     </
    DVD>
    </
    Lista
    Now that last element Arvostelu. I would like to include link and image on that and by clicking that image it would open review-site of that DVD.

    Now I have tried for example this to make even that link working:
    PHP Code:
    <Arvostelu><a href="http://whateverdvd.com">DVD</a></Arvostelu>

    also this

    <Arvostelu href="http://whateverdvd.com">DVD</Arvostelu
    Nothing happens... I can't see DVD-text on that Arvostelu column.

    My old design can be seen in here: DVD-list

    If you view source, you can see how "messy" it is... so it would be far more easier to update my dvd-list by using xml.

    any ideas how to get links working and that little review image?

    Thank for advance
    Last edited by Mikaq; 10-25-2003 at 11:20 AM.

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