<?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>ActionScript Scraps &#187; static function</title>
	<atom:link href="http://blog.sitedaniel.com/tag/static-function/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sitedaniel.com</link>
	<description>Flash, Flex and AIR development</description>
	<lastBuildDate>Wed, 28 Jul 2010 11:15:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Leading Zero Static function for digital clock</title>
		<link>http://blog.sitedaniel.com/2008/09/leading-zero-static-function-for-digital-clock/</link>
		<comments>http://blog.sitedaniel.com/2008/09/leading-zero-static-function-for-digital-clock/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 11:13:33 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[as2.0]]></category>
		<category><![CDATA[static function]]></category>

		<guid isPermaLink="false">http://blog.sitedaniel.com/?p=77</guid>
		<description><![CDATA[If you've ever created a digital timer or clock then you probably used something like this function. It adds a leading zero if the number is only one digit long. This means that if the minute value is '6' then it will return '06'. eg. 12:06:43 &#160; class com.sitedaniel.utils.StringUtil &#123; public function StringUtil&#40;&#41;&#123;&#125; /** * [...]]]></description>
			<content:encoded><![CDATA[<p>If you've ever created a digital timer or clock then you probably used something like this function. It adds a leading zero if the number is only one digit long. This means that if the minute value is '6' then it will return '06'. eg. 12:06:43</p>
<pre class="actionscript">&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> com.<span style="color: #006600;">sitedaniel</span>.<span style="color: #006600;">utils</span>.<span style="color: #006600;">StringUtil</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> StringUtil<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>
	<span style="color: #808080; font-style: italic;">/**
	 * leadingZero
	 * Adds a zero if the length is less than 2
	 * @param	s
	 * @return  String with length of 2
	/*
	eg.
	input '0'  return '00'
	input '5'  return '05'
	input '24' return '24'
	*/</span>
	<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">function</span> leadingZero<span style="color: #66cc66;">&#40;</span>s:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">String</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">switch</span> <span style="color: #66cc66;">&#40;</span>s.<span style="color: #0066CC;">length</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">1</span> :
				<span style="color: #b1b100;">return</span> <span style="color: #ff0000;">&quot;0&quot;</span> + s;
				<span style="color: #b1b100;">break</span>;
			<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">2</span> :
				<span style="color: #b1b100;">return</span> s;
				<span style="color: #b1b100;">break</span>;
			<span style="color: #000000; font-weight: bold;">default</span> :
				<span style="color: #b1b100;">return</span> s;
				<span style="color: #b1b100;">break</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.sitedaniel.com/2008/09/leading-zero-static-function-for-digital-clock/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS2.0 DesignTool</title>
		<link>http://blog.sitedaniel.com/2008/08/as20-designtool/</link>
		<comments>http://blog.sitedaniel.com/2008/08/as20-designtool/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 19:24:00 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[as2.0]]></category>
		<category><![CDATA[design tool]]></category>
		<category><![CDATA[static function]]></category>

		<guid isPermaLink="false">http://blog.sitedaniel.com/?p=65</guid>
		<description><![CDATA[Following up on an earlier post, here is the AS2.0 version of the dragToPosition X &#38; Y coordinate tracer. class com.sitedaniel.utils.Design { public static function dragToPosition(mc:MovieClip):Void { mc.onPress = function():Void { startDrag(this, false); } mc.onRelease = function():Void { this.stopDrag(); trace(this._x + ', ' + this._y); } } }]]></description>
			<content:encoded><![CDATA[<p>Following up on an earlier post, here is the AS2.0 version of the dragToPosition X &amp; Y coordinate tracer.</p>
<pre>
class com.sitedaniel.utils.Design
{
	public static function dragToPosition(mc:MovieClip):Void
	{
		mc.onPress = function():Void
		{
			startDrag(this, false);
		}
		mc.onRelease = function():Void
		{
			this.stopDrag();
			trace(this._x + ', ' + this._y);
		}
	}
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.sitedaniel.com/2008/08/as20-designtool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
