<?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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>joeltong.org</title>
	<atom:link href="http://joeltong.org/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://joeltong.org/blog</link>
	<description></description>
	<lastBuildDate>Sun, 21 Mar 2010 07:01:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Phil 4:13</title>
		<link>http://joeltong.org/blog/?p=146</link>
		<comments>http://joeltong.org/blog/?p=146#comments</comments>
		<pubDate>Sun, 21 Mar 2010 07:01:02 +0000</pubDate>
		<dc:creator>Joel Tong</dc:creator>
				<category><![CDATA[Nuggets of life]]></category>
		<category><![CDATA[random]]></category>

		<guid isPermaLink="false">http://joeltong.org/blog/?p=146</guid>
		<description><![CDATA[A verse to remember: Philippians 4:13 (New International Version) 13I can do everything through him who gives me strength. Amen! No related posts. Related posts brought to you by Yet Another Related Posts Plugin.


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>A verse to remember:</p>
<blockquote><p>Philippians 4:13 (New International Version)<br />
13I can do everything through him who gives me strength.</p></blockquote>
<p>Amen!</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://joeltong.org/blog/?feed=rss2&amp;p=146</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Goodbye and A level results!</title>
		<link>http://joeltong.org/blog/?p=143</link>
		<comments>http://joeltong.org/blog/?p=143#comments</comments>
		<pubDate>Fri, 05 Mar 2010 14:15:32 +0000</pubDate>
		<dc:creator>Joel Tong</dc:creator>
				<category><![CDATA[Nuggets of life]]></category>

		<guid isPermaLink="false">http://joeltong.org/blog/?p=143</guid>
		<description><![CDATA[Hey! Praise God! Results were very good. At least one less thing to worry about. He saw me through A levels. (: Tomorrow I am going to serve the country in yet another way - ARMY! (: Will be enlisting soon. Looking forward to it! (: Something I would like to share today: 8 He [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Hey!</p>
<p>Praise God!  Results were very good.  At least one less thing to worry about.  He saw me through A levels. (:</p>
<p>Tomorrow I am going to serve the country in yet another way - ARMY!  (:  Will be enlisting soon.  Looking forward to it! (:</p>
<p>Something I would like to share today:</p>
<blockquote><p>
 8 He has showed you, O man, what is good.<br />
       And what does the LORD require of you?<br />
       To act justly and to love mercy<br />
       and to walk humbly with your God.<br />
         - Micah 6:8
</p></blockquote>
<p>Cya in 2 weeks' time! =D</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://joeltong.org/blog/?feed=rss2&amp;p=143</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Memories</title>
		<link>http://joeltong.org/blog/?p=141</link>
		<comments>http://joeltong.org/blog/?p=141#comments</comments>
		<pubDate>Thu, 04 Mar 2010 10:02:41 +0000</pubDate>
		<dc:creator>Joel Tong</dc:creator>
				<category><![CDATA[Nuggets of life]]></category>
		<category><![CDATA[random]]></category>

		<guid isPermaLink="false">http://joeltong.org/blog/?p=141</guid>
		<description><![CDATA[2 More days to army. Here's some photos from the Teaching Internship Programme at Nanyang JC. Cheers! PS All the best for results tomorrow! 
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_main_1887817143"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://joeltong.org/tipPics/main.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://joeltong.org/tipPics/main.swf"
			name="fm_main_1887817143"
			width="400"
			height="300">
	<!--<![endif]-->
		 
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object> Related posts:Improved Image Viewer 
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_main_1969813438"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://joeltong.org/header/main.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://joeltong.org/header/main.swf"
			name="fm_main_1969813438"
			width="400"
			height="300">
	<!--<![endif]-->
		 
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object> Happy Chinese... PV3D + Tweener = imba fusion Well been playing [...]


Related posts:<ol><li><a href='http://joeltong.org/blog/?p=120' rel='bookmark' title='Permanent Link: Improved Image Viewer'>Improved Image Viewer</a> <small>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_main_1693202034"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://joeltong.org/header/main.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://joeltong.org/header/main.swf"
			name="fm_main_1693202034"
			width="400"
			height="300">
	<!--<![endif]-->
		 
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object> Happy Chinese...</small></li>
<li><a href='http://joeltong.org/blog/?p=15' rel='bookmark' title='Permanent Link: PV3D + Tweener = imba fusion'>PV3D + Tweener = imba fusion</a> <small>Well been playing around with PV3D and Tweener.  PV3D is...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>2 More days to army.  Here's some photos from the Teaching Internship Programme at Nanyang JC.  Cheers! <img src='http://joeltong.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>PS All the best for results tomorrow!</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_main_710273120"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://joeltong.org/tipPics/main.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://joeltong.org/tipPics/main.swf"
			name="fm_main_710273120"
			width="400"
			height="300">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>


<p>Related posts:<ol><li><a href='http://joeltong.org/blog/?p=120' rel='bookmark' title='Permanent Link: Improved Image Viewer'>Improved Image Viewer</a> <small>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_main_303279476"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://joeltong.org/header/main.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://joeltong.org/header/main.swf"
			name="fm_main_303279476"
			width="400"
			height="300">
	<!--<![endif]-->
		 
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object> Happy Chinese...</small></li>
<li><a href='http://joeltong.org/blog/?p=15' rel='bookmark' title='Permanent Link: PV3D + Tweener = imba fusion'>PV3D + Tweener = imba fusion</a> <small>Well been playing around with PV3D and Tweener.  PV3D is...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://joeltong.org/blog/?feed=rss2&amp;p=141</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FLaser on Youtube</title>
		<link>http://joeltong.org/blog/?p=139</link>
		<comments>http://joeltong.org/blog/?p=139#comments</comments>
		<pubDate>Sat, 27 Feb 2010 15:34:08 +0000</pubDate>
		<dc:creator>Joel Tong</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[FLaser]]></category>
		<category><![CDATA[Nuggets of life]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[AS3 coding mania]]></category>
		<category><![CDATA[bytearray]]></category>
		<category><![CDATA[imba methods]]></category>
		<category><![CDATA[Labs]]></category>
		<category><![CDATA[Lightdraw]]></category>
		<category><![CDATA[threshold]]></category>

		<guid isPermaLink="false">http://joeltong.org/blog/?p=139</guid>
		<description><![CDATA[Hi there, Just posted 2 videos from my FLaser Ver 1.0 (2 years ago) on Youtube.  You can view it here: An excerpt: Preamble: This project proposes a cost-effective solution of interacting with a projector screen using a laser pointer, via an ordinary webcam. The system was deployed and scripted in Flash Actionscript 3.0, back [...]


Related posts:<ol><li><a href='http://joeltong.org/blog/?p=104' rel='bookmark' title='Permanent Link: FLaser'>FLaser</a> <small>Hi, Been busy the past few days trying to do...</small></li>
<li><a href='http://joeltong.org/blog/?p=41' rel='bookmark' title='Permanent Link: Image Interaction System ver 2.0'>Image Interaction System ver 2.0</a> <small>Hi, been attempting to do a rework of my image...</small></li>
<li><a href='http://joeltong.org/blog/?p=127' rel='bookmark' title='Permanent Link: Radial Thresholding in AS3 (Webcam)'>Radial Thresholding in AS3 (Webcam)</a> <small>Perhaps one of the things I would like to do...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Hi there,</p>
<p>Just posted 2 videos from my FLaser Ver 1.0 (2 years ago) on Youtube.  You can view it here:</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/Bzpfgc-j8TM&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Bzpfgc-j8TM&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/vNSlCvZUzhA&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/vNSlCvZUzhA&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>An excerpt:<br />
Preamble:<br />
This project proposes a cost-effective solution of interacting with a projector screen using a laser pointer, via an ordinary webcam.</p>
<p>The system was deployed and scripted in Flash Actionscript 3.0, back in Dec 2007 to Jan 2008. </p>
<p>It subsequently won the Most Innovative Award and Best Exhibit at the Singapore Shell Science Fair 2008, was shortlisted by MOE to represent Singapore in the Taiwan International Science Fair (TISF) 2008, in addition to being an exhibited finalist at the A*STAR Singapore Science and Engineering Fair (SSEF) 2009.  </p>
<p>For more information, please checkout http://blog.joeltong.org/ .</p>
<p>Method:<br />
The system comprises of a screen image from a projector.  A webcam is positioned to track the projector screen area.</p>
<p>The steps for successful detection are as follows:<br />
1.	Calibration - 4 Red dots are shown on-screen.  Thresholding red, the system is able to pick out the distance between the four red dots, demarking the tracked active area by the webcam.  A ratio is then computed which is used to position the mouse.<br />
2.	A red laser dot is then shone onscreen.  Minor adjustment knobs compensate for the offset in terms of the computed position of the laser dot and its actual position, similar to zeroing in using a crosshair.<br />
3.	The system is ready to track the laser pointer.  In this case, a much high threshold is used, from the fact that red laser beams have a much higher intensity from the surrounding background.</p>
<p>System has been shown to detect laser dot despite showing red noise.  However, alternative algorithms are being devised fo9r the system for better background noise tolerance.</p>
<p>Do checkout the version shown at Shell Science Fair @ LINK.  System is targeted at rhe Flash platform, and for home users.</p>
<p>For more enquiries,</p>
<p>Email:  me {at} joeltong {dot} org.  </p>
<p>Thanks!</p>
<p>Best regards,<br />
Joel Tong</p>
<p>http://blog.joeltong.org/</p>


<p>Related posts:<ol><li><a href='http://joeltong.org/blog/?p=104' rel='bookmark' title='Permanent Link: FLaser'>FLaser</a> <small>Hi, Been busy the past few days trying to do...</small></li>
<li><a href='http://joeltong.org/blog/?p=41' rel='bookmark' title='Permanent Link: Image Interaction System ver 2.0'>Image Interaction System ver 2.0</a> <small>Hi, been attempting to do a rework of my image...</small></li>
<li><a href='http://joeltong.org/blog/?p=127' rel='bookmark' title='Permanent Link: Radial Thresholding in AS3 (Webcam)'>Radial Thresholding in AS3 (Webcam)</a> <small>Perhaps one of the things I would like to do...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://joeltong.org/blog/?feed=rss2&amp;p=139</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Radial Thresholding in AS3 (Webcam)</title>
		<link>http://joeltong.org/blog/?p=127</link>
		<comments>http://joeltong.org/blog/?p=127#comments</comments>
		<pubDate>Mon, 22 Feb 2010 15:23:42 +0000</pubDate>
		<dc:creator>Joel Tong</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Nuggets of life]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AR]]></category>
		<category><![CDATA[as3 advanced image manipulation]]></category>
		<category><![CDATA[augmented reality]]></category>
		<category><![CDATA[bytearray]]></category>
		<category><![CDATA[imba methods]]></category>
		<category><![CDATA[radial thresholding]]></category>
		<category><![CDATA[threshold]]></category>

		<guid isPermaLink="false">http://joeltong.org/blog/?p=127</guid>
		<description><![CDATA[Perhaps one of the things I would like to do before NS - build a radial threshold filter. Conventional threshold filters are constant throughout. This is means that if let's say the image threshold value is 170, then that threshold value is applied to the WHOLE image. That is pretty bad for some cameras. Back [...]


Related posts:<ol><li><a href='http://joeltong.org/blog/?p=41' rel='bookmark' title='Permanent Link: Image Interaction System ver 2.0'>Image Interaction System ver 2.0</a> <small>Hi, been attempting to do a rework of my image...</small></li>
<li><a href='http://joeltong.org/blog/?p=113' rel='bookmark' title='Permanent Link: Reflection'>Reflection</a> <small>Hey, I think the screen isn't as reflective as it...</small></li>
<li><a href='http://joeltong.org/blog/?p=104' rel='bookmark' title='Permanent Link: FLaser'>FLaser</a> <small>Hi, Been busy the past few days trying to do...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><a href="http://joeltong.org/blog/wp-content/uploads/2010/02/radial.jpg"><img class="alignnone size-medium wp-image-129" title="radial" src="http://joeltong.org/blog/wp-content/uploads/2010/02/radial-300x300.jpg" alt="" width="300" height="300" /></a></p>
<p>Perhaps one of the things I would like to do before NS - build a radial threshold filter.</p>
<p>Conventional threshold filters are constant throughout.  This is means that if let's say the image threshold value is 170, then that threshold value is applied to the WHOLE image.  That is pretty bad for some cameras.</p>
<p>Back when I was <a href="http://temasek.wetpaint.com/page/DSI:+Creation+of+LASER-aided+virtual+on-screen+image+interaction+systems">working on my DSI project</a>, I suggested implementing a radial threshold.  Bah, not enough time then.  This time, modular approach, OOP-based, voila.</p>
<p>My aim is to implement a radial threshold with a 2D-based function.  In some webcams, the distribution of light may not be even, even though it IS even.  It's just picked up with bias.  For example, let's say we want the threshold to be a logarithmic function.  Then we would use y = ln (x) or something (sometimes this works especially if you want the threshold to level out sooner than later.</p>
<p>All we have to do is then input this expression into the code, then by doing per-pixel iteration, we would be able to map that certain value for the specific pixel with the corresponding threshold value onto the image.  Now, in this case we will be plotting 2 graphs: one of the image and another of threshold versus the length of the line from the origin (centre of circle).</p>
<p>See the pic for more info <img src='http://joeltong.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Hopefully I can make an implementation fast enough to be used for video manipulation in AS3 =D</p>


<p>Related posts:<ol><li><a href='http://joeltong.org/blog/?p=41' rel='bookmark' title='Permanent Link: Image Interaction System ver 2.0'>Image Interaction System ver 2.0</a> <small>Hi, been attempting to do a rework of my image...</small></li>
<li><a href='http://joeltong.org/blog/?p=113' rel='bookmark' title='Permanent Link: Reflection'>Reflection</a> <small>Hey, I think the screen isn't as reflective as it...</small></li>
<li><a href='http://joeltong.org/blog/?p=104' rel='bookmark' title='Permanent Link: FLaser'>FLaser</a> <small>Hi, Been busy the past few days trying to do...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://joeltong.org/blog/?feed=rss2&amp;p=127</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random Filter Stuff</title>
		<link>http://joeltong.org/blog/?p=122</link>
		<comments>http://joeltong.org/blog/?p=122#comments</comments>
		<pubDate>Mon, 22 Feb 2010 13:45:48 +0000</pubDate>
		<dc:creator>Joel Tong</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[FLaser]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[bytearray]]></category>
		<category><![CDATA[filter]]></category>

		<guid isPermaLink="false">http://joeltong.org/blog/?p=122</guid>
		<description><![CDATA[Been playing around with some filters in Flash. Here's a few: Laplacian of Gaussians i.e. difference of Gaussians - subtract 2 images of varying gaussian blurs to produce image. Color exchange - flipping the colors using ColorMatrixFilter class. Enjoy! PS Just got my new iPhone, I am really in need of an SDK for Windows.  [...]


Related posts:<ol><li><a href='http://joeltong.org/blog/?p=74' rel='bookmark' title='Permanent Link: Random Flash Projects'>Random Flash Projects</a> <small>Hey there, Been a couple of days since I last...</small></li>
<li><a href='http://joeltong.org/blog/?p=120' rel='bookmark' title='Permanent Link: Improved Image Viewer'>Improved Image Viewer</a> <small>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_main_1904672831"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://joeltong.org/header/main.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://joeltong.org/header/main.swf"
			name="fm_main_1904672831"
			width="400"
			height="300">
	<!--<![endif]-->
		 
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object> Happy Chinese...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Been playing around with some filters in Flash.</p>
<p>Here's a few:</p>
<p>Laplacian of Gaussians i.e. difference of Gaussians - subtract 2 images of varying gaussian blurs to produce image.</p>
<p><a href="http://joeltong.org/blog/wp-content/uploads/2010/02/Screenshot_318.jpg"><img class="alignnone size-medium wp-image-125" title="Screenshot_318" src="http://joeltong.org/blog/wp-content/uploads/2010/02/Screenshot_318-300x247.jpg" alt="" width="300" height="247" /></a></p>
<p>Color exchange - flipping the colors using ColorMatrixFilter class.</p>

<a href='http://joeltong.org/blog/?attachment_id=123' title='Screenshot_321'><img width="150" height="150" src="http://joeltong.org/blog/wp-content/uploads/2010/02/Screenshot_321-150x150.jpg" class="attachment-thumbnail" alt="Screenshot_321" title="Screenshot_321" /></a>
<a href='http://joeltong.org/blog/?attachment_id=124' title='Screenshot_322'><img width="150" height="150" src="http://joeltong.org/blog/wp-content/uploads/2010/02/Screenshot_322-150x150.jpg" class="attachment-thumbnail" alt="Screenshot_322" title="Screenshot_322" /></a>
<a href='http://joeltong.org/blog/?attachment_id=125' title='Screenshot_318'><img width="150" height="150" src="http://joeltong.org/blog/wp-content/uploads/2010/02/Screenshot_318-150x150.jpg" class="attachment-thumbnail" alt="Screenshot_318" title="Screenshot_318" /></a>

<p>Enjoy!</p>
<p>PS Just got my new iPhone, I am really in need of an SDK for Windows.  XCode anyone?  Help! =P</p>


<p>Related posts:<ol><li><a href='http://joeltong.org/blog/?p=74' rel='bookmark' title='Permanent Link: Random Flash Projects'>Random Flash Projects</a> <small>Hey there, Been a couple of days since I last...</small></li>
<li><a href='http://joeltong.org/blog/?p=120' rel='bookmark' title='Permanent Link: Improved Image Viewer'>Improved Image Viewer</a> <small>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_main_1947814471"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://joeltong.org/header/main.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://joeltong.org/header/main.swf"
			name="fm_main_1947814471"
			width="400"
			height="300">
	<!--<![endif]-->
		 
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object> Happy Chinese...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://joeltong.org/blog/?feed=rss2&amp;p=122</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improved Image Viewer</title>
		<link>http://joeltong.org/blog/?p=120</link>
		<comments>http://joeltong.org/blog/?p=120#comments</comments>
		<pubDate>Tue, 16 Feb 2010 02:20:17 +0000</pubDate>
		<dc:creator>Joel Tong</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[LABS]]></category>
		<category><![CDATA[Nuggets of life]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[bytearray]]></category>
		<category><![CDATA[dynamic image viewer]]></category>
		<category><![CDATA[Flash image viewer]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://joeltong.org/blog/?p=120</guid>
		<description><![CDATA[
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_main_293286228"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://joeltong.org/header/main.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://joeltong.org/header/main.swf"
			name="fm_main_293286228"
			width="400"
			height="300">
	<!--<![endif]-->
		 
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object> Happy Chinese New Year!! Been dabbling around with my image viewer class during my free time in the past few days. Still purely AS3, albeit with more stuff like: Navigational bar Caption support Page left-page right flipping motion Varied animations to choose from.  If you can't decide, [...]


Related posts:<ol><li><a href='http://joeltong.org/blog/?p=77' rel='bookmark' title='Permanent Link: Dingle Music Player'>Dingle Music Player</a> <small>Heh been building a music player over the past 2...</small></li>
<li><a href='http://joeltong.org/blog/?p=41' rel='bookmark' title='Permanent Link: Image Interaction System ver 2.0'>Image Interaction System ver 2.0</a> <small>Hi, been attempting to do a rework of my image...</small></li>
<li><a href='http://joeltong.org/blog/?p=104' rel='bookmark' title='Permanent Link: FLaser'>FLaser</a> <small>Hi, Been busy the past few days trying to do...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_main_576158075"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://joeltong.org/header/main.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://joeltong.org/header/main.swf"
			name="fm_main_576158075"
			width="400"
			height="300">
	<!--<![endif]-->
		<a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Happy Chinese New Year!!  Been dabbling around with my image viewer class during my free time in the past few days.  Still purely AS3, albeit with more stuff like:</p>
<ul>
<li>Navigational bar</li>
<li>Caption support</li>
<li>Page left-page right flipping motion</li>
<li>Varied animations to choose from.  If you can't decide, leave it blank and it will randomize it for you.</li>
<li>Quite dynamic, and (compiled in CS3) it's only 15kB! xD</li>
<li>Auto screen-fit resizing</li>
</ul>
<p>Screenshot as above! =D   Enjoy!</p>
<p>So, proprietary or open-source? =D</p>


<p>Related posts:<ol><li><a href='http://joeltong.org/blog/?p=77' rel='bookmark' title='Permanent Link: Dingle Music Player'>Dingle Music Player</a> <small>Heh been building a music player over the past 2...</small></li>
<li><a href='http://joeltong.org/blog/?p=41' rel='bookmark' title='Permanent Link: Image Interaction System ver 2.0'>Image Interaction System ver 2.0</a> <small>Hi, been attempting to do a rework of my image...</small></li>
<li><a href='http://joeltong.org/blog/?p=104' rel='bookmark' title='Permanent Link: FLaser'>FLaser</a> <small>Hi, Been busy the past few days trying to do...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://joeltong.org/blog/?feed=rss2&amp;p=120</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XML Powered Gallery / Display Header (TOTALLY IN AS3)</title>
		<link>http://joeltong.org/blog/?p=117</link>
		<comments>http://joeltong.org/blog/?p=117#comments</comments>
		<pubDate>Sat, 13 Feb 2010 10:44:42 +0000</pubDate>
		<dc:creator>Joel Tong</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[AS3 coding mania]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[imba methods]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://joeltong.org/blog/?p=117</guid>
		<description><![CDATA[Hey, Currently I am at work doing a custom utils library for Flash. Of course, totally (or mostly) written in AS3 xDD. Just came up with the basic skeleton of an XML-powered header. Something like what I did for E Club, except this time it will be much more customizable and easier to use for [...]


Related posts:<ol><li><a href='http://joeltong.org/blog/?p=9' rel='bookmark' title='Permanent Link: AS3 Replacement for _root'>AS3 Replacement for _root</a> <small>Hey there, Ever wondered how to access another object on...</small></li>
<li><a href='http://joeltong.org/blog/?p=20' rel='bookmark' title='Permanent Link: Flash 3D Sound visualiser'>Flash 3D Sound visualiser</a> <small>Hey there, was quite bored, so decided to do a...</small></li>
<li><a href='http://joeltong.org/blog/?p=28' rel='bookmark' title='Permanent Link: AS3 Sound Visualiser with Particles (Flint)'>AS3 Sound Visualiser with Particles (Flint)</a> <small>Hey there Merry Christmas!  Haven't been posting for quite some...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Hey,</p>
<p>Currently I am at work doing a custom utils library for Flash.  Of course, totally (or mostly) written in AS3 xDD.  Just came up with the basic skeleton of an XML-powered header.  Something like what I did for E Club, except this time it will be much more customizable and easier to use for people w/o Flash.  Elegant - 12kB and I hope to put it more features too! =D</p>
<p><a href="http://joeltong.org/header/main.swf">See this site</a> for a live demonstration.</p>
<p>Since source is rather short, I shall post it here as well.  Look forward to a ver. 2 in the future! =)</p>
<pre>
<div class="codesnip-container" >
<div class="actionscript codesnip" style="font-family:monospace;">package org.<span class="me1">joelTong</span>.<span class="me1">utils</span>.<span class="me1">displayImages</span>
<span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">Bitmap</span>;
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">BitmapData</span>;
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">Loader</span>;
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">Sprite</span>;
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">net</span>.<span class="sy0">*</span>;
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">events</span>.<span class="sy0">*</span>;
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">utils</span>.<span class="me1">Timer</span>;

&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> caurina.<span class="me1">transitions</span>.<span class="sy0">*</span>;

&nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* joeltong.org
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* @author JOELTONG
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* joel [dot] tong [at] gmail [dot] com
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">class</span> ImageBanner <span class="kw3">extends</span> Sprite <span class="br0">&#123;</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> <span class="kw3">WIDTH</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :uint;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> <span class="kw3">HEIGHT</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :uint;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> _images &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :<span class="kw3">Array</span>; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//this is the image that is shown on stage</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> _imageList&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :<span class="kw3">Array</span>; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//this is the loader for the images i.e. precached</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> _xmlList&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :<span class="kw3">XML</span>; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//this is the xml file</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> _timer&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :Timer; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//switching purposes</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> _topIndex &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :uint;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//the index of the topmost image currently (1 or 0).</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> _curPic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :uint;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//the current index in imageList (up to the size of array).</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> ImageBanner<span class="br0">&#40;</span>w:uint = 0, h:uint = 0 <span class="br0">&#41;</span>:<span class="kw3">void</span> <span class="br0">&#123;</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">super</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> loader:URLLoader = <span class="kw2">new</span> URLLoader<span class="br0">&#40;</span><span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _images = <span class="kw2">new</span> <span class="kw3">Array</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _imageList = <span class="kw2">new</span> <span class="kw3">Array</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _timer = <span class="kw2">new</span> Timer<span class="br0">&#40;</span>4000, 0<span class="br0">&#41;</span>;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">WIDTH</span> = w;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">HEIGHT</span> = h;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _images = <span class="br0">&#91;</span><span class="kw2">new</span> Bitmap<span class="br0">&#40;</span><span class="kw2">new</span> BitmapData<span class="br0">&#40;</span><span class="kw3">WIDTH</span>, <span class="kw3">HEIGHT</span>, <span class="kw2">true</span>, 0xFFFF0000<span class="br0">&#41;</span><span class="br0">&#41;</span>,
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw2">new</span> Bitmap<span class="br0">&#40;</span><span class="kw2">new</span> BitmapData<span class="br0">&#40;</span><span class="kw3">WIDTH</span>, <span class="kw3">HEIGHT</span>, <span class="kw2">true</span>, 0xFF00FF00<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#93;</span>;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loader.<span class="me1">dataFormat</span> = URLLoaderDataFormat.<span class="kw3">TEXT</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loader.<span class="me1">addEventListener</span><span class="br0">&#40;</span>Event.<span class="me1">COMPLETE</span>, onXmlLoaded<span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loader.<span class="kw3">load</span><span class="br0">&#40;</span><span class="kw2">new</span> URLRequest<span class="br0">&#40;</span><span class="st0">&quot;bannerList.xml&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//add to container</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span class="br0">&#40;</span>_images<span class="br0">&#91;</span>1<span class="br0">&#93;</span><span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span class="br0">&#40;</span>_images<span class="br0">&#91;</span>0<span class="br0">&#93;</span><span class="br0">&#41;</span>;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//set up boundable area</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> mask:Sprite = <span class="kw2">new</span> Sprite<span class="br0">&#40;</span><span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mask.<span class="me1">graphics</span>.<span class="kw3">beginFill</span><span class="br0">&#40;</span>0xFF0000<span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mask.<span class="me1">graphics</span>.<span class="me1">drawRect</span><span class="br0">&#40;</span>0, 0, <span class="kw3">WIDTH</span>, <span class="kw3">HEIGHT</span><span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">this</span>.<span class="me1">mask</span> = mask;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">this</span>.<span class="me1">addEventListener</span><span class="br0">&#40;</span>MouseEvent.<span class="me1">CLICK</span>, onClick<span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> onXmlLoaded<span class="br0">&#40;</span><span class="kw3">e</span>:Event<span class="br0">&#41;</span>:<span class="kw3">void</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _xmlList = <span class="kw2">new</span> <span class="kw3">XML</span><span class="br0">&#40;</span><span class="kw3">e</span>.<span class="kw3">target</span>.<span class="kw3">data</span><span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">trace</span><span class="br0">&#40;</span>_xmlList.<span class="me1">entry</span>.<span class="kw3">length</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; precacheImages<span class="br0">&#40;</span><span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> precacheImages<span class="br0">&#40;</span><span class="br0">&#41;</span>:<span class="kw3">void</span> <span class="br0">&#123;</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i:uint = <span class="nu0">0</span>; i <span class="sy0">&amp;</span>lt; _xmlList.<span class="me1">entry</span>.<span class="kw3">length</span><span class="br0">&#40;</span><span class="br0">&#41;</span>; i++<span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _imageList.<span class="kw3">push</span><span class="br0">&#40;</span><span class="kw2">new</span> Image<span class="br0">&#40;</span><span class="kw3">WIDTH</span>,<span class="kw3">HEIGHT</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _imageList<span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="me1">setLoading</span><span class="br0">&#40;</span>_xmlList.<span class="me1">entry</span><span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="me1">location</span><span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">this</span>.<span class="me1">addEventListener</span><span class="br0">&#40;</span>Event.<span class="me1">ENTER_FRAME</span>, preloadImgs<span class="br0">&#41;</span>;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> preloadImgs<span class="br0">&#40;</span><span class="kw3">e</span>:Event<span class="br0">&#41;</span>:<span class="kw3">void</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>checkLoading<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; removeEventListener<span class="br0">&#40;</span>Event.<span class="me1">ENTER_FRAME</span>, preloadImgs<span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setupTimer<span class="br0">&#40;</span><span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> checkLoading<span class="br0">&#40;</span><span class="br0">&#41;</span>:<span class="kw3">Boolean</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i:uint = <span class="nu0">0</span>; i <span class="sy0">&amp;</span>lt; _xmlList.<span class="me1">entry</span>.<span class="kw3">length</span><span class="br0">&#40;</span><span class="br0">&#41;</span>; i++<span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span>_imageList<span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="me1">isLoaded</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">false</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">true</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> setupTimer<span class="br0">&#40;</span><span class="br0">&#41;</span>:<span class="kw3">void</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _timer.<span class="me1">addEventListener</span><span class="br0">&#40;</span>TimerEvent.<span class="me1">TIMER</span>, onTimer<span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _timer.<span class="kw3">start</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _topIndex = <span class="nu0">0</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _curPic = <span class="nu0">1</span>;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _images<span class="br0">&#91;</span>0<span class="br0">&#93;</span>.<span class="me1">bitmapData</span>.<span class="me1">draw</span><span class="br0">&#40;</span>_imageList<span class="br0">&#91;</span>0<span class="br0">&#93;</span><span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _images<span class="br0">&#91;</span>1<span class="br0">&#93;</span>.<span class="me1">bitmapData</span>.<span class="me1">draw</span><span class="br0">&#40;</span>_imageList<span class="br0">&#91;</span>1<span class="br0">&#93;</span><span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> onTimer<span class="br0">&#40;</span><span class="kw3">e</span>:TimerEvent = <span class="kw2">null</span><span class="br0">&#41;</span>:<span class="kw3">void</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Tweener.<span class="me1">addTween</span><span class="br0">&#40;</span>_images<span class="br0">&#91;</span>_topIndex<span class="br0">&#93;</span>, <span class="br0">&#123;</span> x: <span class="kw3">WIDTH</span>,
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">time</span>: <span class="nu0">1</span>,
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; transition:<span class="st0">&quot;easeInElastic&quot;</span>,
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onComplete: swap <span class="br0">&#125;</span> <span class="br0">&#41;</span>;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> swap<span class="br0">&#40;</span><span class="br0">&#41;</span>:<span class="kw3">void</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">trace</span><span class="br0">&#40;</span><span class="st0">&quot;called&quot;</span><span class="br0">&#41;</span>;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">this</span>.<span class="me1">swapChildren</span><span class="br0">&#40;</span>_images<span class="br0">&#91;</span>0<span class="br0">&#93;</span>, _images<span class="br0">&#91;</span>1<span class="br0">&#93;</span><span class="br0">&#41;</span>;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _topIndex = <span class="br0">&#40;</span>_topIndex + 1<span class="br0">&#41;</span> <span class="sy0">%</span> <span class="nu0">2</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _curPic = <span class="br0">&#40;</span>_curPic + 1<span class="br0">&#41;</span> <span class="sy0">%</span> _xmlList.<span class="me1">entry</span>.<span class="kw3">length</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">trace</span><span class="br0">&#40;</span><span class="st0">&quot;CURPIC: &quot;</span> + _curPic<span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">trace</span><span class="br0">&#40;</span><span class="st0">&quot;INDEX: &quot;</span> + _topIndex<span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">trace</span><span class="br0">&#40;</span>_imageList.<span class="kw3">length</span><span class="br0">&#41;</span>;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//TODO: FIX THIS BUG</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _images<span class="br0">&#91;</span><span class="br0">&#40;</span>_topIndex+1<span class="br0">&#41;</span> <span class="sy0">%</span> 2<span class="br0">&#93;</span>.<span class="me1">bitmapData</span>.<span class="me1">draw</span><span class="br0">&#40;</span>_imageList<span class="br0">&#91;</span>_curPic<span class="br0">&#93;</span><span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _images<span class="br0">&#91;</span><span class="br0">&#40;</span>_topIndex+1<span class="br0">&#41;</span> <span class="sy0">%</span> 2<span class="br0">&#93;</span>.<span class="me1">x</span> = <span class="nu0">0</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _images<span class="br0">&#91;</span><span class="br0">&#40;</span>_topIndex+1<span class="br0">&#41;</span> <span class="sy0">%</span> 2<span class="br0">&#93;</span>.<span class="me1">y</span> = <span class="nu0">0</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> onClick<span class="br0">&#40;</span><span class="kw3">e</span>:MouseEvent = <span class="kw2">null</span><span class="br0">&#41;</span>:<span class="kw3">void</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; navigateToURL<span class="br0">&#40;</span><span class="kw2">new</span> URLRequest<span class="br0">&#40;</span>_xmlList.<span class="me1">entry</span><span class="br0">&#91;</span>_curPic<span class="br0">&#93;</span>.<span class="kw3">url</span><span class="br0">&#41;</span>, <span class="st0">&quot;_blank&quot;</span><span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/*
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; private function onComplete(e:Event):void
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var bit:Bitmap = new Bitmap(new BitmapData(500, 200, true, 0xFFFF0000));
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bit.bitmapData.draw(e.target.content);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild(bit);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }*/</span>

&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>

<span class="br0">&#125;</span></div>
</div>
</pre>
<pre>
<div class="codesnip-container" >
<div class="actionscript codesnip" style="font-family:monospace;">package org.<span class="me1">joelTong</span>.<span class="me1">utils</span>.<span class="me1">displayImages</span>
<span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">Bitmap</span>;
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">BitmapData</span>;
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">Loader</span>;
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">events</span>.<span class="me1">Event</span>;
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">net</span>.<span class="me1">URLRequest</span>;

&nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* joeltong.org
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* @author JOELTONG
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* joel [dot] tong [at] gmail [dot] com
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">class</span> Image <span class="kw3">extends</span> Bitmap <span class="br0">&#123;</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> <span class="kw3">WIDTH</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :uint;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> <span class="kw3">HEIGHT</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :uint;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> loader&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :Loader;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> state &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :<span class="kw3">String</span>;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> Image<span class="br0">&#40;</span>w:uint = 100, h:uint = 100<span class="br0">&#41;</span>:<span class="kw3">void</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">WIDTH</span> = w;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">HEIGHT</span> = h;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">super</span><span class="br0">&#40;</span><span class="kw2">new</span> BitmapData<span class="br0">&#40;</span><span class="kw3">WIDTH</span>, <span class="kw3">HEIGHT</span>, <span class="kw2">true</span>, 0xFFFF0000<span class="br0">&#41;</span><span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; state = <span class="st0">&quot;LOADING&quot;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> setLoading<span class="br0">&#40;</span><span class="kw3">url</span>:<span class="kw3">String</span><span class="br0">&#41;</span>:<span class="kw3">void</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loader = <span class="kw2">new</span> Loader<span class="br0">&#40;</span><span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loader.<span class="kw3">load</span><span class="br0">&#40;</span><span class="kw2">new</span> URLRequest<span class="br0">&#40;</span><span class="kw3">url</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loader.<span class="me1">contentLoaderInfo</span>.<span class="me1">addEventListener</span><span class="br0">&#40;</span>Event.<span class="me1">COMPLETE</span>, onImgLoaded<span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">function</span> onImgLoaded<span class="br0">&#40;</span><span class="kw3">e</span>:Event<span class="br0">&#41;</span>:<span class="kw3">void</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">this</span>.<span class="me1">bitmapData</span>.<span class="me1">draw</span><span class="br0">&#40;</span><span class="kw3">e</span>.<span class="kw3">target</span>.<span class="me1">content</span><span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; state = <span class="st0">&quot;COMPLETE&quot;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> isLoaded<span class="br0">&#40;</span><span class="br0">&#41;</span>:<span class="kw3">Boolean</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>state == <span class="st0">&quot;COMPLETE&quot;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">true</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">false</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//getters and setters---------------------------------</span>

&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>

<span class="br0">&#125;</span></div>
</div>
</pre>
<pre>
<div class="codesnip-container" >
<div class="actionscript codesnip" style="font-family:monospace;">package
<span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">display</span>.<span class="me1">Sprite</span>;
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> org.<span class="me1">joelTong</span>.<span class="me1">utils</span>.<span class="me1">displayImages</span>.<span class="me1">ImageBanner</span>;

&nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* joeltong.org
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* @author JOELTONG
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* joel [dot] tong [at] gmail [dot] com
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span>

&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">class</span> Main <span class="kw3">extends</span> Sprite <span class="br0">&#123;</span>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> imageBanner:ImageBanner = <span class="kw2">new</span> ImageBanner<span class="br0">&#40;</span>1024,768<span class="br0">&#41;</span>;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> Main<span class="br0">&#40;</span><span class="br0">&#41;</span>:<span class="kw3">void</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span class="br0">&#40;</span>imageBanner<span class="br0">&#41;</span>;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>

&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>

<span class="br0">&#125;</span></div>
</div>
</pre>


<p>Related posts:<ol><li><a href='http://joeltong.org/blog/?p=9' rel='bookmark' title='Permanent Link: AS3 Replacement for _root'>AS3 Replacement for _root</a> <small>Hey there, Ever wondered how to access another object on...</small></li>
<li><a href='http://joeltong.org/blog/?p=20' rel='bookmark' title='Permanent Link: Flash 3D Sound visualiser'>Flash 3D Sound visualiser</a> <small>Hey there, was quite bored, so decided to do a...</small></li>
<li><a href='http://joeltong.org/blog/?p=28' rel='bookmark' title='Permanent Link: AS3 Sound Visualiser with Particles (Flint)'>AS3 Sound Visualiser with Particles (Flint)</a> <small>Hey there Merry Christmas!  Haven't been posting for quite some...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://joeltong.org/blog/?feed=rss2&amp;p=117</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crossdomain.xml woes</title>
		<link>http://joeltong.org/blog/?p=115</link>
		<comments>http://joeltong.org/blog/?p=115#comments</comments>
		<pubDate>Tue, 09 Feb 2010 13:00:36 +0000</pubDate>
		<dc:creator>Joel Tong</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Nuggets of life]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[woes]]></category>

		<guid isPermaLink="false">http://joeltong.org/blog/?p=115</guid>
		<description><![CDATA[Hey, After much trying, it seems that there's not much that can be done implementing an online radio station player in Flash due to the security sandbox. Realised that crossdomain.xml has to be implemented on the radio station server's side, not mine. AKA, the best would be to run it in adobe Air or within [...]


Related posts:<ol><li><a href='http://joeltong.org/blog/?p=74' rel='bookmark' title='Permanent Link: Random Flash Projects'>Random Flash Projects</a> <small>Hey there, Been a couple of days since I last...</small></li>
<li><a href='http://joeltong.org/blog/?p=104' rel='bookmark' title='Permanent Link: FLaser'>FLaser</a> <small>Hi, Been busy the past few days trying to do...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Hey,</p>
<p>After much trying, it seems that there's not much that can be done implementing an online radio station player in Flash due to the security sandbox.  Realised that crossdomain.xml has to be implemented on the radio station server's side, not mine.  AKA, the best would be to run it in adobe Air or within the Flash IDE itself.  =(</p>
<p>On a lighter note, I just passed my BTT.  Meaning that I can commence my driving lessons. =D</p>
<p>Shall go read up on group theory for machine vision.</p>
<p>Rgds,<br />
Joel Tong</p>


<p>Related posts:<ol><li><a href='http://joeltong.org/blog/?p=74' rel='bookmark' title='Permanent Link: Random Flash Projects'>Random Flash Projects</a> <small>Hey there, Been a couple of days since I last...</small></li>
<li><a href='http://joeltong.org/blog/?p=104' rel='bookmark' title='Permanent Link: FLaser'>FLaser</a> <small>Hi, Been busy the past few days trying to do...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://joeltong.org/blog/?feed=rss2&amp;p=115</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reflection</title>
		<link>http://joeltong.org/blog/?p=113</link>
		<comments>http://joeltong.org/blog/?p=113#comments</comments>
		<pubDate>Fri, 05 Feb 2010 15:03:40 +0000</pubDate>
		<dc:creator>Joel Tong</dc:creator>
				<category><![CDATA[FLaser]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[bytearray]]></category>
		<category><![CDATA[imba methods]]></category>
		<category><![CDATA[sound visualization]]></category>

		<guid isPermaLink="false">http://joeltong.org/blog/?p=113</guid>
		<description><![CDATA[Hey, I think the screen isn't as reflective as it should be. Hopefully it will work better on a wall? Haha. Anyways, thinking of doing this: max contrast -> max saturation -> greyscale -> gaussian blur -> threshold -> final img. Rgds, Joel Tong Related posts:Radial Thresholding in AS3 (Webcam) Perhaps one of the things [...]


Related posts:<ol><li><a href='http://joeltong.org/blog/?p=127' rel='bookmark' title='Permanent Link: Radial Thresholding in AS3 (Webcam)'>Radial Thresholding in AS3 (Webcam)</a> <small>Perhaps one of the things I would like to do...</small></li>
<li><a href='http://joeltong.org/blog/?p=139' rel='bookmark' title='Permanent Link: FLaser on Youtube'>FLaser on Youtube</a> <small>Hi there, Just posted 2 videos from my FLaser Ver...</small></li>
<li><a href='http://joeltong.org/blog/?p=65' rel='bookmark' title='Permanent Link: Type4 particle line spectrum released!'>Type4 particle line spectrum released!</a> <small>Hi there! Been working on a simple line visualization for...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Hey,</p>
<p>I think the screen isn't as reflective as it should be.  Hopefully it will work better on a wall?  Haha.  Anyways, thinking of doing this:</p>
<p>max contrast -> max saturation -> greyscale -> gaussian blur -> threshold -> final img.</p>
<p>Rgds,<br />
Joel Tong</p>


<p>Related posts:<ol><li><a href='http://joeltong.org/blog/?p=127' rel='bookmark' title='Permanent Link: Radial Thresholding in AS3 (Webcam)'>Radial Thresholding in AS3 (Webcam)</a> <small>Perhaps one of the things I would like to do...</small></li>
<li><a href='http://joeltong.org/blog/?p=139' rel='bookmark' title='Permanent Link: FLaser on Youtube'>FLaser on Youtube</a> <small>Hi there, Just posted 2 videos from my FLaser Ver...</small></li>
<li><a href='http://joeltong.org/blog/?p=65' rel='bookmark' title='Permanent Link: Type4 particle line spectrum released!'>Type4 particle line spectrum released!</a> <small>Hi there! Been working on a simple line visualization for...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://joeltong.org/blog/?feed=rss2&amp;p=113</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
