<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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>Gordon FYP</title>
	<atom:link href="http://fyp.snap-ustar.net/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://fyp.snap-ustar.net</link>
	<description>My F.Y.P.: EvtLog - The log for my Final Year Project</description>
	<pubDate>Fri, 01 May 2009 07:00:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Test run of EvtLog (My Final Year Project)</title>
		<link>http://fyp.snap-ustar.net/?p=250</link>
		<comments>http://fyp.snap-ustar.net/?p=250#comments</comments>
		<pubDate>Fri, 01 May 2009 06:50:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[一般]]></category>

		<guid isPermaLink="false">http://fyp.snap-ustar.net/?p=250</guid>
		<description><![CDATA[
Let me announce the open test run of my Final Year Project: EvtLog
You can now check out the alpha run version with the following URL:
http://snap-port.net/fyp/alpha
You can:

Click the menu buttons at the bottom part of the application for different features
Click on the MapTags to see the detial of the event
Register the application to be a member for [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-249" title="myfyp" src="http://fyp.snap-ustar.net/wp-content/uploads/2009/05/myfyp.png" alt="myfyp" width="302" height="211" /></p>
<p>Let me announce the open test run of my Final Year Project: EvtLog</p>
<p>You can now check out the alpha run version with the following URL:<br />
<a href="http://snap-port.net/fyp/alpha">http://snap-port.net/fyp/alpha</a></p>
<p>You can:</p>
<ul>
<li><strong>Click</strong> the <strong>menu buttons</strong> at the bottom part of the application for different features</li>
<li><strong>Click </strong>on the <strong>MapTags</strong> to see the detial of the event</li>
<li><strong>Register</strong> the application <strong>to be a member</strong> for more features</li>
<li><strong>Select scope</strong> on the map to browse <strong>events that will happen within that scope</strong></li>
<li><strong>Search</strong> events with the built-in search feature</li>
<li>Try out the <strong>suggestion search keywords</strong></li>
<li><strong>Post events</strong> (try to post some real events)</li>
<li><strong>Send Private Message(PM)</strong> to event&#8217;s poster or other user</li>
<li>etc. ^^</li>
</ul>
<p>It has been kept tested and improved with some of my friends who has programming-background and it is now so great to make it as open test run. I wish to receive anyone you comment and sharing about my FYP. You can just simpily click the button for the feedback form.</p>
]]></content:encoded>
			<wfw:commentRss>http://fyp.snap-ustar.net/?feed=rss2&amp;p=250</wfw:commentRss>
		</item>
		<item>
		<title>Much reaching the destination!</title>
		<link>http://fyp.snap-ustar.net/?p=246</link>
		<comments>http://fyp.snap-ustar.net/?p=246#comments</comments>
		<pubDate>Thu, 23 Apr 2009 07:20:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[一般]]></category>

		<guid isPermaLink="false">http://fyp.snap-ustar.net/?p=246</guid>
		<description><![CDATA[Not much time is left, hopefully the development is almost reaching the destination:

Need modification to make the application look nice as well as improving the search mechanism. I wish to use FULL-TEXT search as the search mechanism, but the fact that FULL-TEXT does not support Chinese Characters as there is no delimiter for Chinese (else [...]]]></description>
			<content:encoded><![CDATA[<p>Not much time is left, hopefully the development is almost reaching the destination:</p>
<p><img class="alignnone size-full wp-image-247" title="fyp_20090423" src="http://fyp.snap-ustar.net/wp-content/uploads/2009/04/fyp_20090423.gif" alt="fyp_20090423" width="605" height="864" /></p>
<p>Need modification to make the application look nice as well as improving the search mechanism. I wish to use FULL-TEXT search as the search mechanism, but the fact that FULL-TEXT does not support Chinese Characters as there is no delimiter for Chinese (else well as Korean and Japanese, does not have space as word delimiter like English). Therefore current search feature just apply MySQL &#8216;LIKE&#8217; pharsing search. As well as I am designing the &#8220;suggestion search&#8221; feature.</p>
<p>I can&#8217;t believe the application is almost finish, even it may not have enough commercial smell~</p>
]]></content:encoded>
			<wfw:commentRss>http://fyp.snap-ustar.net/?feed=rss2&amp;p=246</wfw:commentRss>
		</item>
		<item>
		<title>Percentage width for Flex DataGridColumn</title>
		<link>http://fyp.snap-ustar.net/?p=243</link>
		<comments>http://fyp.snap-ustar.net/?p=243#comments</comments>
		<pubDate>Sun, 19 Apr 2009 17:23:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[一般]]></category>

		<guid isPermaLink="false">http://fyp.snap-ustar.net/?p=243</guid>
		<description><![CDATA[For RIA, it is more appropriate to have fluid layout for application as there are many different resolution for different user&#8217;s computer.
Flex&#8217;s datagrid, however, its column does not support dynamic width.
I do tried to use actionscript to set those width during runtime like using onCreationComplete or onResize of the datagrid, sadly that it is unable [...]]]></description>
			<content:encoded><![CDATA[<p>For RIA, it is more appropriate to have fluid layout for application as there are many different resolution for different user&#8217;s computer.</p>
<p>Flex&#8217;s datagrid, however, its column does not support dynamic width.</p>
<p>I do tried to use actionscript to set those width during runtime like using onCreationComplete or onResize of the datagrid, sadly that it is unable to control the width of columns, keep being feeded with some float values.</p>
<p>Until Dave suggested a over-simplified solution: to use decimal number for the width value:<br />
<a href="http://www.daveoncode.com/2009/03/18/set-datagridcolumns-width-in-percentage-with-ease/">http://www.daveoncode.com/2009/03/18/set-datagridcolumns-width-in-percentage-with-ease/</a></p>
<p>It is really crazy simple, with spent me lots of time in brain-storming other useless AS3 solutions&#8230;&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://fyp.snap-ustar.net/?feed=rss2&amp;p=243</wfw:commentRss>
		</item>
		<item>
		<title>Little concern on user friendly</title>
		<link>http://fyp.snap-ustar.net/?p=236</link>
		<comments>http://fyp.snap-ustar.net/?p=236#comments</comments>
		<pubDate>Sun, 19 Apr 2009 14:33:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[一般]]></category>

		<guid isPermaLink="false">http://fyp.snap-ustar.net/?p=236</guid>
		<description><![CDATA[Time fires and there is about 13 days left for the deadline of FYP,  I am behind schedule because as long as you design and implement the desired part out, more un-expected issue and ideas come out. Let say what I am implementing these days is the Private Messaging feature(PM), I had already design a [...]]]></description>
			<content:encoded><![CDATA[<p>Time fires and there is about 13 days left for the deadline of FYP,  I am behind schedule because as long as you design and implement the desired part out, more un-expected issue and ideas come out. Let say what I am implementing these days is the Private Messaging feature(PM), I had already design a very basic one, without friend list consideration, I predict I can finish it within 1 day and have bug fix and improvement for 1 day, but turn out that it needs 3 days, just only wish to make my application more user friendly&#8230;</p>
<p>What I did:<br />
An InBox and OutBox, a message with title and rich text Body using DataGrid</p>
<p>What I didn&#8217;t think in detail:<br />
Should it be multi-page, or just 1 datagrid?<br />
Should it be multi-selectable?<br />
How about bulk deletion?<br />
Read/ Non-Read Flag?</p>
<p>And the most important is: The sorting of the messages. How to let users feel good to use.</p>
<p>People will say that, it&#8217;s just easy: sort the messages order by date in decending order and use it as the dataprovider of the datagrid. Okay, everything think that the data is displayed pretty good in the datagrid, but what if user click the column header? Flex will use its default sorting mechanism and disturb the original messages order. For example, if I press the header &#8220;readflag&#8221;, the messages are really sorted with &#8220;readflag&#8221; column but Flex will also sort other columns in the datagrid in ascending order. Making some very old message rise and new read/un-read message sink. So What do I do as soon as I get this point? I have to immediate draft a solution for this, like how should I handle the sorting, how to implement that sorting mechanism?</p>
<p>Initial sorted view:</p>
<p><img class="alignnone size-full wp-image-237" title="dg_sort01" src="http://fyp.snap-ustar.net/wp-content/uploads/2009/04/dg_sort01.gif" alt="dg_sort01" width="512" height="144" /></p>
<p>After user&#8217;s manual ReadFlag sorting (click the column with some circles), the data is already a mess: the read/un-read messages are sorted but their date are not sorted as well</p>
<p><img class="alignnone size-full wp-image-238" title="dg_sort02" src="http://fyp.snap-ustar.net/wp-content/uploads/2009/04/dg_sort02.gif" alt="dg_sort02" width="512" height="144" /></p>
<p>The same situation, with color indicated, occured, the ReadFlag column is sorted while the messages are not sorted by datetime, resulted that in such situation, the oldest message which is read already will be shown at the first row.</p>
<p><img class="alignnone size-full wp-image-239" title="dg_sort03" src="http://fyp.snap-ustar.net/wp-content/uploads/2009/04/dg_sort03.gif" alt="dg_sort03" width="512" height="144" /></p>
<p>Things always go bad, yet, it still gets some way to go well. So then I learn the powerful feature of Flex DataGrid with reference to the following website the coding mentioned:<br />
Programmatic multi-column sorting on DataGrid or AdvancedDataGrid<br />
<a href="http://raghuonflex.wordpress.com/2008/01/25/programmatic-multi-column-sorting-on-datagrid-or-advanceddatagrid/">http://raghuonflex.wordpress.com/2008/01/25/programmatic-multi-column-sorting-on-datagrid-or-advanceddatagrid/</a></p>
<p>For sure it is not the only part that make the implementation more difficult than I expect. From the previous of some social platform experience, some statistic table should be maintained so as to facilitates the running of the platform. And careful updation of those statistic is important otherwise either making those statistic not real/incorrect or lowering the performance of the application/platform due to mass updation occuring in the database.</p>
<p>The point I want to point out is: Never think programming a software an easy stuff. And don&#8217;t think oversimple for a programmer who have heart to make good application stuffs.</p>
<p>And I wish my advisors and people who are going to be invited to test my application will not think my application is a mess stuff~^^</p>
]]></content:encoded>
			<wfw:commentRss>http://fyp.snap-ustar.net/?feed=rss2&amp;p=236</wfw:commentRss>
		</item>
		<item>
		<title>Form validation to protect your application related to SQL statement</title>
		<link>http://fyp.snap-ustar.net/?p=229</link>
		<comments>http://fyp.snap-ustar.net/?p=229#comments</comments>
		<pubDate>Thu, 16 Apr 2009 08:16:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[一般]]></category>

		<guid isPermaLink="false">http://fyp.snap-ustar.net/?p=229</guid>
		<description><![CDATA[As long as developing my FYP, I keep testing the freshly made components with aggressive attempts. And these days I just find out more about some necessary precautions to avoid the application crash. For my application, like other applications, there are some textboxs or textareas for data entry, and the data will be stored in [...]]]></description>
			<content:encoded><![CDATA[<p>As long as developing my FYP, I keep testing the freshly made components with aggressive attempts. And these days I just find out more about some necessary precautions to avoid the application crash. For my application, like other applications, there are some textboxs or textareas for data entry, and the data will be stored in database. In case you did not handle the data that being sent carefully, what it&#8217;s: Validating data that being sent, those careless can crash the application. In my case, I have to handle symbols like apostrophe(&#8217;), backslash(\) so as to avoid the backend forming an incorrect format SQL statement to the database.</p>
<p>Normally a SQL statement is:<br />
INSERT INTO `TABLE_NAME` (`data`) VALUSE (&#8217;field1&#8242;);</p>
<p>If some people feed the data field1 with &#8220;Data\&#8221;, then the SQL statement will become:<br />
INSERT INTO `TABLE_NAME` (`data`) VALUSE (&#8217;data\&#8217;);</p>
<p>The backslash symbol will hide the orginal function of apostrophe and make the SQL statement syntax incorrect, error like &#8216;missing apostrophe&#8217; is resulted.</p>
<p>If the previous example the backslash is replaced as apostrophe, the SQL statement will also be generated error because of an extra apostrophe.<br />
[X] INSERT INTO `TABLE_NAME` (`data`) VALUSE (&#8217;data&#8221;);<br />
[X] INSERT INTO `TABLE_NAME` (`data`) VALUSE (&#8217;da&#8217;ta&#8217;); //SQL will think that only [da] will be feeded to `data` column meanwhile do not know what [ta] mean in the remaining part of the SQL.</p>
<p>Hence, great care have to be taken into account so as to avoid the application being crashed by somebody whose intention is bad.</p>
<p>More about validation, Flex has provided several validation class. It is sufficient for general use but I am so interested in thinking whether they are useful or not, just a passage about EmailValidator:<br />
<a href="http://www.stimuli.com.br/trane/2007/sep/13/email-validation-actionscript-3/">http://www.stimuli.com.br/trane/2007/sep/13/email-validation-actionscript-3/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://fyp.snap-ustar.net/?feed=rss2&amp;p=229</wfw:commentRss>
		</item>
		<item>
		<title>Progress up to 11th April</title>
		<link>http://fyp.snap-ustar.net/?p=220</link>
		<comments>http://fyp.snap-ustar.net/?p=220#comments</comments>
		<pubDate>Sat, 11 Apr 2009 03:55:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[一般]]></category>

		<guid isPermaLink="false">http://fyp.snap-ustar.net/?p=220</guid>
		<description><![CDATA[The implementation of the platform is a bit delayed. Waited some time due to the failure of migrating the platform into a new server.
The migration problem is:
The platform can only upload some photos but not all type of photos in the new server. It doesn&#8217;t really related to the file type or file size. Or say, the new [...]]]></description>
			<content:encoded><![CDATA[<p>The implementation of the platform is a bit delayed. Waited some time due to the failure of migrating the platform into a new server.</p>
<p>The migration problem is:</p>
<blockquote><p>The platform can only upload some photos but not all type of photos in the new server. It doesn&#8217;t really related to the file type or file size. Or say, the new server cannot receive some photos uploaded from the platform. It may because of the header sent from the application to the server is no accepted by the server.</p></blockquote>
<p>Anyway, it spent me lots of time and energy in seeking for the solutions that may not be easily appliable therefore I cancelled the migration plan and continue my development of the platform in the original platform.</p>
<p>The event post feature with the tag logging part is implemented, and currently implementing the member display part. It is more or less the same with the event tag display modules. What the most important part: search feature, will be implemented in the coming week.</p>
<p>Previously I predict to have the testing period in April but it will be postponed to the late April. The deadline of the Final Year Project is coming. Eventhough there is a bit different from my plan for the resulting platform, it still give me a lots experience in platform development.</p>
<p>To be honest, if I can implement it in HTML + PHP + MySQL and without considering about the creative design,  it would be much easier to work out what I expect. However, my advisor&#8217;s really true sentence:&#8221;It is no need to work out something that other people can work out easily.&#8221; Well, that&#8217;s why I keep using Flex as the tool and work out what I want: A map-based information platform-to link up data with geographic constrain for easier information search.</p>
<p><img class="alignnone size-full wp-image-224" title="fyp_090411_01" src="http://fyp.snap-ustar.net/wp-content/uploads/2009/04/fyp_090411_01.jpg" alt="fyp_090411_01" width="500" height="337" /></p>
<p><img class="alignnone size-full wp-image-225" title="fyp_090411_02" src="http://fyp.snap-ustar.net/wp-content/uploads/2009/04/fyp_090411_02.jpg" alt="fyp_090411_02" width="500" height="337" /></p>
<p><img class="alignnone size-full wp-image-226" title="fyp_090411_03" src="http://fyp.snap-ustar.net/wp-content/uploads/2009/04/fyp_090411_03.jpg" alt="fyp_090411_03" width="500" height="337" /></p>
]]></content:encoded>
			<wfw:commentRss>http://fyp.snap-ustar.net/?feed=rss2&amp;p=220</wfw:commentRss>
		</item>
		<item>
		<title>Failure in moving the FYP platform from old to new server</title>
		<link>http://fyp.snap-ustar.net/?p=216</link>
		<comments>http://fyp.snap-ustar.net/?p=216#comments</comments>
		<pubDate>Fri, 03 Apr 2009 09:04:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[一般]]></category>

		<guid isPermaLink="false">http://fyp.snap-ustar.net/?p=216</guid>
		<description><![CDATA[Just sign-up a new domain and webhosting for hosting the FYP, but with lots of efforts did and I finally decided to withdraw from such move.
During the early phrase of my FYP platform design, I has already consider to group all server&#8217;s related setting/ variables to a particular so-called setting file. This practice is learnt [...]]]></description>
			<content:encoded><![CDATA[<p>Just sign-up a new domain and webhosting for hosting the FYP, but with lots of efforts did and I finally decided to withdraw from such move.</p>
<p>During the early phrase of my FYP platform design, I has already consider to group all server&#8217;s related setting/ variables to a particular so-called setting file. This practice is learnt from my previous programming experience in some companies and such practice work on my project as well. I can overcome many diffuculties that I encountered during the migration, as soon as I think all migration is done, I found out the Avatar uploading component does not work.</p>
<p>With detail investigation, I reduced the scope of mystery to the &#8220;Flex:FileReference&#8221; part adn I found that the backend does not receive any call that generated by FileReference.upload(). I checked the target destination of that upload call and I implemented many flow checkpoint by logging the backend programs as well as the flex application but, sadly, all features work properly in the current server but not the new server.</p>
<p>Despite almost all the steps are overcome, I finally decided stop migrating the platform to the new server, saving time not for solving this problem which may finally resulted by some server&#8217;s header filtering mechanism that I cannot handle, but to spend more time focusing on the platform development.</p>
<p>Up to these days, I implemented the event posting part as well as newly added the &#8216;tag&#8217;(keyword) logging features, which will be very useful for the later &#8217;search&#8217; feature implementation.</p>
<p><img class="alignnone size-full wp-image-217" title="fyp_20090402" src="http://fyp.snap-ustar.net/wp-content/uploads/2009/04/fyp_20090402.gif" alt="fyp_20090402" width="500" height="300" /></p>
]]></content:encoded>
			<wfw:commentRss>http://fyp.snap-ustar.net/?feed=rss2&amp;p=216</wfw:commentRss>
		</item>
		<item>
		<title>RichTextEditor - default text/font size using CSS</title>
		<link>http://fyp.snap-ustar.net/?p=211</link>
		<comments>http://fyp.snap-ustar.net/?p=211#comments</comments>
		<pubDate>Thu, 26 Mar 2009 19:07:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[一般]]></category>

		<guid isPermaLink="false">http://fyp.snap-ustar.net/?p=211</guid>
		<description><![CDATA[Flex does not display Chinese text in a friendly way as all default font/text size is 10pt, for which it is too small for Chinese words to be well displayed in Flex application. For the InfoBox for the event of my application, it contains poster-defined content so I wish to use RichTextEditor as the tool [...]]]></description>
			<content:encoded><![CDATA[<p>Flex does not display Chinese text in a friendly way as all default font/text size is 10pt, for which it is too small for Chinese words to be well displayed in Flex application. For the InfoBox for the event of my application, it contains poster-defined content so I wish to use RichTextEditor as the tool for user to edit the event description with more variety, like font style, font size and color, etc. These 2 days concentrates onto the Flex RichTextEditor components. As soon as I use the component, I found it is difficult to set default value of font-size simply.</p>
<p>At first I tried to use actionscript to set the fontSizeCombo to select the desired size value, well, the fontSizeCombo really selected the value I wish to be selected, sadly the textArea still keep the default 10pt font size setting. Then I tried to make an event dispatch so as to simulate the comBoBox item select action using mouse, and again it seems that I am unable to make such a simulation. I tried to seek for way to set that font size attribute and no method is mentioned in the Internet.</p>
<p>However, I was told to use CSS as the way to set the default font/text size.<br />
<a href="http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60&amp;catid=585&amp;threadid=1434939&amp;enterthread=y">http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60&amp;catid=585&amp;threadid=1434939&amp;enterthread=y</a><br />
It really makes me surprise that the htmlText attribute of the RichTextEditor is not worked in a way I think of: with a font size attribute and when ever text is inputted into the textarea, set that text as that size. It seems to work as first using CSS to render the content of textArea, and then transforming them into html format so as to return as a String type.</p>
<p>Hope this post sharing useful to someone else.</p>
<p><img class="alignnone size-full wp-image-212" title="fyp_20090326_01" src="http://fyp.snap-ustar.net/wp-content/uploads/2009/03/fyp_20090326_01.jpg" alt="fyp_20090326_01" width="451" height="256" /></p>
<p>Suitable to use font size as 12 for Chinese Characters</p>
<p><img class="alignnone size-full wp-image-213" title="fyp_20090326_02" src="http://fyp.snap-ustar.net/wp-content/uploads/2009/03/fyp_20090326_02.jpg" alt="fyp_20090326_02" width="500" height="321" /></p>
<p>Up to this state&#8217;s platform-view</p>
]]></content:encoded>
			<wfw:commentRss>http://fyp.snap-ustar.net/?feed=rss2&amp;p=211</wfw:commentRss>
		</item>
		<item>
		<title>More watchable phrase</title>
		<link>http://fyp.snap-ustar.net/?p=202</link>
		<comments>http://fyp.snap-ustar.net/?p=202#comments</comments>
		<pubDate>Wed, 25 Mar 2009 10:30:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[一般]]></category>

		<guid isPermaLink="false">http://fyp.snap-ustar.net/?p=202</guid>
		<description><![CDATA[Throughout last few days, I had been working so tide on my Final Year Project &#8220;EvtLog&#8221;. And today, with consuming 7 hours continuously, solving bugs and bugs and again bugs, I finally work out a more presentable version of my FYP:
Most of my previous effort was spent on the back-end development and algorithm:
The design of [...]]]></description>
			<content:encoded><![CDATA[<p>Throughout last few days, I had been working so tide on my Final Year Project &#8220;EvtLog&#8221;. And today, with consuming 7 hours continuously, solving bugs and bugs and again bugs, I finally work out a more presentable version of my FYP:</p>
<p>Most of my previous effort was spent on the back-end development and algorithm:</p>
<p>The design of registration flow<br />
The design of profile flow<br />
The design of event adding flow<br />
The design of Database schema<br />
The re-design of User Interface<br />
The enhancement of User Interface<br />
The procedure of profile editing (basic information)<br />
The procedure of member&#8217;s location capturing<br />
The procedure of profile avatar handling<br />
The procedure of event adding</p>
<p>Later I started to implement the event display and untill today, I finally make the event display part more or less presentable. With the record list panel, user can click the panel or directly click the tag on the map for the event information. Why do the platform provide both the map tag view as well as the panel? The panel is good for user to know the name of the event in a glance while user can know event&#8217;s location from the map.</p>
<p><a href="http://fyp.snap-ustar.net/wp-content/uploads/2009/03/fyp_0325_2.gif" rel="lightbox"><img class="alignnone size-full wp-image-203" title="fyp_0325_2" src="http://fyp.snap-ustar.net/wp-content/uploads/2009/03/fyp_0325_2.gif" alt="" width="500" height="278" /></a></p>
<p>The Infomation box&#8217;s content is not yet optimized but at least what I inputted into the database can be shown onto the map control view now.</p>
<p>I will try my best in making it more watchable before Thursday as there is a chance to meet CEO of OpenRice.com in the Industrial night of FYP.</p>
]]></content:encoded>
			<wfw:commentRss>http://fyp.snap-ustar.net/?feed=rss2&amp;p=202</wfw:commentRss>
		</item>
		<item>
		<title>AS3 associative array</title>
		<link>http://fyp.snap-ustar.net/?p=200</link>
		<comments>http://fyp.snap-ustar.net/?p=200#comments</comments>
		<pubDate>Mon, 16 Mar 2009 19:06:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[一般]]></category>

		<guid isPermaLink="false">http://fyp.snap-ustar.net/?p=200</guid>
		<description><![CDATA[Associative array is used so commonly when I write PHP program, for AS3, I used it when I pass extra data for an Event Listener. This passage is not going to discuss about how to pass parameter for Event Listener but to share how I found that the so-called &#8220;associative array&#8221; is not simply an [...]]]></description>
			<content:encoded><![CDATA[<p>Associative array is used so commonly when I write PHP program, for AS3, I used it when I pass extra data for an Event Listener. This passage is not going to discuss about how to pass parameter for Event Listener but to share how I found that the so-called &#8220;associative array&#8221; is not simply an array but is an onject, for which for a new AS3 programmer, I haven&#8217;t imagine about this.</p>
<p>I used to use associative array as it is quite easy to understand what the structure of the data is. For example, I have a variable called &#8220;applicationVar&#8221;, then for the following code:</p>
<p>applicationVar['name']=&#8221;My application&#8221;;<br />
applicationVar['author']=&#8221;Gordon&#8221;;<br />
applicationVar['version']=&#8221;1.0&#8243;;</p>
<p>By passing 1 variable, people can get the data in bulk which is the advantage of using array, and also instead of using numeric index, I can use those bracketed terms to get the extra information and the program is more readible.</p>
<p>However for me to do the same thing in AS3, I found it seems not so easy to do so:</p>
<p>One direct way is:</p>
<p>var applicationVar:Array=[{name:"My application",author:"Gordon",version:"1.0"}];</p>
<p>But this is not allow to add further item dynamically.</p>
<p>or to use the push function:</p>
<p>var applicationVar:Array=new Array();<br />
applicationVar.push({name:&#8221;My application&#8221;,author:&#8221;Gordon&#8221;,version:&#8221;1.0&#8243;});</p>
<p>But it result that I need to pass 1 more &#8216;index&#8217; to that &#8216;array&#8217;:</p>
<p>Alert.show(applicationVar[0]['name']); //My application</p>
<p>That extra &#8220;[0]&#8221; is so ugly.</p>
<p>And finally I found out that AS3 do not suggest people to use Array to achieve the associative array concept:</p>
<blockquote><p>Do not use the Array class to create <em>associative arrays</em> (also called <em>hashes</em>), which are data structures that contain named elements instead of numbered elements. To create associative arrays, use the Object class. Although ActionScript permits you to create associative arrays using the Array class, you cannot use any of the Array class methods or properties with associative arrays.</p>
<p><a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Array.html">http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Array.html</a></p></blockquote>
<p>The method of Using Object instead Array to achieve the associative array concept is:</p>
<p>var applicationVar:Object = new Object();<br />
applicationVar.name = &#8220;My application&#8221;;<br />
applicationVar.author = &#8220;Gordon&#8221;;<br />
applicationVar.version = &#8220;1.0&#8243;;<br />
for (var item in myArray) {<br />
trace(item); // name,author,version<br />
trace(myArray[item]); // My application, Gordon, 1.0</p>
<p>This is the sharing about how to use associative array in AS3.<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://fyp.snap-ustar.net/?feed=rss2&amp;p=200</wfw:commentRss>
		</item>
	</channel>
</rss>
