<?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: Central: Paging 1, onEnterFrame 0, while 0 + Tip	</title>
	<atom:link href="https://jessewarden.com/2003/12/central-paging-1-onenterframe-0-while-0-tip.html/feed" rel="self" type="application/rss+xml" />
	<link>https://jessewarden.com/2003/12/central-paging-1-onenterframe-0-while-0-tip.html</link>
	<description>Software &#124; Fitness &#124; Gaming</description>
	<lastBuildDate>Sat, 13 Dec 2003 00:40:07 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: Kenny Bunch		</title>
		<link>https://jessewarden.com/2003/12/central-paging-1-onenterframe-0-while-0-tip.html/comment-page-1#comment-1113</link>

		<dc:creator><![CDATA[Kenny Bunch]]></dc:creator>
		<pubDate>Sat, 13 Dec 2003 00:40:07 +0000</pubDate>
		<guid isPermaLink="false">http://jessewarden.com/?p=356#comment-1113</guid>

					<description><![CDATA[totally forgot the increment iterator for the loop on the last post. with it, it actually goes slow.
]]></description>
			<content:encoded><![CDATA[<p>totally forgot the increment iterator for the loop on the last post. with it, it actually goes slow.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Kenny Bunch		</title>
		<link>https://jessewarden.com/2003/12/central-paging-1-onenterframe-0-while-0-tip.html/comment-page-1#comment-1112</link>

		<dc:creator><![CDATA[Kenny Bunch]]></dc:creator>
		<pubDate>Fri, 12 Dec 2003 23:31:07 +0000</pubDate>
		<guid isPermaLink="false">http://jessewarden.com/?p=356#comment-1112</guid>

					<description><![CDATA[ok,
this runs in under around 70 milliseconds without player optimizations and doesnt lock the browser. if you wana parse it straight out try this.

function onDone(bool){

	var dp, ps, i,  p, pn, rs, i2, srs, r, sr, i3;
	/*
	[shortened names]
	 dp - dataprovider
	 ps - planets
	 i - iterator of planets
	 p - planet
	 pn - planet name
	 rs - resources
	 i2 - iterator of resources
	 srs - stored resources
	 r - resource
	 sr - stored resource
	 i3 - iterator of resource prop 
	 */ 
	if(bool){
		dp = [];
		ps = my_xml.firstChild.firstChild.childNodes;
		
		for(i in ps){
			p = ps[i];
			pn = p.attributes.name;
			rs = p.firstChild.childNodes;
			srs = dp[i] = [];
			i2 = rs.length % 8;
			while(i2--){
				r = rs[i2].childNodes;
				sr = srs[i2] = {};
				sr.planet = pn;
				for(i3 in r){
					sr[r[i3].nodeName] = r[i3].firstChild.toString();
				}
			}
			i2 = parseInt(rs.length/8);
			while(i2--){
				r = rs[i2].childNodes;
				sr = srs[i2] = {};
				sr.planet = pn;
				for(i3 in r){
					sr[r[i3].nodeName] = r[i3].firstChild.toString();
				}
			}
		}
		this.swg_lcdp.setData(dp);

	}else{
		this.agent_service.onDebug(&quot;xml error&quot;);
	}
	
}]]></description>
			<content:encoded><![CDATA[<p>ok,<br />
this runs in under around 70 milliseconds without player optimizations and doesnt lock the browser. if you wana parse it straight out try this.</p>
<p>function onDone(bool){</p>
<p>	var dp, ps, i,  p, pn, rs, i2, srs, r, sr, i3;<br />
	/*<br />
	[shortened names]<br />
	 dp &#8211; dataprovider<br />
	 ps &#8211; planets<br />
	 i &#8211; iterator of planets<br />
	 p &#8211; planet<br />
	 pn &#8211; planet name<br />
	 rs &#8211; resources<br />
	 i2 &#8211; iterator of resources<br />
	 srs &#8211; stored resources<br />
	 r &#8211; resource<br />
	 sr &#8211; stored resource<br />
	 i3 &#8211; iterator of resource prop<br />
	 */<br />
	if(bool){<br />
		dp = [];<br />
		ps = my_xml.firstChild.firstChild.childNodes;</p>
<p>		for(i in ps){<br />
			p = ps[i];<br />
			pn = p.attributes.name;<br />
			rs = p.firstChild.childNodes;<br />
			srs = dp[i] = [];<br />
			i2 = rs.length % 8;<br />
			while(i2&#8211;){<br />
				r = rs[i2].childNodes;<br />
				sr = srs[i2] = {};<br />
				sr.planet = pn;<br />
				for(i3 in r){<br />
					sr[r[i3].nodeName] = r[i3].firstChild.toString();<br />
				}<br />
			}<br />
			i2 = parseInt(rs.length/8);<br />
			while(i2&#8211;){<br />
				r = rs[i2].childNodes;<br />
				sr = srs[i2] = {};<br />
				sr.planet = pn;<br />
				for(i3 in r){<br />
					sr[r[i3].nodeName] = r[i3].firstChild.toString();<br />
				}<br />
			}<br />
		}<br />
		this.swg_lcdp.setData(dp);</p>
<p>	}else{<br />
		this.agent_service.onDebug(&#8220;xml error&#8221;);<br />
	}</p>
<p>}</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Kenny Bunch		</title>
		<link>https://jessewarden.com/2003/12/central-paging-1-onenterframe-0-while-0-tip.html/comment-page-1#comment-1111</link>

		<dc:creator><![CDATA[Kenny Bunch]]></dc:creator>
		<pubDate>Fri, 12 Dec 2003 20:09:45 +0000</pubDate>
		<guid isPermaLink="false">http://jessewarden.com/?p=356#comment-1111</guid>

					<description><![CDATA[the test was actually in an older 6 player with no optimizations. so maybe it is faster. laughin. i dont know i put my clothes on backwards this morning, forgot my belt and had to use a shoestring, etc.]]></description>
			<content:encoded><![CDATA[<p>the test was actually in an older 6 player with no optimizations. so maybe it is faster. laughin. i dont know i put my clothes on backwards this morning, forgot my belt and had to use a shoestring, etc.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Kenny Bunch		</title>
		<link>https://jessewarden.com/2003/12/central-paging-1-onenterframe-0-while-0-tip.html/comment-page-1#comment-1110</link>

		<dc:creator><![CDATA[Kenny Bunch]]></dc:creator>
		<pubDate>Fri, 12 Dec 2003 20:02:11 +0000</pubDate>
		<guid isPermaLink="false">http://jessewarden.com/?p=356#comment-1110</guid>

					<description><![CDATA[actually it takes nearly a second on a 600mhz. i was on a faster machine. so i would thread it into two parses probably. that is, if you arent going to preparse it on the server.]]></description>
			<content:encoded><![CDATA[<p>actually it takes nearly a second on a 600mhz. i was on a faster machine. so i would thread it into two parses probably. that is, if you arent going to preparse it on the server.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Kenny Bunch		</title>
		<link>https://jessewarden.com/2003/12/central-paging-1-onenterframe-0-while-0-tip.html/comment-page-1#comment-1109</link>

		<dc:creator><![CDATA[Kenny Bunch]]></dc:creator>
		<pubDate>Fri, 12 Dec 2003 19:18:40 +0000</pubDate>
		<guid isPermaLink="false">http://jessewarden.com/?p=356#comment-1109</guid>

					<description><![CDATA[try this

function onDone(bool){

	var dp, ps, i,  p, pn, rs, i2, srs, r, sr, i3;
	/*
	[shortened names]
	 dp - dataprovider
	 ps - planets
	 i - length of planets
	 p - planet
	 pn - planet name
	 rs - resources
	 i2 - length of resources
	 srs - stored resources
	 r - resource
	 sr - stored resource
	 i3 - resource prop length
	 */ 
	if(bool){
		dp = [];
		ps = my_xml.firstChild.firstChild.childNodes;
		i = ps.length;
		
		while(i--){
			p = ps[i];
			pn = p.attributes.name;
			rs = p.firstChild.childNodes;
			i2 = rs.length;
			srs = dp[i] = [];
			
			while(i2--){
				r = rs[i2].childNodes;
				sr = srs[i2] = {};
				sr.planet = pn;
				i3 = r.length;
				while(i3--){
					sr[r[i3].nodeName] = r[i3].firstChild.toString();
				}
			}
		}
	
		this.swg_lcdp.setData(dp);
		
	}else{
		this.agent_service.onDebug(&quot;xml error&quot;);
	}
	
}

it&#039;s not the fastest in the world but it does what you want. since it takes around a half a second to parse on a 600mhz it might be wise to thread it, just enough that it doesnt grab your CPU in that time. 

another bit of advice, since there are no decompression utils native to flash, it looks like you are going to be downloading the file once a week onto your own server and untarring it.. right? since you are running this chron job to go grab it and untar it and this process is once a week, instead of just writing it to a file, parse it into an easier xml file to read. You could also parse it into the datatype you want, serialize it, store it, and then pass it to flash using remoting as the native type you wanted it in the first place. However this second method using remoting will add overhead since you are doing processing each request. I would try the first method.]]></description>
			<content:encoded><![CDATA[<p>try this</p>
<p>function onDone(bool){</p>
<p>	var dp, ps, i,  p, pn, rs, i2, srs, r, sr, i3;<br />
	/*<br />
	[shortened names]<br />
	 dp &#8211; dataprovider<br />
	 ps &#8211; planets<br />
	 i &#8211; length of planets<br />
	 p &#8211; planet<br />
	 pn &#8211; planet name<br />
	 rs &#8211; resources<br />
	 i2 &#8211; length of resources<br />
	 srs &#8211; stored resources<br />
	 r &#8211; resource<br />
	 sr &#8211; stored resource<br />
	 i3 &#8211; resource prop length<br />
	 */<br />
	if(bool){<br />
		dp = [];<br />
		ps = my_xml.firstChild.firstChild.childNodes;<br />
		i = ps.length;</p>
<p>		while(i&#8211;){<br />
			p = ps[i];<br />
			pn = p.attributes.name;<br />
			rs = p.firstChild.childNodes;<br />
			i2 = rs.length;<br />
			srs = dp[i] = [];</p>
<p>			while(i2&#8211;){<br />
				r = rs[i2].childNodes;<br />
				sr = srs[i2] = {};<br />
				sr.planet = pn;<br />
				i3 = r.length;<br />
				while(i3&#8211;){<br />
					sr[r[i3].nodeName] = r[i3].firstChild.toString();<br />
				}<br />
			}<br />
		}</p>
<p>		this.swg_lcdp.setData(dp);</p>
<p>	}else{<br />
		this.agent_service.onDebug(&#8220;xml error&#8221;);<br />
	}</p>
<p>}</p>
<p>it&#8217;s not the fastest in the world but it does what you want. since it takes around a half a second to parse on a 600mhz it might be wise to thread it, just enough that it doesnt grab your CPU in that time. </p>
<p>another bit of advice, since there are no decompression utils native to flash, it looks like you are going to be downloading the file once a week onto your own server and untarring it.. right? since you are running this chron job to go grab it and untar it and this process is once a week, instead of just writing it to a file, parse it into an easier xml file to read. You could also parse it into the datatype you want, serialize it, store it, and then pass it to flash using remoting as the native type you wanted it in the first place. However this second method using remoting will add overhead since you are doing processing each request. I would try the first method.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
