<?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>In Flagrante Delicto! &#187; ActionScript</title>
	<atom:link href="http://inflagrantedelicto.memoryspiral.com/tag/actionscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://inflagrantedelicto.memoryspiral.com</link>
	<description>Joseph Labrecque: Senior Interactive Software Engineer - Artist - Author - Speaker - Adobe Education Leader - Adobe Community Professional</description>
	<lastBuildDate>Mon, 06 Feb 2012 15:10:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Getting Started with ActionScript</title>
		<link>http://inflagrantedelicto.memoryspiral.com/2011/12/getting-started-with-actionscript/</link>
		<comments>http://inflagrantedelicto.memoryspiral.com/2011/12/getting-started-with-actionscript/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 21:52:03 +0000</pubDate>
		<dc:creator>Joseph Labrecque</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Publication]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://inflagrantedelicto.memoryspiral.com/?p=3946</guid>
		<description><![CDATA[ActionScript is an object-oriented programming language that has a wide reach on the web, the desktop, mobile devices, and beyond. If you want to be able to hit many targets with one code base, ActionScript is a great way to &#8230; <a href="http://inflagrantedelicto.memoryspiral.com/2011/12/getting-started-with-actionscript/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.video2brain.com/en/products-247.htm"><img src="http://inflagrantedelicto.memoryspiral.com/wp-content/uploads/2011/12/en159banner.jpg" alt="Getting Started with ActionScript" title="Getting Started with ActionScript" width="550" height="246" class="size-full wp-image-3956" /></a></p>
<p>ActionScript is an object-oriented programming language that has a wide reach on the web, the desktop, mobile devices, and beyond. If you want to be able to hit many targets with one code base, ActionScript is a great way to do so; it also lets you build a variety of application types, from 2D and 3D games to enterprise applications, video players, and more. In this workshop, expert software engineer Joseph Labrecque teaches you the very fundamentals of programming in ActionScript 3 using both Flash Professional and Flash Builder. You will learn how to use core constructs and object types such as variables, arrays, and functions, as well as more advanced types like video, sound, XML, and JSON.</p>
<p><a href="http://www.video2brain.com/en/products-247.htm"><img src="http://inflagrantedelicto.memoryspiral.com/wp-content/uploads/2011/12/EN159-e1324316583321.png" alt="" title="EN159" width="169" height="250" class="alignright size-full wp-image-3955" /></a></p>
<p><a href="http://www.video2brain.com/en/products-247.htm">Access the full workshop</a>.</p>
<p><a href="http://www.video2brain.com/en/download/temp/getting_started_with_actionscript.pdf">Grab the detailed release [PDF]</a>.</p>
<p>The following three sample movies are public:</p>
<ul>
<li><a href="http://www.video2brain.com/en/videos-11415.htm">AS3 Language Fundamentals</a></li>
<li><a href="http://www.video2brain.com/en/videos-11423.htm">Compiling and Debugging</a></li>
<li><a href="http://www.video2brain.com/en/videos-11445.htm">TextField and TextFormat</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://inflagrantedelicto.memoryspiral.com/2011/12/getting-started-with-actionscript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Custom Context Menus in Flash</title>
		<link>http://inflagrantedelicto.memoryspiral.com/2011/07/creating-custom-context-menus-in-flash/</link>
		<comments>http://inflagrantedelicto.memoryspiral.com/2011/07/creating-custom-context-menus-in-flash/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 19:42:05 +0000</pubDate>
		<dc:creator>Joseph Labrecque</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://inflagrantedelicto.memoryspiral.com/?p=3327</guid>
		<description><![CDATA[The assets for my 5 minute quick tip talk for the 2011 Adobe Education Leader Institute are located here. This is the completed example (Flash Professional CS5.5): [download AEL2011_FlashContextMenu] Here is an image preview: Here is the SWF: And here &#8230; <a href="http://inflagrantedelicto.memoryspiral.com/2011/07/creating-custom-context-menus-in-flash/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The assets for my 5 minute quick tip talk for the 2011 <strong>Adobe Education Leader Institute</strong> are located here. This is the completed example (Flash Professional CS5.5):<br />
<strong>[download <a href="http://inflagrantedelicto.memoryspiral.com/wp-content/uploads/2011/07/AEL2011_FlashContextMenu.zip">AEL2011_FlashContextMenu</a>]</strong></p>
<p>Here is an image preview:<br />
<div id="attachment_3563" class="wp-caption alignleft" style="width: 560px"><img class="size-full wp-image-3563" title="Custom Context Menus!" src="http://inflagrantedelicto.memoryspiral.com/wp-content/uploads/2011/07/contextmenus.png" alt="" width="550" height="327" /><p class="wp-caption-text">Custom Context Menus!</p></div></p>
<p>Here is the SWF:<br />

<object width="350" height="300">
<param name="movie" value="http://inflagrantedelicto.memoryspiral.com/wp-content/uploads/2011/07/contextmenu.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#000000"></param>
<param name="allowScriptAccess" value="always"></param>
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" width="350" height="300" src="http://inflagrantedelicto.memoryspiral.com/wp-content/uploads/2011/07/contextmenu.swf" quality="high" bgcolor="#000000" wmode="window" menu="false" allowFullScreen="true" ></embed>
</object>
</p>
<p>And here be the code bits!</p>
<pre class="brush:as3">package  {
	import flash.display.Sprite;
	import flash.ui.ContextMenu;
	import flash.ui.ContextMenuItem;
	import flash.ui.ContextMenuBuiltInItems;
	import flash.net.URLRequest;
	import flash.net.navigateToURL;
	import flash.events.ContextMenuEvent;

	public class CustomMenu extends Sprite {
		private const MENUITEM_FVM:String = "©2011 Fractured Vision Media, LLC";
		private const MENUITEM_JOSEPH:String = "Joseph Labrecque";

		public function CustomMenu(){
			buildMenu();
		}

		private function buildMenu():void {
			var myMenu:ContextMenu = new ContextMenu();
			myMenu.hideBuiltInItems();

			var menuItem0:ContextMenuItem = new ContextMenuItem(MENUITEM_FVM);
			menuItem0.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, visitURL);

			var menuItem1:ContextMenuItem = new ContextMenuItem(MENUITEM_JOSEPH);
			menuItem1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, visitURL);
			menuItem1.separatorBefore = true;

			myMenu.customItems.push(menuItem0);
			myMenu.customItems.push(menuItem1);

			this.contextMenu = myMenu;
		}

		private function visitURL(e:ContextMenuEvent):void {
			var site:String = "";
			switch(e.target.caption){
				case MENUITEM_FVM:
					site = "http://fracturedvisionmedia.com/";
					break;
				case MENUITEM_JOSEPH:
					site = "http://josephLabrecque.com/";
					break;
			}
			navigateToURL(new URLRequest(site), "_blank");
		}

	}

}</pre>
]]></content:encoded>
			<wfw:commentRss>http://inflagrantedelicto.memoryspiral.com/2011/07/creating-custom-context-menus-in-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeBass Article: AS3 Audio Libraries</title>
		<link>http://inflagrantedelicto.memoryspiral.com/2010/11/codebass-article-as3-audio-libraries/</link>
		<comments>http://inflagrantedelicto.memoryspiral.com/2010/11/codebass-article-as3-audio-libraries/#comments</comments>
		<pubDate>Wed, 17 Nov 2010 17:30:56 +0000</pubDate>
		<dc:creator>Joseph Labrecque</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://inflagrantedelicto.memoryspiral.com/?p=2692</guid>
		<description><![CDATA[An article I had written on using a variety of ActionScript and Alchemy-based audio encoding libraries in Flash Player has been published over at CodeBass. Check it out and even play with the demo set from within your web browser. &#8230; <a href="http://inflagrantedelicto.memoryspiral.com/2010/11/codebass-article-as3-audio-libraries/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="attachment_2694" class="wp-caption alignright" style="width: 216px"><a href="http://codebass.net/?p=35708"><img src="http://inflagrantedelicto.memoryspiral.com/wp-content/uploads/2010/11/audiotests-206x300.jpg" alt="" title="audiotests" width="206" height="300" class="size-medium wp-image-2694" /></a><p class="wp-caption-text">Audio Tests</p></div>
<p>An <a href="http://codebass.net/?p=35708">article</a> I had written on using a variety of ActionScript and Alchemy-based audio encoding libraries in Flash Player has been published over at CodeBass. </p>
<p>Check it out and even play with the demo set from within your web browser. Full source code and links to referenced AS3 libraries is also available.</p>
<p>Nice to finally get something up there!</p>
]]></content:encoded>
			<wfw:commentRss>http://inflagrantedelicto.memoryspiral.com/2010/11/codebass-article-as3-audio-libraries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>InsideRIA: AIR 2.0 NativeProcess API &#8211; What’s It Good For?</title>
		<link>http://inflagrantedelicto.memoryspiral.com/2010/06/insideria-air-2-0-nativeprocess-api-what%e2%80%99s-it-good-for/</link>
		<comments>http://inflagrantedelicto.memoryspiral.com/2010/06/insideria-air-2-0-nativeprocess-api-what%e2%80%99s-it-good-for/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 17:38:42 +0000</pubDate>
		<dc:creator>Joseph Labrecque</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript]]></category>

		<guid isPermaLink="false">http://inflagrantedelicto.memoryspiral.com/?p=2030</guid>
		<description><![CDATA[Just a quick post to encourage everyone to check out my article over at InsideRIA: AIR 2.0 NativeProcess API &#8211; What’s It Good For? While there are a few examples available for connecting AIR applications to native operating system processes &#8230; <a href="http://inflagrantedelicto.memoryspiral.com/2010/06/insideria-air-2-0-nativeprocess-api-what%e2%80%99s-it-good-for/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Just a quick post to encourage everyone to check out my article over at InsideRIA:</p>
<p><a href="http://www.insideria.com/2010/06/air-20-nativeprocess-api---wha.html"><strong>AIR 2.0 NativeProcess API &#8211; What’s It Good For?</strong></a></p>
<blockquote><p>
<a href="http://www.insideria.com/2010/06/air-20-nativeprocess-api---wha.html"><img src="http://inflagrantedelicto.memoryspiral.com/wp-content/uploads/2010/06/insideRIA-300x234.png" alt="" title="InsideRIA" width="300" height="234" class="alignright size-medium wp-image-2036" /></a>While there are a few examples available for connecting AIR applications to native operating system processes today, most of them are basic &#8220;Hello World&#8221; examples, or happen to be purely theoretical. I&#8217;ve only come across one  or two  real world examples of applications that leverage this functionality in a meaningful way. In this article, I&#8217;m going to talk about the DropFolders application which uses AIR 2.0 NativeProcess APIs to make working with HandBrake a more streamlined, hands-off process.
</p></blockquote>
<p><a href="http://www.insideria.com/2010/06/air-20-nativeprocess-api---wha.html"><strong>Read the full article!</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://inflagrantedelicto.memoryspiral.com/2010/06/insideria-air-2-0-nativeprocess-api-what%e2%80%99s-it-good-for/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strange ActionScript dispatchEvent / addEventListener Gotcha</title>
		<link>http://inflagrantedelicto.memoryspiral.com/2010/03/strange-actionscript-dispatchevent-addeventlistener-gotcha/</link>
		<comments>http://inflagrantedelicto.memoryspiral.com/2010/03/strange-actionscript-dispatchevent-addeventlistener-gotcha/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 16:45:16 +0000</pubDate>
		<dc:creator>Joseph Labrecque</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://inflagrantedelicto.memoryspiral.com/?p=1556</guid>
		<description><![CDATA[I came across a strange situation over the weekend where a custom event being broadcast through dispatchEvent() was not being caught by the registered listener object. To make things even more bizarre, hasEventListener() definitely showed the event as registered, and &#8230; <a href="http://inflagrantedelicto.memoryspiral.com/2010/03/strange-actionscript-dispatchevent-addeventlistener-gotcha/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I came across a strange situation over the weekend where a custom event being broadcast through dispatchEvent() was not being caught by the registered listener object. To make things even more bizarre, hasEventListener() definitely showed the event as registered, and I could even trace the type out through willTrigger().</p>
<p>Relevant example code is below:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> fileDoesNotExist<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:IOErrorEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
		textSlide = <span style="color: #000000; font-weight: bold;">new</span> TextSlide<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">data</span>.<span style="color: #006600;">comment</span><span style="color: #66cc66;">&#41;</span>;
		textSlide.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;slideReady&quot;</span>, writeIt<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> writeIt<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #808080; font-style: italic;">// Okay!</span>
	<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>After a bunch of experimentation and comparing this structure with similar classes, I found that simply delaying the event dispatcher with a Timer by a few milliseconds resulted in a successful dispatch and capture.</p>
<p>Now, the class transmitting the event is a very simple one that simply has a constructor function that renders some bitmapData from injected data (severely shortened for this example):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">package edu.<span style="color: #006600;">du</span>.<span style="color: #006600;">image</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> edu.<span style="color: #006600;">du</span>.<span style="color: #006600;">image</span>.<span style="color: #006600;">ResizeImage</span>;
&nbsp;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Bitmap</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">BitmapData</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Shape</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">EventDispatcher</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">TimerEvent</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">text</span>.<span style="color: #0066CC;">TextField</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">Timer</span>;
&nbsp;
	<span style="color: #66cc66;">&#91;</span>Event<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;slideReady&quot;</span>, <span style="color: #0066CC;">type</span>=<span style="color: #ff0000;">&quot;flash.events.Event&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> TextSlide <span style="color: #0066CC;">extends</span> Bitmap <span style="color: #66cc66;">&#123;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> TextSlide<span style="color: #66cc66;">&#40;</span>t:<span style="color: #0066CC;">String</span>, bitmapData:BitmapData=<span style="color: #000000; font-weight: bold;">null</span>, pixelSnapping:<span style="color: #0066CC;">String</span>=<span style="color: #ff0000;">&quot;auto&quot;</span>, <span style="color: #0066CC;">smoothing</span>:<span style="color: #0066CC;">Boolean</span>=<span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span>bitmapData, pixelSnapping, <span style="color: #0066CC;">smoothing</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">/*
&nbsp;
			perform a set of processes to render text to bitmapData
			almost all is removed in this example
			you get the idea...
&nbsp;
			*/</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">var</span> timer:Timer = <span style="color: #000000; font-weight: bold;">new</span> Timer<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">500</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
			timer.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>TimerEvent.<span style="color: #006600;">TIMER_COMPLETE</span>, eGo<span style="color: #66cc66;">&#41;</span>;
			timer.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> eGo<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:TimerEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			dispatchEvent<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Event<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;slideReady&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>Putting the Timer delay on there fixes everything. The only thing I can think of is that the constructor function must execute so quickly that the listener on the parent just hasn&#8217;t completely registered yet! </p>
<p>One of those things that can drive you nuts and waste hours of time. </p>
]]></content:encoded>
			<wfw:commentRss>http://inflagrantedelicto.memoryspiral.com/2010/03/strange-actionscript-dispatchevent-addeventlistener-gotcha/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Adobe AIR: Preventing Users from Closing the App</title>
		<link>http://inflagrantedelicto.memoryspiral.com/2009/12/adobe-air-preventing-users-from-closing-the-app/</link>
		<comments>http://inflagrantedelicto.memoryspiral.com/2009/12/adobe-air-preventing-users-from-closing-the-app/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 16:06:01 +0000</pubDate>
		<dc:creator>Joseph Labrecque</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript]]></category>

		<guid isPermaLink="false">http://inflagrantedelicto.memoryspiral.com/?p=1279</guid>
		<description><![CDATA[One of the really cool additions to Adobe AIR 1.5.2 was the ability to invoke preventDefault() upon a FullScreenEvent when using StageDisplayState.FULL_SCREEN_INTERACTIVE. I always had a workaround for Windows but my method would always crash the app when run on &#8230; <a href="http://inflagrantedelicto.memoryspiral.com/2009/12/adobe-air-preventing-users-from-closing-the-app/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the really cool additions to Adobe AIR 1.5.2 was the ability to invoke preventDefault() upon a FullScreenEvent when using StageDisplayState.FULL_SCREEN_INTERACTIVE.  I always had a workaround for Windows but my method would always crash the app when run on a Mac.  The ability to go full screen and lock that down is essential to kiosk-type applications.  This does not prevent a user from closing out the app in some other way, however.</p>
<p>While working on an AIR-based kiosk project this week, I was given the request to prevent COMMAND+Q from closing the application on a Mac. They really wanted this thing locked down to the point where the only way to get out of the app would be to enter some random key combination.  Took a little bit of digging around to figure out how to both prevent the default closing action but still allow the app to close in the event that the correct key commands were entered.  I share this here as I can see others having this same need.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>s:WindowedApplication xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span> 
					   xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span> 
					   xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span>
					   <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;400&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;400&quot;</span> applicationComplete=<span style="color: #ff0000;">&quot;init()&quot;</span><span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;</span>fx:Declarations<span style="color: #66cc66;">&gt;</span>
		<span style="color: #66cc66;">&lt;!</span>-- Place non-visual elements <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">g</span>., services, value objects<span style="color: #66cc66;">&#41;</span> here --<span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;/</span>fx:Declarations<span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;</span>fx:Script<span style="color: #66cc66;">&gt;</span>
		<span style="color: #66cc66;">&lt;!</span><span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span>
			<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">events</span>.<span style="color: #006600;">CloseEvent</span>;
			<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
			<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">StageDisplayState</span>;
			<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">KeyboardEvent</span>;
			<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">FullScreenEvent</span>;
&nbsp;
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> commandEntered:<span style="color: #0066CC;">Boolean</span>;
&nbsp;
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
				<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">displayState</span> = StageDisplayState.<span style="color: #006600;">FULL_SCREEN_INTERACTIVE</span>;
				<span style="color: #0066CC;">this</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">CLOSING</span>, appClosing, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>KeyboardEvent.<span style="color: #006600;">KEY_DOWN</span>, killApp, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>FullScreenEvent.<span style="color: #006600;">FULL_SCREEN</span>, displayStateChanged, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> displayStateChanged<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:FullScreenEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
				<span style="color: #0066CC;">e</span>.<span style="color: #006600;">preventDefault</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> killApp<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:KeyboardEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
				<span style="color: #0066CC;">e</span>.<span style="color: #006600;">preventDefault</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">keyCode</span> == <span style="color: #cc66cc;">70</span> <span style="color: #66cc66;">&amp;&amp;</span> <span style="color: #0066CC;">e</span>.<span style="color: #006600;">ctrlKey</span> <span style="color: #66cc66;">&amp;&amp;</span> <span style="color: #0066CC;">e</span>.<span style="color: #006600;">altKey</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
					commandEntered = <span style="color: #000000; font-weight: bold;">true</span>;
					<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">close</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span>
					commandEntered = <span style="color: #000000; font-weight: bold;">false</span>;
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> appClosing<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
				<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span>commandEntered<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
					<span style="color: #0066CC;">e</span>.<span style="color: #006600;">preventDefault</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;/</span>fx:Script<span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;</span>s:Label <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;CTRL + ALT + f&quot;</span> horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> fontWeight=<span style="color: #ff0000;">&quot;bold&quot;</span> fontSize=<span style="color: #ff0000;">&quot;32&quot;</span><span style="color: #66cc66;">/&gt;</span>
<span style="color: #66cc66;">&lt;/</span>s:WindowedApplication<span style="color: #66cc66;">&gt;</span></pre></td></tr></table></div>

<p>UPDATE: If you have a stateful application, you may want to consider the following information, as it may be disruptive in handling these events properly: <a href="http://beingwicked.com/development/flex-initialize-and-the-hassles-of-changing-state/">http://beingwicked.com/development/flex-initialize-and-the-hassles-of-changing-state/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://inflagrantedelicto.memoryspiral.com/2009/12/adobe-air-preventing-users-from-closing-the-app/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>YouTube AS3 Example Using Flash Professional</title>
		<link>http://inflagrantedelicto.memoryspiral.com/2009/10/youtube-as3-example-using-flash-professional/</link>
		<comments>http://inflagrantedelicto.memoryspiral.com/2009/10/youtube-as3-example-using-flash-professional/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 04:15:02 +0000</pubDate>
		<dc:creator>Joseph Labrecque</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[YouTube]]></category>

		<guid isPermaLink="false">http://inflagrantedelicto.memoryspiral.com/?p=1141</guid>
		<description><![CDATA[Based on comments received in my previous article I&#8217;ve decided to also produce an example using Flash Professional CS4. The approach is different in some ways, but very similar in others. View the Example: References: The ActionScript 3 YouTube Chromeless &#8230; <a href="http://inflagrantedelicto.memoryspiral.com/2009/10/youtube-as3-example-using-flash-professional/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Based on comments received in my <a href="http://inflagrantedelicto.memoryspiral.com/2009/10/google-finally-releases-as3-player-for-youtube/">previous article</a> I&#8217;ve decided to also produce an example using Flash Professional CS4.  The approach is different in some ways, but very similar in others.</p>
<p><strong>View the Example:</strong><br />

<object width="480" height="500">
<param name="movie" value="http://inflagrantedelicto.memoryspiral.com/wp-content/uploads/2009/10/YouTubeAS3_CS4.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#000000"></param>
<param name="allowScriptAccess" value="always"></param>
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" width="480" height="500" src="http://inflagrantedelicto.memoryspiral.com/wp-content/uploads/2009/10/YouTubeAS3_CS4.swf" quality="high" bgcolor="#000000" wmode="window" menu="false" allowFullScreen="true" ></embed>
</object>
</p>
<p><strong>References:</strong><br />
<a href="http://apiblog.youtube.com/2009/10/actionscript-3-youtube-chromeless.html">The ActionScript 3 YouTube Chromeless Player is Now Live</a><br />
<a href="http://code.google.com/apis/youtube/flash_api_reference.html">YouTube ActionScript 3.0 Player API Reference</a></p>
<p><strong>Download the Example:</strong><br />
<a href="http://inflagrantedelicto.memoryspiral.com/wp-content/uploads/2009/10/YouTubeAS3_CS4.zip">YouTubeAS3_CS4.zip</a></p>
<p><strong>View Code for Flash Professional:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">package <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">system</span>.<span style="color: #006600;">Security</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #0066CC;">MovieClip</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Loader</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #006600;">URLRequest</span>;
	<span style="color: #0066CC;">import</span> fl.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">DataProvider</span>;
	<span style="color: #0066CC;">import</span> fl.<span style="color: #006600;">controls</span>.<span style="color: #006600;">ComboBox</span>;
	<span style="color: #0066CC;">import</span> fl.<span style="color: #006600;">controls</span>.<span style="color: #006600;">TextArea</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> YouTubeAS3 <span style="color: #0066CC;">extends</span> <span style="color: #0066CC;">MovieClip</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> VidHolder:<span style="color: #0066CC;">MovieClip</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> VidSelection:ComboBox;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> traceArea:TextArea;
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> player:<span style="color: #0066CC;">Object</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> loader:Loader;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> vidCollection:DataProvider;
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> YouTubeAS3<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			Security.<span style="color: #0066CC;">allowInsecureDomain</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;*&quot;</span><span style="color: #66cc66;">&#41;</span>;
			Security.<span style="color: #0066CC;">allowDomain</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;*&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			vidCollection = <span style="color: #000000; font-weight: bold;">new</span> DataProvider<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			vidCollection.<span style="color: #006600;">addItem</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">data</span>:<span style="color: #ff0000;">&quot;KhAplw0Z8zQ&quot;</span>, label:<span style="color: #ff0000;">&quot;Wreckage&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
			vidCollection.<span style="color: #006600;">addItem</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">data</span>:<span style="color: #ff0000;">&quot;d54AA2YWll0&quot;</span>, label:<span style="color: #ff0000;">&quot;Window View&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
			vidCollection.<span style="color: #006600;">addItem</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">data</span>:<span style="color: #ff0000;">&quot;Sv83GeuyN8A&quot;</span>, label:<span style="color: #ff0000;">&quot;The Fearless Man&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
			vidCollection.<span style="color: #006600;">addItem</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">data</span>:<span style="color: #ff0000;">&quot;9t5guYGbuZs&quot;</span>, label:<span style="color: #ff0000;">&quot;Ephemeral&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			VidSelection.<span style="color: #006600;">dataProvider</span> = vidCollection;
			VidSelection.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">CHANGE</span>, cueVideo<span style="color: #66cc66;">&#41;</span>;
&nbsp;
			loader = <span style="color: #000000; font-weight: bold;">new</span> Loader<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			loader.<span style="color: #006600;">contentLoaderInfo</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">INIT</span>, onLoaderInit<span style="color: #66cc66;">&#41;</span>;
			loader.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http://www.youtube.com/apiplayer?version=3&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onLoaderInit<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			VidHolder.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>loader<span style="color: #66cc66;">&#41;</span>;
			loader.<span style="color: #006600;">content</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;onReady&quot;</span>, onPlayerReady<span style="color: #66cc66;">&#41;</span>;
			loader.<span style="color: #006600;">content</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;onError&quot;</span>, onPlayerError<span style="color: #66cc66;">&#41;</span>;
			loader.<span style="color: #006600;">content</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;onStateChange&quot;</span>, onPlayerStateChange<span style="color: #66cc66;">&#41;</span>;
			loader.<span style="color: #006600;">content</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;onPlaybackQualityChange&quot;</span>, onVideoPlaybackQualityChange<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onPlayerReady<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			traceArea.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;player ready:&quot;</span> + <span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#40;</span>event<span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">data</span> + <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>;
			player = loader.<span style="color: #006600;">content</span>;
			player.<span style="color: #006600;">setSize</span><span style="color: #66cc66;">&#40;</span>VidHolder.<span style="color: #0066CC;">width</span>, VidHolder.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span>;
			VidSelection.<span style="color: #006600;">selectedIndex</span> = <span style="color: #cc66cc;">0</span>;
			VidSelection.<span style="color: #006600;">dispatchEvent</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Event<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">CHANGE</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> cueVideo<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			traceArea.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;switch to:&quot;</span> + event.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">selectedItem</span>.<span style="color: #006600;">label</span> + <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>;
			player.<span style="color: #006600;">cueVideoById</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">selectedItem</span>.<span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onPlayerError<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			traceArea.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;player error:&quot;</span> + <span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#40;</span>event<span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">data</span> + <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onPlayerStateChange<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			traceArea.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;player state:&quot;</span> + <span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#40;</span>event<span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">data</span> + <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onVideoPlaybackQualityChange<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			traceArea.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;video quality:&quot;</span> + <span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#40;</span>event<span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">data</span> + <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://inflagrantedelicto.memoryspiral.com/2009/10/youtube-as3-example-using-flash-professional/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Google FINALLY Releases AS3 Player for YouTube</title>
		<link>http://inflagrantedelicto.memoryspiral.com/2009/10/google-finally-releases-as3-player-for-youtube/</link>
		<comments>http://inflagrantedelicto.memoryspiral.com/2009/10/google-finally-releases-as3-player-for-youtube/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 04:07:48 +0000</pubDate>
		<dc:creator>Joseph Labrecque</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[YouTube]]></category>

		<guid isPermaLink="false">http://inflagrantedelicto.memoryspiral.com/?p=1128</guid>
		<description><![CDATA[Absolutely wonderful that Google has finally released an AS3 version of their chromeless player for use in Flex/AS3 projects. No more weird proxy hacks!!! I&#8217;ve thrown together a quick example and have posted the code below. Really simple stuff to &#8230; <a href="http://inflagrantedelicto.memoryspiral.com/2009/10/google-finally-releases-as3-player-for-youtube/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Absolutely wonderful that Google has finally released an AS3 version of their chromeless player for use in Flex/AS3 projects.  No more weird proxy hacks!!! </p>
<p>I&#8217;ve thrown together a quick example and have posted the code below.  Really simple stuff to set up and use.  Google seems to be more and more friendly to the Flash world lately.  There are at least two major projects I&#8217;m going to implement this in as soon as I get the time to do so.  Very nice- I&#8217;m quite pleased!</p>
<p><strong>View the Example:</strong><br />

<object width="480" height="500">
<param name="movie" value="http://inflagrantedelicto.memoryspiral.com/wp-content/uploads/2009/10/YouTubeAS3.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#000000"></param>
<param name="allowScriptAccess" value="always"></param>
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" width="480" height="500" src="http://inflagrantedelicto.memoryspiral.com/wp-content/uploads/2009/10/YouTubeAS3.swf" quality="high" bgcolor="#000000" wmode="window" menu="false" allowFullScreen="true" ></embed>
</object>
</p>
<p><strong>References:</strong><br />
<a href="http://apiblog.youtube.com/2009/10/actionscript-3-youtube-chromeless.html">The ActionScript 3 YouTube Chromeless Player is Now Live</a><br />
<a href="http://code.google.com/apis/youtube/flash_api_reference.html">YouTube ActionScript 3.0 Player API Reference</a></p>
<p><strong>Download the Example:</strong><br />
<a href="http://inflagrantedelicto.memoryspiral.com/wp-content/uploads/2009/10/YouTubeAS3.fxp">YouTubeAS3.fxp</a></p>
<p><strong>View Code for Flash Builder 4:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>s:Application xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span> 
			   xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span> 
			   xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span> 
			   applicationComplete=<span style="color: #ff0000;">&quot;init()&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;480&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;500&quot;</span><span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;</span>fx:Script<span style="color: #66cc66;">&gt;</span>
		<span style="color: #66cc66;">&lt;!</span><span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span>
			<span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">system</span>.<span style="color: #006600;">Security</span>;
			<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">collections</span>.<span style="color: #006600;">ArrayCollection</span>;
			<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">events</span>.<span style="color: #006600;">ListEvent</span>;
			<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Loader</span>;
			<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
&nbsp;
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> player:<span style="color: #0066CC;">Object</span>;
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> loader:Loader;
			<span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span> <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> vidCollection:ArrayCollection;
&nbsp;
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
				Security.<span style="color: #0066CC;">allowInsecureDomain</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;*&quot;</span><span style="color: #66cc66;">&#41;</span>;
				Security.<span style="color: #0066CC;">allowDomain</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;*&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
				vidCollection = <span style="color: #000000; font-weight: bold;">new</span> ArrayCollection<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				vidCollection.<span style="color: #006600;">addItem</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">data</span>:<span style="color: #ff0000;">&quot;KhAplw0Z8zQ&quot;</span>, label:<span style="color: #ff0000;">&quot;Wreckage&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
				vidCollection.<span style="color: #006600;">addItem</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">data</span>:<span style="color: #ff0000;">&quot;d54AA2YWll0&quot;</span>, label:<span style="color: #ff0000;">&quot;Window View&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
				vidCollection.<span style="color: #006600;">addItem</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">data</span>:<span style="color: #ff0000;">&quot;Sv83GeuyN8A&quot;</span>, label:<span style="color: #ff0000;">&quot;The Fearless Man&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
				vidCollection.<span style="color: #006600;">addItem</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">data</span>:<span style="color: #ff0000;">&quot;9t5guYGbuZs&quot;</span>, label:<span style="color: #ff0000;">&quot;Ephemeral&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
				loader = <span style="color: #000000; font-weight: bold;">new</span> Loader<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				loader.<span style="color: #006600;">contentLoaderInfo</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">INIT</span>, onLoaderInit<span style="color: #66cc66;">&#41;</span>;
				loader.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http://www.youtube.com/apiplayer?version=3&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onLoaderInit<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
				VidHolder.<span style="color: #006600;">rawChildren</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>loader<span style="color: #66cc66;">&#41;</span>;
				loader.<span style="color: #006600;">content</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;onReady&quot;</span>, onPlayerReady<span style="color: #66cc66;">&#41;</span>;
				loader.<span style="color: #006600;">content</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;onError&quot;</span>, onPlayerError<span style="color: #66cc66;">&#41;</span>;
				loader.<span style="color: #006600;">content</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;onStateChange&quot;</span>, onPlayerStateChange<span style="color: #66cc66;">&#41;</span>;
				loader.<span style="color: #006600;">content</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;onPlaybackQualityChange&quot;</span>, onVideoPlaybackQualityChange<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onPlayerReady<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
				traceArea.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;player ready:&quot;</span> + <span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#40;</span>event<span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">data</span> + <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>;
				player = loader.<span style="color: #006600;">content</span>;
				player.<span style="color: #006600;">setSize</span><span style="color: #66cc66;">&#40;</span>VidHolder.<span style="color: #0066CC;">width</span>, VidHolder.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span>;
				VidSelection.<span style="color: #006600;">selectedIndex</span> = <span style="color: #cc66cc;">0</span>;
				VidSelection.<span style="color: #006600;">dispatchEvent</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> ListEvent<span style="color: #66cc66;">&#40;</span>ListEvent.<span style="color: #006600;">CHANGE</span>, <span style="color: #000000; font-weight: bold;">true</span>, <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> cueVideo<span style="color: #66cc66;">&#40;</span>event:ListEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
				traceArea.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;switch to:&quot;</span> + event.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">selectedItem</span>.<span style="color: #006600;">label</span> + <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>;
				player.<span style="color: #006600;">cueVideoById</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">selectedItem</span>.<span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onPlayerError<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
				traceArea.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;player error:&quot;</span> + <span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#40;</span>event<span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">data</span> + <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onPlayerStateChange<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
				traceArea.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;player state:&quot;</span> + <span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#40;</span>event<span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">data</span> + <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onVideoPlaybackQualityChange<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
				traceArea.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;video quality:&quot;</span> + <span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#40;</span>event<span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">data</span> + <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;/</span>fx:Script<span style="color: #66cc66;">&gt;</span>
&nbsp;
	<span style="color: #66cc66;">&lt;</span>fx:Declarations<span style="color: #66cc66;">&gt;</span>
		<span style="color: #66cc66;">&lt;!</span>-- Place non-visual elements <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">g</span>., services, value objects<span style="color: #66cc66;">&#41;</span> here --<span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;/</span>fx:Declarations<span style="color: #66cc66;">&gt;</span>
&nbsp;
	<span style="color: #66cc66;">&lt;</span>mx:Canvas id=<span style="color: #ff0000;">&quot;VidHolder&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;140&quot;</span><span style="color: #66cc66;">&gt;&lt;/</span>mx:Canvas<span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;</span>mx:ComboBox id=<span style="color: #ff0000;">&quot;VidSelection&quot;</span> editable=<span style="color: #ff0000;">&quot;false&quot;</span> dataProvider=<span style="color: #ff0000;">&quot;{vidCollection}&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;10&quot;</span> bottom=<span style="color: #ff0000;">&quot;110&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;22&quot;</span> change=<span style="color: #ff0000;">&quot;cueVideo(event)&quot;</span><span style="color: #66cc66;">&gt;&lt;/</span>mx:ComboBox<span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;</span>s:TextArea <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;10&quot;</span> editable=<span style="color: #ff0000;">&quot;false&quot;</span> top=<span style="color: #ff0000;">&quot;398&quot;</span> bottom=<span style="color: #ff0000;">&quot;10&quot;</span> id=<span style="color: #ff0000;">&quot;traceArea&quot;</span><span style="color: #66cc66;">/&gt;</span>
<span style="color: #66cc66;">&lt;/</span>s:Application<span style="color: #66cc66;">&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://inflagrantedelicto.memoryspiral.com/2009/10/google-finally-releases-as3-player-for-youtube/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Scaling Your Images in Flash Player? Smooth Those Things!!!</title>
		<link>http://inflagrantedelicto.memoryspiral.com/2009/09/scaling-your-images-in-flash-player-smooth-those-things/</link>
		<comments>http://inflagrantedelicto.memoryspiral.com/2009/09/scaling-your-images-in-flash-player-smooth-those-things/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 21:54:10 +0000</pubDate>
		<dc:creator>Joseph Labrecque</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash Player]]></category>
		<category><![CDATA[Images]]></category>

		<guid isPermaLink="false">http://inflagrantedelicto.memoryspiral.com/?p=1018</guid>
		<description><![CDATA[I actually forgot to apply the &#8220;smoothing&#8221; property to a flash.display.Bitmap display object being scaled inside Flash Player. Just look at the difference such an oversight made! Since I was using a flash.display.Loader display object to load the image up, &#8230; <a href="http://inflagrantedelicto.memoryspiral.com/2009/09/scaling-your-images-in-flash-player-smooth-those-things/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I actually forgot to apply the &#8220;smoothing&#8221; property to a flash.display.Bitmap display object being scaled inside Flash Player.  Just look at the difference such an oversight made!</p>
<p><a href="http://inflagrantedelicto.memoryspiral.com/wp-content/uploads/2009/09/Smoothing.png"><img src="http://inflagrantedelicto.memoryspiral.com/wp-content/uploads/2009/09/Smoothing.png" alt="Smoothing" title="Smoothing" class="alignnone" width="600" /></a></p>
<p>Since I was using a flash.display.Loader display object to load the image up, and Loader has no smoothing property, I totally spaced on this and it&#8217;s been out there for months rendering images in a pretty crappy way.  I just needed to assign the image data to a Bitmap object and use that for display instead.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> imageLoaded<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">var</span> imageBitmap:Bitmap = imageLoader.<span style="color: #006600;">content</span> as Bitmap;
    imageBitmap.<span style="color: #0066CC;">smoothing</span> = <span style="color: #000000; font-weight: bold;">true</span>;
    imageDrag.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>imageBitmap<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #808080; font-style: italic;">//scale away!</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>Easy.</p>
<p>Learn from my blunder- always make sure to enable smoothing!</p>
]]></content:encoded>
			<wfw:commentRss>http://inflagrantedelicto.memoryspiral.com/2009/09/scaling-your-images-in-flash-player-smooth-those-things/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Runtime Armatures in Flash CS4</title>
		<link>http://inflagrantedelicto.memoryspiral.com/2009/08/runtime-armatures-in-flash-cs4/</link>
		<comments>http://inflagrantedelicto.memoryspiral.com/2009/08/runtime-armatures-in-flash-cs4/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 05:59:00 +0000</pubDate>
		<dc:creator>Joseph Labrecque</dc:creator>
				<category><![CDATA[Rant]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://inflagrantedelicto.memoryspiral.com/?p=919</guid>
		<description><![CDATA[I have such terrible luck with Runtime Armatures in Flash CS4. It&#8217;s really not funny anymore. Most recently stumbled across the following compilation error (fatal warning?) when working with the &#8220;New Flash Component&#8221; feature of Flash Builder 4: Warning: 5002: &#8230; <a href="http://inflagrantedelicto.memoryspiral.com/2009/08/runtime-armatures-in-flash-cs4/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have such terrible luck with Runtime Armatures in Flash CS4.  It&#8217;s really not funny anymore.</p>
<p>Most recently stumbled across the following compilation error (fatal warning?) when working with the &#8220;New Flash Component&#8221; feature of Flash Builder 4:</p>
<p><img src="http://inflagrantedelicto.memoryspiral.com/wp-content/uploads/2009/08/Midge.PNG" alt="Midge" title="Midge" width="503" height="357" class="alignnone size-full wp-image-924" /></p>
<blockquote><p>Warning: 5002: The main timeline&#8217;s frame scripts have been ignored because a compiled clip contains a definition for fl.livepreview.LivePreviewParent. To override the fl.livepreview.LivePreviewParent definition, place a custom class file within your classpath.</p></blockquote>
<p>Obviously, Flash is generating code for the Runtime Armature which is conflicting with code for the Flash Component for use in Flash Builder.  Ugh&#8230;</p>
<p>I&#8217;m working on some demos for my FITC presentation during the <a href="http://www.fitc.ca/events/about/?event=100">MAX unconference</a> in October.  This is by no means a show stopper but what an annoyance&#8230; Half the time when working with Runtime Armatures in CS4, Flash will just totally crash and burn.  I have great luck with Armatures during authoring- the runtime stuff just always seems to bite me.</p>
<p>Bug filed:<br />
<a href="http://bugs.adobe.com/jira/browse/FB-22221">http://bugs.adobe.com/jira/browse/FB-22221</a></p>
<p><strong>UPDATE:</strong> I have confirmation that this is fixed in Flash CS5.</p>
]]></content:encoded>
			<wfw:commentRss>http://inflagrantedelicto.memoryspiral.com/2009/08/runtime-armatures-in-flash-cs4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

