<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Random Musings on AIR, Flex and ColdFusion</title>
	<atom:link href="http://coldfusionflex.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://coldfusionflex.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Mon, 17 Mar 2008 03:43:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='coldfusionflex.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Random Musings on AIR, Flex and ColdFusion</title>
		<link>http://coldfusionflex.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://coldfusionflex.wordpress.com/osd.xml" title="Random Musings on AIR, Flex and ColdFusion" />
	<atom:link rel='hub' href='http://coldfusionflex.wordpress.com/?pushpress=hub'/>
		<item>
		<title>WTF are they *thinking*?</title>
		<link>http://coldfusionflex.wordpress.com/2008/03/16/wtf-are-they-thinking/</link>
		<comments>http://coldfusionflex.wordpress.com/2008/03/16/wtf-are-they-thinking/#comments</comments>
		<pubDate>Sun, 16 Mar 2008 23:30:25 +0000</pubDate>
		<dc:creator>coldfusionflex</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Adobe AIR/Flex]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://coldfusionflex.wordpress.com/?p=5</guid>
		<description><![CDATA[I&#8217;m working on an AIR app today and I&#8217;m trying to compare my system time with the current time in New York (I&#8217;m in California). So the first thing I want to do is to see if the date flipped over already in New York. I compare my local system date with the date coming [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coldfusionflex.wordpress.com&amp;blog=3181686&amp;post=5&amp;subd=coldfusionflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on an AIR app today and I&#8217;m trying to compare my system time with the current time in New York (I&#8217;m in California). So the first thing I want to do is to see if the date flipped over already in New York. I compare my local system date with the date coming back from the remote server. Seems pretty simple.</p>
<p>According to Adobe:</p>
<p><a target="_blank" href="http://livedocs.adobe.com/labs/flex3/langref/Date.html">http://livedocs.adobe.com/labs/flex3/langref/Date.html</a></p>
<p><strong>Date()</strong> Constructor</p>
<ul>
<li>If you pass no arguments, the Date object is assigned the current date and time.</li>
</ul>
<p>So I create an Date object:</p>
<p>var <span class="blsp-spelling-error">todaysDate</span> <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> ate = new Date();<br />
trace(&#8220;<span class="blsp-spelling-error">todaysDate</span>: &#8221; + <span class="blsp-spelling-error">todaysDate</span>.month + &#8220;/&#8221; + <span class="blsp-spelling-error">todaysDate</span>.date + &#8220;/&#8221; + <span class="blsp-spelling-error">todaysDate</span>.<span class="blsp-spelling-error">fullYear</span>);</p>
<p>and the trace comes out as &#8220;<span class="blsp-spelling-error">todaysDate</span>: 2/15/2008&#8243;</p>
<p>I&#8217;m scratching my head. I&#8217;m pretty sure it&#8217;s March, so I reboot and check the system date. Sure enough, it&#8217;s March. OK&#8230;So I start looking around:</p>
<p><a target="_blank" href="http://bugs.adobe.com/jira/browse/SDK-14658">http://bugs.adobe.com/jira/browse/SDK-14658</a></p>
<p>&#8220;Not a bug. Dates in <span class="blsp-spelling-error">ActionScript</span> are zero based. For more information, see: <a target="_blank" href="http://livedocs.adobe.com/labs/flex3/langref/mx/controls/DateChooser.html#displayedMonth">http://livedocs.adobe.com/labs/flex3/langref/mx/controls/DateChooser.html#displayedMonth</a>&#8220;</p>
<p>Now this might not be a *bug*, but it&#8217;s <span class="blsp-spelling-error">freakin</span>&#8216; <span class="blsp-spelling-error">STOOPID</span>. The days aren&#8217;t zero based. Why should the months be? I don&#8217;t where these guys grew up, but since when has January been month zero? Apparently on Planet Adobe January 1, 2008 is annotated 1/0/2008. Makes perfect sense to me.</p>
<p>I guess I&#8217;ve never run into this before because every time I&#8217;ve used the Date() it&#8217;s been relative&#8230;relatively WRONG.</p>
<p>Come on, guys&#8230;why should I have to write extra code to try to <span class="blsp-spelling-error">figger</span> out the MONTH on my local computer?</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/coldfusionflex.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/coldfusionflex.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/coldfusionflex.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/coldfusionflex.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/coldfusionflex.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/coldfusionflex.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/coldfusionflex.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/coldfusionflex.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/coldfusionflex.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/coldfusionflex.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/coldfusionflex.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/coldfusionflex.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/coldfusionflex.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/coldfusionflex.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/coldfusionflex.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/coldfusionflex.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coldfusionflex.wordpress.com&amp;blog=3181686&amp;post=5&amp;subd=coldfusionflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://coldfusionflex.wordpress.com/2008/03/16/wtf-are-they-thinking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b291aa7e7e71bdfad306160d3aba1f17?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">coldfusionflex</media:title>
		</media:content>
	</item>
		<item>
		<title>NativeApplication.nativeapplication.startAtLogin</title>
		<link>http://coldfusionflex.wordpress.com/2008/03/16/nativeapplicationnativeapplicationstartatlogin/</link>
		<comments>http://coldfusionflex.wordpress.com/2008/03/16/nativeapplicationnativeapplicationstartatlogin/#comments</comments>
		<pubDate>Sun, 16 Mar 2008 23:25:44 +0000</pubDate>
		<dc:creator>coldfusionflex</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>

		<guid isPermaLink="false">http://coldfusionflex.wordpress.com/2008/03/16/nativeapplicationnativeapplicationstartatlogin/</guid>
		<description><![CDATA[So I&#8217;m trying to set some user preferences on an AIR app and one includes if the app should start on login. I run the app in FlexBuilder and I get a RTE when the function gets called: Error #2014: Feature is not available at this time Turns out this is an AIR bug: http://bugs.adobe.com/jira/browse/SDK-14282 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coldfusionflex.wordpress.com&amp;blog=3181686&amp;post=4&amp;subd=coldfusionflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;m trying to set some user preferences on an AIR app and one includes if the app should start on login. I run the app in FlexBuilder and I get a RTE when the function gets called:</p>
<p>Error #2014: Feature is not available at this time</p>
<p>Turns out this is an AIR bug:</p>
<p><a href="http://bugs.adobe.com/jira/browse/SDK-14282" target="_blank">http://bugs.adobe.com/jira/browse/SDK-14282</a></p>
<p>The suggestion is that one should:</p>
<p>&#8220;evaluate if you are in the IDE before setting this property&#8221;</p>
<p>Any clues about how one might actually *do* this in ActionScript? I&#8217;ve searched to no avail.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/coldfusionflex.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/coldfusionflex.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/coldfusionflex.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/coldfusionflex.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/coldfusionflex.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/coldfusionflex.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/coldfusionflex.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/coldfusionflex.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/coldfusionflex.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/coldfusionflex.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/coldfusionflex.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/coldfusionflex.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/coldfusionflex.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/coldfusionflex.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/coldfusionflex.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/coldfusionflex.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coldfusionflex.wordpress.com&amp;blog=3181686&amp;post=4&amp;subd=coldfusionflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://coldfusionflex.wordpress.com/2008/03/16/nativeapplicationnativeapplicationstartatlogin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b291aa7e7e71bdfad306160d3aba1f17?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">coldfusionflex</media:title>
		</media:content>
	</item>
		<item>
		<title>DragBitmap.as</title>
		<link>http://coldfusionflex.wordpress.com/2008/03/16/dragbitmapas/</link>
		<comments>http://coldfusionflex.wordpress.com/2008/03/16/dragbitmapas/#comments</comments>
		<pubDate>Sun, 16 Mar 2008 23:13:20 +0000</pubDate>
		<dc:creator>coldfusionflex</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>

		<guid isPermaLink="false">http://coldfusionflex.wordpress.com/?p=3</guid>
		<description><![CDATA[Christophe Coenraets (http://coenraets.org/) put together a pretty kewl class to drag a bitmap from an AIR app to the desktop. Unfortunately the classes changed between Beta3 and the final release and the version he has on his site no longer works. This version works with the current release. It&#8217;s called like this: &#60;utilities:DragBitmap displayObject=&#8221;{theObject}&#8220;/&#62; The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coldfusionflex.wordpress.com&amp;blog=3181686&amp;post=3&amp;subd=coldfusionflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Christophe Coenraets (<a target="_blank" href="http://coenraets.org/">http://coenraets.org/</a>) put together a pretty kewl class to drag a bitmap from an AIR app to the desktop. Unfortunately the classes changed between Beta3 and the final release and the version he has on his site no longer works. This version works with the current release.</p>
<p>It&#8217;s called like this:</p>
<p><font size="2" color="#0000ff">&lt;utilities:DragBitmap<font size="2"> displayObject=&#8221;</font><font size="2" color="#990000">{</font><font size="2">theObject</font><font size="2" color="#990000">}</font><font size="2">&#8220;</font><font size="2" color="#0000ff">/&gt;</font></font></p>
<p>The package itself:</p>
<p><pre class="brush: java;">
package {

	import com.adobe.images.JPGEncoder;

	import flash.desktop.Clipboard;
	import flash.desktop.ClipboardFormats;
	import flash.desktop.NativeDragManager;
	import flash.desktop.NativeDragOptions;
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.DisplayObject;
	import flash.display.InteractiveObject;
	import flash.display.Loader;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.filesystem.File;
	import flash.filesystem.FileMode;
	import flash.filesystem.FileStream;
	import flash.net.URLRequest;
	import flash.utils.ByteArray;

	import mx.formatters.DateFormatter;

	public class DragBitmap
	{
		private var _displayObject:DisplayObject;
		private var dateFormatter:DateFormatter;

		public var dragIcon:BitmapData;

		public function DragBitmap()
		{
			var loader:Loader = new Loader();
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
				function ():void
				{
					dragIcon = Bitmap(loader.content).bitmapData;
				}
			);
			loader.load(new URLRequest(&quot;assets/icons/icon_image.png&quot;));
			dateFormatter = new DateFormatter();
			dateFormatter.formatString = &quot;YYYY-MM-DD-HH-NN-SS&quot;;
		} 

		public function set displayObject(displayObject:DisplayObject):void
		{
			_displayObject = displayObject;
			_displayObject.addEventListener(MouseEvent.MOUSE_MOVE, startDragging);
		}

		private function startDragging(event:MouseEvent):void
		{
			if (!event.buttonDown)
			{
				return;
			}

			var options:NativeDragOptions = new NativeDragOptions();
			options.allowCopy = true;
			options.allowLink = true;
			options.allowMove = false;

			var data:Clipboard = new Clipboard();
			data.setData(ClipboardFormats.BITMAP_FORMAT, getBitmapData(), false);
			data.setData(ClipboardFormats.FILE_LIST_FORMAT,[createTempJPG()]);

			NativeDragManager.doDrag(_displayObject as InteractiveObject, data, dragIcon, null);
		}

		private function getBitmapData():BitmapData
		{
			var bd:BitmapData = new BitmapData(_displayObject.width, _displayObject.height);
			bd.draw(_displayObject);
			return bd;
		}

		private function createTempJPG():File
		{
			var file:File = File.createTempDirectory().resolvePath(&quot;data-&quot;+dateFormatter.format(new Date())+&quot;.jpg&quot;);
			var fileStream:FileStream = new FileStream();
			fileStream.open(file, FileMode.WRITE);
			fileStream.writeBytes(encodeJPG());
			fileStream.close();
			return file;
		}

		private function encodeJPG():ByteArray
		{
			var jpgEncoder:JPGEncoder = new JPGEncoder();
			var bytes:ByteArray = jpgEncoder.encode(getBitmapData());
			return bytes;
		}

	}
}</pre></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/coldfusionflex.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/coldfusionflex.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/coldfusionflex.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/coldfusionflex.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/coldfusionflex.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/coldfusionflex.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/coldfusionflex.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/coldfusionflex.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/coldfusionflex.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/coldfusionflex.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/coldfusionflex.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/coldfusionflex.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/coldfusionflex.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/coldfusionflex.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/coldfusionflex.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/coldfusionflex.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coldfusionflex.wordpress.com&amp;blog=3181686&amp;post=3&amp;subd=coldfusionflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://coldfusionflex.wordpress.com/2008/03/16/dragbitmapas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b291aa7e7e71bdfad306160d3aba1f17?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">coldfusionflex</media:title>
		</media:content>
	</item>
	</channel>
</rss>
