<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Flash Remoting 教學 2 &#8211; Pageable RecordSet</title>
	<atom:link href="http://ria.richtechmedia.com/2005/07/31/flash-remoting-%e6%95%99%e5%ad%b8-2-pageable-recordset/feed/" rel="self" type="application/rss+xml" />
	<link>http://ria.richtechmedia.com/2005/07/31/flash-remoting-%e6%95%99%e5%ad%b8-2-pageable-recordset/</link>
	<description>a dedicated Flash&#124;Flex Rich Internet Application Blog from a senior Flex RIA developer/instructor</description>
	<lastBuildDate>Sat, 13 Mar 2010 00:13:57 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: AMFphp 的简介</title>
		<link>http://ria.richtechmedia.com/2005/07/31/flash-remoting-%e6%95%99%e5%ad%b8-2-pageable-recordset/comment-page-1/#comment-176102</link>
		<dc:creator>AMFphp 的简介</dc:creator>
		<pubDate>Mon, 16 Nov 2009 06:00:03 +0000</pubDate>
		<guid isPermaLink="false">http://ria.richtechmedia.com/?p=202#comment-176102</guid>
		<description>[...] pageable recordset working examples [...]</description>
		<content:encoded><![CDATA[<p>[...] pageable recordset working examples [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jeremy</title>
		<link>http://ria.richtechmedia.com/2005/07/31/flash-remoting-%e6%95%99%e5%ad%b8-2-pageable-recordset/comment-page-1/#comment-13595</link>
		<dc:creator>jeremy</dc:creator>
		<pubDate>Tue, 13 Feb 2007 16:11:26 +0000</pubDate>
		<guid isPermaLink="false">http://ria.richtechmedia.com/?p=202#comment-13595</guid>
		<description>你有試過看看 NetConnection Debugger 裏顯示傳回值的結構嗎？

不過我很多年沒用 flash remoting + as2了，所以印象也有點模糊 Orz</description>
		<content:encoded><![CDATA[<p>你有試過看看 NetConnection Debugger 裏顯示傳回值的結構嗎？</p>
<p>不過我很多年沒用 flash remoting + as2了，所以印象也有點模糊 Orz</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: milkmidi</title>
		<link>http://ria.richtechmedia.com/2005/07/31/flash-remoting-%e6%95%99%e5%ad%b8-2-pageable-recordset/comment-page-1/#comment-13580</link>
		<dc:creator>milkmidi</dc:creator>
		<pubDate>Tue, 13 Feb 2007 09:00:08 +0000</pubDate>
		<guid isPermaLink="false">http://ria.richtechmedia.com/?p=202#comment-13580</guid>
		<description>站長，請問您一下
我已成功連線，並將資回傳
但回傳的應該是RecordSet
但RecordSet的屬性，都會抓不到值
都需要用_rs.items[0].名字才抓的到
像_rs.getLength()都會是0
_rs.getNumberAvailable()才抓的到正確的值
所以在dataProvider，值都出來來
請問我有那兒設定錯誤了嗎</description>
		<content:encoded><![CDATA[<p>站長，請問您一下<br />
我已成功連線，並將資回傳<br />
但回傳的應該是RecordSet<br />
但RecordSet的屬性，都會抓不到值<br />
都需要用_rs.items[0].名字才抓的到<br />
像_rs.getLength()都會是0<br />
_rs.getNumberAvailable()才抓的到正確的值<br />
所以在dataProvider，值都出來來<br />
請問我有那兒設定錯誤了嗎</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: milkmidi</title>
		<link>http://ria.richtechmedia.com/2005/07/31/flash-remoting-%e6%95%99%e5%ad%b8-2-pageable-recordset/comment-page-1/#comment-13578</link>
		<dc:creator>milkmidi</dc:creator>
		<pubDate>Tue, 13 Feb 2007 08:35:32 +0000</pubDate>
		<guid isPermaLink="false">http://ria.richtechmedia.com/?p=202#comment-13578</guid>
		<description>我也是之直載你的原始檔，直接執行
但一樣會出現錯誤
加了那二個參數，就可以</description>
		<content:encoded><![CDATA[<p>我也是之直載你的原始檔，直接執行<br />
但一樣會出現錯誤<br />
加了那二個參數，就可以</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: luke</title>
		<link>http://ria.richtechmedia.com/2005/07/31/flash-remoting-%e6%95%99%e5%ad%b8-2-pageable-recordset/comment-page-1/#comment-9124</link>
		<dc:creator>luke</dc:creator>
		<pubDate>Sun, 07 Jan 2007 13:51:37 +0000</pubDate>
		<guid isPermaLink="false">http://ria.richtechmedia.com/?p=202#comment-9124</guid>
		<description>你好，我按照你上面的分页程序做的时候，出现

Result: &quot;__amfphp_error&quot;

我检查了过程，好像都对的，不知道是什么问题

方便的话希望能告诉我一下，非常感谢</description>
		<content:encoded><![CDATA[<p>你好，我按照你上面的分页程序做的时候，出现</p>
<p>Result: &#8220;__amfphp_error&#8221;</p>
<p>我检查了过程，好像都对的，不知道是什么问题</p>
<p>方便的话希望能告诉我一下，非常感谢</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AXIS</title>
		<link>http://ria.richtechmedia.com/2005/07/31/flash-remoting-%e6%95%99%e5%ad%b8-2-pageable-recordset/comment-page-1/#comment-4159</link>
		<dc:creator>AXIS</dc:creator>
		<pubDate>Wed, 01 Nov 2006 07:15:29 +0000</pubDate>
		<guid isPermaLink="false">http://ria.richtechmedia.com/?p=202#comment-4159</guid>
		<description>回報!!
這個程式在php5+mysql 5.1.18的平台的遠端主機上

確定無法執行!!
(有在取回資料的語法前加上
mysql_query(&quot;SET NAMES &#039;utf8&#039;&quot;); 
        mysql_query(&quot;SET CHARACTER_SET_CLIENT=utf8&quot;); 
        mysql_query(&quot;SET CHARACTER_SET_RESULTS=utf8&quot;); 
)

最後會顯示
result--___amfphp_error</description>
		<content:encoded><![CDATA[<p>回報!!<br />
這個程式在php5+mysql 5.1.18的平台的遠端主機上</p>
<p>確定無法執行!!<br />
(有在取回資料的語法前加上<br />
mysql_query(&#8221;SET NAMES &#8216;utf8&#8242;&#8221;);<br />
        mysql_query(&#8221;SET CHARACTER_SET_CLIENT=utf8&#8243;);<br />
        mysql_query(&#8221;SET CHARACTER_SET_RESULTS=utf8&#8243;);<br />
)</p>
<p>最後會顯示<br />
result&#8211;___amfphp_error</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jason Chang</title>
		<link>http://ria.richtechmedia.com/2005/07/31/flash-remoting-%e6%95%99%e5%ad%b8-2-pageable-recordset/comment-page-1/#comment-3599</link>
		<dc:creator>jason Chang</dc:creator>
		<pubDate>Sun, 22 Oct 2006 13:36:06 +0000</pubDate>
		<guid isPermaLink="false">http://ria.richtechmedia.com/?p=202#comment-3599</guid>
		<description>請問您那如果我要作成 排名的話 我如何
排序 還有顯示名次??

感激不盡</description>
		<content:encoded><![CDATA[<p>請問您那如果我要作成 排名的話 我如何<br />
排序 還有顯示名次??</p>
<p>感激不盡</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jason Chang</title>
		<link>http://ria.richtechmedia.com/2005/07/31/flash-remoting-%e6%95%99%e5%ad%b8-2-pageable-recordset/comment-page-1/#comment-3598</link>
		<dc:creator>jason Chang</dc:creator>
		<pubDate>Sun, 22 Oct 2006 13:22:08 +0000</pubDate>
		<guid isPermaLink="false">http://ria.richtechmedia.com/?p=202#comment-3598</guid>
		<description>您好 若是我跟andy 一樣 改成
問題主要是第18行：
var pc:PendingCall = _service.getFullList([”Name”, “Region”, “Code”],1,5);
這樣 結果就可以跑出來了!!
到底為何壓??
懇請您幫我解答 謝謝</description>
		<content:encoded><![CDATA[<p>您好 若是我跟andy 一樣 改成<br />
問題主要是第18行：<br />
var pc:PendingCall = _service.getFullList([”Name”, “Region”, “Code”],1,5);<br />
這樣 結果就可以跑出來了!!<br />
到底為何壓??<br />
懇請您幫我解答 謝謝</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jason Chang</title>
		<link>http://ria.richtechmedia.com/2005/07/31/flash-remoting-%e6%95%99%e5%ad%b8-2-pageable-recordset/comment-page-1/#comment-3597</link>
		<dc:creator>jason Chang</dc:creator>
		<pubDate>Sun, 22 Oct 2006 13:17:44 +0000</pubDate>
		<guid isPermaLink="false">http://ria.richtechmedia.com/?p=202#comment-3597</guid>
		<description>以及我的php檔
conn = mysql_pconnect($this-&gt;dbhost, $this-&gt;dbuser, $this-&gt;dbpass);
		mysql_select_db( $this-&gt;dbname );

		$this-&gt;tablename = &quot;country&quot;;

		$this-&gt;methodTable = array(
			&quot;getColumnNames&quot; =&gt; array(
				&quot;description&quot; =&gt; &quot;Return column names from table&quot;,
				&quot;access&quot;      =&gt; &quot;remote&quot;,
				&quot;arguments&quot;   =&gt; array(&quot;&quot;)
			),
			&quot;getFullList&quot; =&gt; array(
				&quot;description&quot; =&gt; &quot;Return a full list of table records, pass as argument an array of columns to be returned&quot;,
				&quot;access&quot;      =&gt; &quot;remote&quot;,
				&quot;arguments&quot;   =&gt; array(&quot;arrayOfColumns&quot;),
				&quot;pagesize&quot;    =&gt; &quot;10&quot;,
			),
		);

	}


	function getColumnNames()
	{
		$query = mysql_query(sprintf(&#039;SHOW COLUMNS FROM %s&#039;, $this-&gt;tablename));
		return $query;

	}
	/*
	前面有幾個參數都沒關係，但
	最後兩個參數最重要：$offset, $limit 會被amfphp自動呼叫
	因此，整個sql語法也要用sprintf來寫。
	*/
	function getFullList($ar_col, $cursor, $limit)
	{
		//count it first
		$this-&gt;countQuery = &quot;SELECT COUNT(*) AS recordCount FROM country&quot;;
		//
		return mysql_query(sprintf(&quot;select * FROM %s ORDER BY Name ASC Limit %d, %d&quot;, $this-&gt;tablename,$cursor,$limit));
	}
	/*
	所有需要 分頁 的function, 都要加上這個 _count，讓amfphp自動去呼叫
	
	*/
	function getFullList_count(){
		$q = mysql_query($this-&gt;countQuery);
		$row = mysql_fetch_assoc($q);
		return $row[&#039;recordCount&#039;];
	}
/*
@author: jeremy@richtechmedia.com
@website: http://ria.richtechmedia.com
released under CC 2.5.
*/	
}
?&gt;</description>
		<content:encoded><![CDATA[<p>以及我的php檔<br />
conn = mysql_pconnect($this-&gt;dbhost, $this-&gt;dbuser, $this-&gt;dbpass);<br />
		mysql_select_db( $this-&gt;dbname );</p>
<p>		$this-&gt;tablename = &#8220;country&#8221;;</p>
<p>		$this-&gt;methodTable = array(<br />
			&#8220;getColumnNames&#8221; =&gt; array(<br />
				&#8220;description&#8221; =&gt; &#8220;Return column names from table&#8221;,<br />
				&#8220;access&#8221;      =&gt; &#8220;remote&#8221;,<br />
				&#8220;arguments&#8221;   =&gt; array(&#8221;")<br />
			),<br />
			&#8220;getFullList&#8221; =&gt; array(<br />
				&#8220;description&#8221; =&gt; &#8220;Return a full list of table records, pass as argument an array of columns to be returned&#8221;,<br />
				&#8220;access&#8221;      =&gt; &#8220;remote&#8221;,<br />
				&#8220;arguments&#8221;   =&gt; array(&#8221;arrayOfColumns&#8221;),<br />
				&#8220;pagesize&#8221;    =&gt; &#8220;10&#8243;,<br />
			),<br />
		);</p>
<p>	}</p>
<p>	function getColumnNames()<br />
	{<br />
		$query = mysql_query(sprintf(&#8217;SHOW COLUMNS FROM %s&#8217;, $this-&gt;tablename));<br />
		return $query;</p>
<p>	}<br />
	/*<br />
	前面有幾個參數都沒關係，但<br />
	最後兩個參數最重要：$offset, $limit 會被amfphp自動呼叫<br />
	因此，整個sql語法也要用sprintf來寫。<br />
	*/<br />
	function getFullList($ar_col, $cursor, $limit)<br />
	{<br />
		//count it first<br />
		$this-&gt;countQuery = &#8220;SELECT COUNT(*) AS recordCount FROM country&#8221;;<br />
		//<br />
		return mysql_query(sprintf(&#8221;select * FROM %s ORDER BY Name ASC Limit %d, %d&#8221;, $this-&gt;tablename,$cursor,$limit));<br />
	}<br />
	/*<br />
	所有需要 分頁 的function, 都要加上這個 _count，讓amfphp自動去呼叫</p>
<p>	*/<br />
	function getFullList_count(){<br />
		$q = mysql_query($this-&gt;countQuery);<br />
		$row = mysql_fetch_assoc($q);<br />
		return $row['recordCount'];<br />
	}<br />
/*<br />
@author: <a href="mailto:jeremy@richtechmedia.com">jeremy@richtechmedia.com</a><br />
@website: <a href="http://ria.richtechmedia.com" rel="nofollow">http://ria.richtechmedia.com</a><br />
released under CC 2.5.<br />
*/<br />
}<br />
?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jason Chang</title>
		<link>http://ria.richtechmedia.com/2005/07/31/flash-remoting-%e6%95%99%e5%ad%b8-2-pageable-recordset/comment-page-1/#comment-3596</link>
		<dc:creator>jason Chang</dc:creator>
		<pubDate>Sun, 22 Oct 2006 13:16:54 +0000</pubDate>
		<guid isPermaLink="false">http://ria.richtechmedia.com/?p=202#comment-3596</guid>
		<description>以下是我的.as
import mx.remoting.Service;
import mx.remoting.PendingCall;
import mx.remoting.RecordSet;
import mx.remoting.debug.NetDebug;
import mx.rpc.RelayResponder;
import mx.rpc.ResultEvent;
import mx.rpc.FaultEvent;
import mx.events.*;
//start debugging so we can see debug info in NCD.
NetDebug.initialize();
//setting gateway
var gateway:String = &quot;http://localhost/yoyo/flashservices/amfphp/gateway.php&quot;;
respGeneral = new RelayResponder(this, &quot;contactReceived&quot;, &quot;contactFailure&quot;);
_service = new Service(gateway, null, &quot;PRecordSet&quot;, null, respGeneral);
//
var pc:PendingCall = _service.getFullList([&quot;Name&quot;, &quot;Region&quot;, &quot;Code&quot;]);
//
dg.columnNames = [&quot;Code&quot;, &quot;Name&quot;, &quot;Continent&quot;];
//
function contactReceived(re:ResultEvent):Void{
	var tmp:RecordSet = RecordSet(re.result);
	tmp.setDeliveryMode(&quot;page&quot;, 10, 2);
	dg.dataProvider = tmp;
};
//
btnRefresh.clickHandler = function(){
	dg.removeAll();
	var pc:PendingCall = _service.getFullList([&quot;Name&quot;, &quot;Region&quot;, &quot;Code&quot;]);
}</description>
		<content:encoded><![CDATA[<p>以下是我的.as<br />
import mx.remoting.Service;<br />
import mx.remoting.PendingCall;<br />
import mx.remoting.RecordSet;<br />
import mx.remoting.debug.NetDebug;<br />
import mx.rpc.RelayResponder;<br />
import mx.rpc.ResultEvent;<br />
import mx.rpc.FaultEvent;<br />
import mx.events.*;<br />
//start debugging so we can see debug info in NCD.<br />
NetDebug.initialize();<br />
//setting gateway<br />
var gateway:String = &#8220;http://localhost/yoyo/flashservices/amfphp/gateway.php&#8221;;<br />
respGeneral = new RelayResponder(this, &#8220;contactReceived&#8221;, &#8220;contactFailure&#8221;);<br />
_service = new Service(gateway, null, &#8220;PRecordSet&#8221;, null, respGeneral);<br />
//<br />
var pc:PendingCall = _service.getFullList(["Name", "Region", "Code"]);<br />
//<br />
dg.columnNames = ["Code", "Name", "Continent"];<br />
//<br />
function contactReceived(re:ResultEvent):Void{<br />
	var tmp:RecordSet = RecordSet(re.result);<br />
	tmp.setDeliveryMode(&#8221;page&#8221;, 10, 2);<br />
	dg.dataProvider = tmp;<br />
};<br />
//<br />
btnRefresh.clickHandler = function(){<br />
	dg.removeAll();<br />
	var pc:PendingCall = _service.getFullList(["Name", "Region", "Code"]);<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
