用Flash制作Google搜索程序( 三 )


on (click) {
var onGoogleSearch = function()
{
// 当不搜索的时候显示进度棒图
_root.application.frmSearch.frmLoading.visible = true;
this._parent.txtResults.text = "";
this._parent.lblSearchTime.text = "";
this.enabled = false;
this._parent.txtQuery.enabled = false;
}
var onGoogleSearchResult = function()
{
var res = this._parent.GoogleSearch.results.resultElements; // shorthand
for (var i = 0; i < res.length; i)
{
var s = "";
s= ""
res[i].title"
>lt;/a>";
s= res[i].snippet"";
if (res[i].summary != "") { s= "Description:"
res[i].summary"";
}
s= "color="#009900">"res[i].URL"
- "res[i].cachedSize;
s= "";
this._parent.txtResults.text= s;
}
// 当再次搜索时隐藏进度棒
_root.application.frmSearch.frmLoading.visible = false;
this.enabled = true;
this._parent.txtQuery.enabled = true;
}
// 触发数据源行为
// Macromedia 2003
this._parent.GoogleSearch.addEventListener("send", onGoogleSearch);
this._parent.GoogleSearch.addEventListener("result", onGoogleSearchResult);
this._parent.GoogleSearch.trigger();
}

现在准备去发布你的应用程序.选择File > Publish或者按Control-Enter 去用默认的设置发布 。
现在去试你的Google搜索吧!



推荐阅读