A Flash Developer Resource Site

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

Thread: hyperlinks in XML...?

  1. #21
    Senior Member
    Join Date
    Jan 2001
    Location
    Copenhagen
    Posts
    192
    Ok, I've included a simple version of the xml I made. Now there's only the textfield with the link in it. You might see some code leftover from the original file, but I've managed to remove most of it.

    Have you used xml before in flash? If not, things might seem a bit difficult but just let me know and I'll try to explain.

    Regards
    Michael
    Attached Files Attached Files

  2. #22
    Junior Member
    Join Date
    Mar 2006
    Posts
    12
    Thanks so much! I wrote mine completely differently:

    http://board.flashkit.com/board/showthread.php?t=687846

    I just keep running into a bunch of different ways to do it from Xlink to CDATA and none seem to be working for me. I've used XML before in Flash, but it's usually been pretty basic stuff. I'm trying to see how I can get your example to work in my file and/or vice versa. Thanks again!

  3. #23
    Senior Member
    Join Date
    Jan 2001
    Location
    Copenhagen
    Posts
    192
    Yeah, I can see that. Hopefully you'll be able to use the file I've included. If not, just let me know.

    Good luck
    Michael

  4. #24
    Junior Member
    Join Date
    Jun 2006
    Posts
    7
    is there a way to make a link in XML by using components rather than a dynamic text box?

    I'm using flash 8, and the XML CONNECTOR to call my xml file and bind all my components.

    I've created an employee database that has:

    1 list box
    2 text area components


    in the list box, names are generated from the xml...

    once you click on a name, the 2 text area components are populated

    With in these text area components are the populated fields: 'website' and 'email'


    right now they are populated in the format: http://www.blah5645blah.com / info@blah4535blah.com

    The boxes populate, but I dont know how to make them a link.

    Does it require me to add actionscript and/or a hyperlink cell renderer? or is the solution within the XML file?


    also...these text area components both have the HTML option set to 'TRUE'

    -----
    Last edited by ken_sino; 06-21-2006 at 05:48 PM.

  5. #25
    Member
    Join Date
    Nov 2006
    Posts
    53
    Another followup for those who have trouble:

    I was trying all of these methods to no avail for an hour or so to no avail. but once I turned off font embedding worked like a charm.

  6. #26
    Junior Member
    Join Date
    Nov 2006
    Posts
    18

    I sorta cheated....

    My BLOATED xml - I called it citysearch.xml - (Thanks to Citysearch)

    <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE ads PUBLIC "" "http://pfp.citysearch.com/schema/partner/1.0.0/CitysearchPFPResults.dtd"><ads xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://pfp.citysearch.com/schema/partner/1.0.0/CitysearchPFPResults.xsd"> <ad rank="1" address_line_1="230 N San Fernando Blvd" city="Burbank" state="CA" postal_code="91502" image_link="http://a1004.g.akamaitech.net/7/1004/33/d3eac684cd2687/images.citysearch.com/sys/ad_images/e2/7c/V-LOSCA-55078677_ID134890_pfp_image.gif" cpc="0" > <urls> <url type="business_name" text="Gourmet 88" click_url="http://pfp.citysearch.com/url/?aid=2032104&amp;ltid=28&amp;eid=314046&amp;rank=1 &amp;atid=35&amp;total_ads=3&amp;rmid=1&amp;brand= synd_test" ></url> <url type="tagline" text="10th Century Chinese Cuisine With A Californian Twist" click_url="http://pfp.citysearch.com/url/?aid=2032104&amp;ltid=28&amp;eid=314046&amp;rank=1 &amp;atid=35&amp;total_ads=3&amp;rmid=1&amp;brand= synd_test" ></url> <url type="profile" text="Overview" click_url="http://pfp.citysearch.com/url/?aid=2032104&amp;ltid=profile&amp;eid=314046&amp;r ank=1&amp;atid=35&amp;total_ads=3&amp;rmid=1&amp;b rand=synd_test" ></url> <url type="ad_bullet_1" text="Extraordinary Service" click_url="http://pfp.citysearch.com/url/?aid=2032104&amp;ltid=25&amp;eid=314046&amp;rank=1 &amp;atid=35&amp;total_ads=3&amp;rmid=1&amp;brand= synd_test" ></url> <url type="ad_bullet_2" text="Take Out &amp; Delivery" click_url="http://pfp.citysearch.com/url/?aid=2032104&amp;ltid=26&amp;eid=314046&amp;rank=1 &amp;atid=35&amp;total_ads=3&amp;rmid=1&amp;brand= synd_test" ></url> <url type="ad_bullet_3" text="Delicious Dishes" click_url="http://pfp.citysearch.com/url/?aid=2032104&amp;ltid=27&amp;eid=314046&amp;rank=1 &amp;atid=35&amp;total_ads=3&amp;rmid=1&amp;brand= synd_test" ></url> <url type="editorial_tagline" ></url> <url type="website_link" text="www.gourmet88.com" click_url="http://pfp.citysearch.com/url/?aid=2032104&amp;ltid=30&amp;eid=314046&amp;rank=1 &amp;atid=35&amp;total_ads=3&amp;rmid=1&amp;brand= synd_test" ></url> <url type="offer" ></url> </urls> </ad> <ad rank="2" address_line_1="1333 3RD St Promenade" city="Santa Monica" state="CA" postal_code="90401" image_link="http://a1932.g.akamaitech.net/7/1932/33/7a1708a6bd2778/images.citysearch.com/sys/ad_images/64/5c/V-LOSCA-55051635_ID71837_pfp_image.gif" cpc="0" > <urls> <url type="business_name" text="Yangtze Restaurant" click_url="http://pfp.citysearch.com/url/?aid=961977&amp;ltid=28&amp;eid=157680&amp;rank=2& amp;atid=35&amp;total_ads=3&amp;rmid=1&amp;brand=s ynd_test" ></url> <url type="tagline" text="Authentic Thai-Chinese Cuisine &amp;amp; Sushi Bar" click_url="http://pfp.citysearch.com/url/?aid=961977&amp;ltid=28&amp;eid=157680&amp;rank=2& amp;atid=35&amp;total_ads=3&amp;rmid=1&amp;brand=s ynd_test" ></url> <url type="profile" text="Overview" click_url="http://pfp.citysearch.com/url/?aid=961977&amp;ltid=profile&amp;eid=157680&amp;ra nk=2&amp;atid=35&amp;total_ads=3&amp;rmid=1&amp;br and=synd_test" ></url> <url type="ad_bullet_1" ></url> <url type="ad_bullet_2" ></url> <url type="ad_bullet_3" ></url> <url type="editorial_tagline" text="Third Street shoppers take a break at this contemporary Chinese, Thai and Japanese restaurant. Half-priced sushi at the bar, free delivery." click_url="http://pfp.citysearch.com/url/?aid=961977&amp;ltid=36&amp;eid=157680&amp;rank=2& amp;atid=35&amp;total_ads=3&amp;rmid=1&amp;brand=s ynd_test" ></url> <url type="website_link" text="www.yangtzerestaurant.com" click_url="http://pfp.citysearch.com/url/?aid=961977&amp;ltid=30&amp;eid=157680&amp;rank=2& amp;atid=35&amp;total_ads=3&amp;rmid=1&amp;brand=s ynd_test" ></url> <url type="offer" ></url> </urls> </ad> <ad rank="3" address_line_1="3221 Donald Douglas Loop S" city="Santa Monica" state="CA" postal_code="90405" image_link="http://a620.g.akamaitech.net/7/620/33/88f04dce3848f1/images.citysearch.com/sys/ad_images/47/74/V-LOSCA-55082840_ID146981_pfp_image.gif" cpc="0" > <urls> <url type="business_name" text="TYPHOON" click_url="http://pfp.citysearch.com/url/?aid=2089272&amp;ltid=28&amp;eid=163661&amp;rank=3 &amp;atid=35&amp;total_ads=3&amp;rmid=1&amp;brand= synd_test" ></url> <url type="tagline" text="L.A.&apos;s Premier Pan-Asian Restaurant" click_url="http://pfp.citysearch.com/url/?aid=2089272&amp;ltid=28&amp;eid=163661&amp;rank=3 &amp;atid=35&amp;total_ads=3&amp;rmid=1&amp;brand= synd_test" ></url> <url type="profile" text="Overview" click_url="http://pfp.citysearch.com/url/?aid=2089272&amp;ltid=profile&amp;eid=163661&amp;r ank=3&amp;atid=35&amp;total_ads=3&amp;rmid=1&amp;b rand=synd_test" ></url> <url type="ad_bullet_1" text="Wedding or other Special Event" click_url="http://pfp.citysearch.com/url/?aid=2089272&amp;ltid=25&amp;eid=163661&amp;rank=3 &amp;atid=35&amp;total_ads=3&amp;rmid=1&amp;brand= synd_test" ></url> <url type="ad_bullet_2" text="SUNDAY BRUNCH" click_url="http://pfp.citysearch.com/url/?aid=2089272&amp;ltid=26&amp;eid=163661&amp;rank=3 &amp;atid=35&amp;total_ads=3&amp;rmid=1&amp;brand= synd_test" ></url> <url type="ad_bullet_3" text="Enjoy breathtaking views" click_url="http://pfp.citysearch.com/url/?aid=2089272&amp;ltid=27&amp;eid=163661&amp;rank=3 &amp;atid=35&amp;total_ads=3&amp;rmid=1&amp;brand= synd_test" ></url> <url type="editorial_tagline" text="Fried insects and flying machines invert nature at this Santa Monica Airport roost." click_url="http://pfp.citysearch.com/url/?aid=2089272&amp;ltid=36&amp;eid=163661&amp;rank=3 &amp;atid=35&amp;total_ads=3&amp;rmid=1&amp;brand= synd_test" ></url> <url type="website_link" ></url> <url type="offer" ></url> </urls> </ad></ads>

    Actionscript I modded and made up too:


    function loadXML(loaded) {
    if (loaded) {
    _root.business1 = this.firstChild.childNodes[0].childNodes[0].childNodes[0].attributes.text;
    _root.tagline1 = this.firstChild.childNodes[0].childNodes[0].childNodes[1].attributes.text;
    _root.location1 = this.firstChild.childNodes[0].childNodes[0].childNodes[1].attributes.click_url;
    _root.business2 = this.firstChild.childNodes[1].childNodes[0].childNodes[0].attributes.text;
    _root.tagline2 = this.firstChild.childNodes[1].childNodes[0].childNodes[1].attributes.text;
    _root.location2 = this.firstChild.childNodes[1].childNodes[0].childNodes[1].attributes.click_url;
    _root.business3 = this.firstChild.childNodes[2].childNodes[0].childNodes[0].attributes.text;
    _root.tagline3 = this.firstChild.childNodes[2].childNodes[0].childNodes[1].attributes.text;
    _root.location3 = this.firstChild.childNodes[2].childNodes[0].childNodes[1].attributes.click_url;
    biz1.text = _root.business1;
    tag1.text = _root.tagline1;
    url1.text = _root.location1;
    biz2.text = _root.business2;
    tag2.text = _root.tagline2;
    url2.text = _root.location2;
    biz3.text = _root.business3;
    tag3.text = _root.tagline3;
    url3.text = _root.location3;
    } else {
    trace("file not loaded!");
    }
    }
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    xmlData.load("citysearch.xml");

    THEN I MADE BUTTONS TO GO ON TOP WITH ALPHA OF 0

    on (release) {
    getURL(_root.location1, "_blank");
    }

    on (release) {
    getURL(_root.location2, "_blank");
    }

    on (release) {
    getURL(_root.location3, "_blank");
    }

    Just make sure you turn on EXPRESSION in the getURL or it won't work.

  7. #27
    Senior Member Flamboyant Flasher's Avatar
    Join Date
    Dec 2001
    Posts
    1,253
    Does any one have a working fla. and xml file that shows how to create hyperlinks in the xml file? That would be grand and unquestionably appreciated...

  8. #28
    Member
    Join Date
    Nov 2006
    Posts
    53
    I can't upload an XML file so you'll have to use this link:
    http://www.chron.com/content/chronic.../johnmayer.xml

    FLA is attached.
    Attached Files Attached Files

  9. #29
    Senior Member Flamboyant Flasher's Avatar
    Join Date
    Dec 2001
    Posts
    1,253
    I got it working baby!! thanx 2 Chris Sehorn... I owe u 1 big-time....

  10. #30

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