List Info

Thread: Simple Actionscript Example




Simple Actionscript Example
user name
2006-05-07 10:27:17
I found the included Actionscript example far to complicated
to be of
any use understanding how to access the API so here's a
very very
simple example.

search is a button component.
tag is a text component.

yahoo =
"http://api.search.yahoo.com
/WebSearchService/V1/webSearch?appid=youridhere&query=";

yxml = new XML ();
yxml.ignoreWhite = true;

yxml.onLoad = function (sucess) {
	if (sucess) {
		//trace(xml);
		//trace(yxml.firstChild.firstChild.childNodes[0].firstChil
d.nodeValue);
		//trace(yxml.firstChild.attributes.totalResultsAvailable);
		for (var n = 0; n < yxml.firstChild.childNodes.length;
n ++) {
			thistitle =
yxml.firstChild.childNodes[n].childNodes[0].firstChild.nodeV
alue;
			thissummary =
yxml.firstChild.childNodes[n].childNodes[1].firstChild.nodeV
alue;
			thisurl =
yxml.firstChild.childNodes[n].childNodes[2].firstChild.nodeV
alue;
			trace(thisurl);
		}
	} else {
		trace("http error");
	}
}

search.onRelease = function() {
	thisurl = yahoo + tag.text;
	//trace(thisurl);
	yxml.load(thisurl);
}








------------------------ Yahoo! Groups Sponsor
--------------------~--> 
Get to your groups with one click. Know instantly when new
email arrives
http://us.click.yahoo.com/.7bhrC/MGxNAA/yQLSAA/QNArlB/TM

------------------------------------------------------------
--------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://
groups.yahoo.com/group/yws-search-web/

<*> To unsubscribe from this group, send an email to:
    yws-search-web-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 



[1]

about | contact  Other archives ( Real Estate discussion Medical topics )