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
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!
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
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 .
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.
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&ltid=28&eid=314046&rank=1 &atid=35&total_ads=3&rmid=1&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&ltid=28&eid=314046&rank=1 &atid=35&total_ads=3&rmid=1&brand= synd_test" ></url> <url type="profile" text="Overview" click_url="http://pfp.citysearch.com/url/?aid=2032104&ltid=profile&eid=314046&r ank=1&atid=35&total_ads=3&rmid=1&b rand=synd_test" ></url> <url type="ad_bullet_1" text="Extraordinary Service" click_url="http://pfp.citysearch.com/url/?aid=2032104&ltid=25&eid=314046&rank=1 &atid=35&total_ads=3&rmid=1&brand= synd_test" ></url> <url type="ad_bullet_2" text="Take Out & Delivery" click_url="http://pfp.citysearch.com/url/?aid=2032104&ltid=26&eid=314046&rank=1 &atid=35&total_ads=3&rmid=1&brand= synd_test" ></url> <url type="ad_bullet_3" text="Delicious Dishes" click_url="http://pfp.citysearch.com/url/?aid=2032104&ltid=27&eid=314046&rank=1 &atid=35&total_ads=3&rmid=1&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&ltid=30&eid=314046&rank=1 &atid=35&total_ads=3&rmid=1&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&ltid=28&eid=157680&rank=2& amp;atid=35&total_ads=3&rmid=1&brand=s ynd_test" ></url> <url type="tagline" text="Authentic Thai-Chinese Cuisine &amp; Sushi Bar" click_url="http://pfp.citysearch.com/url/?aid=961977&ltid=28&eid=157680&rank=2& amp;atid=35&total_ads=3&rmid=1&brand=s ynd_test" ></url> <url type="profile" text="Overview" click_url="http://pfp.citysearch.com/url/?aid=961977&ltid=profile&eid=157680&ra nk=2&atid=35&total_ads=3&rmid=1&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&ltid=36&eid=157680&rank=2& amp;atid=35&total_ads=3&rmid=1&brand=s ynd_test" ></url> <url type="website_link" text="www.yangtzerestaurant.com" click_url="http://pfp.citysearch.com/url/?aid=961977&ltid=30&eid=157680&rank=2& amp;atid=35&total_ads=3&rmid=1&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&ltid=28&eid=163661&rank=3 &atid=35&total_ads=3&rmid=1&brand= synd_test" ></url> <url type="tagline" text="L.A.'s Premier Pan-Asian Restaurant" click_url="http://pfp.citysearch.com/url/?aid=2089272&ltid=28&eid=163661&rank=3 &atid=35&total_ads=3&rmid=1&brand= synd_test" ></url> <url type="profile" text="Overview" click_url="http://pfp.citysearch.com/url/?aid=2089272&ltid=profile&eid=163661&r ank=3&atid=35&total_ads=3&rmid=1&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&ltid=25&eid=163661&rank=3 &atid=35&total_ads=3&rmid=1&brand= synd_test" ></url> <url type="ad_bullet_2" text="SUNDAY BRUNCH" click_url="http://pfp.citysearch.com/url/?aid=2089272&ltid=26&eid=163661&rank=3 &atid=35&total_ads=3&rmid=1&brand= synd_test" ></url> <url type="ad_bullet_3" text="Enjoy breathtaking views" click_url="http://pfp.citysearch.com/url/?aid=2089272&ltid=27&eid=163661&rank=3 &atid=35&total_ads=3&rmid=1&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&ltid=36&eid=163661&rank=3 &atid=35&total_ads=3&rmid=1&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.
Senior Member
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...
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
Senior Member
I got it working baby!! thanx 2 Chris Sehorn... I owe u 1 big-time....
up to my .as in code
Glad it worked out
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