<?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>Jeff dePascale &#187; Flash</title>
	<atom:link href="http://www.jeffdepascale.com/index.php/categories/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jeffdepascale.com</link>
	<description>Blogging on and developing web and mobile technologies</description>
	<lastBuildDate>Sat, 25 Jun 2011 14:26:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Why the iPad&#8217;s user agent string presents a problem</title>
		<link>http://www.jeffdepascale.com/index.php/general/why-the-ipads-user-agent-string-presents-a-problem/</link>
		<comments>http://www.jeffdepascale.com/index.php/general/why-the-ipads-user-agent-string-presents-a-problem/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 21:39:35 +0000</pubDate>
		<dc:creator>Jeff dePascale</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone OS]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Netbooks and Tablets]]></category>
		<category><![CDATA[Touch Devices]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[tablet]]></category>
		<category><![CDATA[user agent]]></category>

		<guid isPermaLink="false">http://www.jeffdepascale.com/?p=452</guid>
		<description><![CDATA[[dtse][/dtse] Note: This post has been getting a fair amount of traffic. I originally posted this directly after launch, and subsequently it contained outdated information from what is now known from the final release of OS 3.2. I originally had left the original post info for the sake of blogging/ journalistic integrity, however after three revisions because of newer info, I [...]]]></description>
			<content:encoded><![CDATA[<p>[dtse]<img class="alignright size-medium wp-image-453" title="safari_20100127" src="http://www.jeffdepascale.com/news/wp-content/uploads/2010/01/safari_20100127-272x300.jpg" alt="safari_20100127" width="272" height="300" />[/dtse]</p>
<p>Note: This post has been getting a fair amount of traffic. I originally posted this directly after launch, and subsequently it contained outdated information from what is now known from the final release of OS 3.2. I originally had left the original post info for the sake of blogging/ journalistic integrity, however after three revisions because of newer info, I decided to strip the clutter of invalid content. Having said my disclaimer, below is the revised new post, and here is the release version of the iPad UA string as of 4/6/10, pulled directly from my 32GB wifi model:</p>
<p>Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) version/4.0.4 Mobile/7B367 Safari/531.21.10</p>
<p>more after the break.<span id="more-452"></span></p>
<p>The iPad represents itself in line with how the iPhone and iPod Touch differentiate themselves by specifying different device strings, but still contains the word 'mobile' - so Apple is currently explicitly classing this device as a mobile browser. But we now have a new class of devices to case for, segmented somewhere between mobile and non-mobile. While Apple has taken the first real swing at a tablet user agent, it's up in the air whether other tablet browsers will fall in line with this or do their own thing. Consistency is critical for proper detection without necessitating device specific casing.</p>
<p>This is intriguing and presents an interesting new issue for web developers. In their marketing materials, Apple has classified the iPad as designed for a full web experience (barring Flash of course), but they themselves are saying to the developers that this is a mobile device, right in the UA string. Moreover, technically the UA string classification is correct - this is a mobile browser. This isn't the desktop version of Safari. While they are both webkit based, it is inevitable that considerations will want to be made for the glorified Safari mobile browser in the iPad, and using the user agent string to identify that and case for it is problematic unless Apple modifies the UA string. My guess is at some point they will, possibly as soon as 4.0 hits.</p>
<p>It's not so much that this matters for development now as much as that it sets a precedent for future slate browsers. Apple has said here that slate browsers, even if they are larger versions of existing mobile browsers, should identify as a mobile browser, but clearly full sites should, and will be ultimately presented to iPad users in many cases. Even if the UA string wasn't an issue, there's still the question of how to architect a full site for both tablets and desktop viewing (primarily casing for browsers that do and don't have Flash). Proper implementation of progressive enhancement techniques is a great solution (<a href="http://www.jeffdepascale.com/index.php/mobile/the-web-on-tablets-how-the-ipad-has/" target="_self">see my related post on this topic here</a>).</p>
<p>Maybe this whole UA string mess will all be a moot point when we see the 4.0 beta. As with all things Apple launch related, time will tell. One thing you can count on is that if the iPad succeeds, the precedent will be set. We'll see who follows.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeffdepascale.com/index.php/general/why-the-ipads-user-agent-string-presents-a-problem/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Flash CS5 public beta cancelled by Adobe</title>
		<link>http://www.jeffdepascale.com/index.php/flash/flash-cs5-public-beta-cancelled-by-adobe/</link>
		<comments>http://www.jeffdepascale.com/index.php/flash/flash-cs5-public-beta-cancelled-by-adobe/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 19:10:59 +0000</pubDate>
		<dc:creator>Jeff dePascale</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[iPhone OS]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mobile Apps]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[CS5]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.jeffdepascale.com/?p=400</guid>
		<description><![CDATA[[dtse][/dtse]Well, that was quick. Adobe has pulled the plug on the previously planned for Flash CS5 public beta, initially announced at MAX in October. So much for getting iFosfr rolling before final release. Official statement from Adobe after the break. You subscribed to be notified about the Adobe® Flash® Professional CS5 beta. Therefore, we are [...]]]></description>
			<content:encoded><![CDATA[<p>[dtse]<a href="http://www.jeffdepascale.com/news/wp-content/uploads/2009/12/CS5BetaCancelled.jpg"><img class="alignright size-medium wp-image-401" title="CS5BetaCancelled" src="http://www.jeffdepascale.com/news/wp-content/uploads/2009/12/CS5BetaCancelled-300x176.jpg" alt="CS5BetaCancelled" width="300" height="176" /></a>[/dtse]Well, that was quick. Adobe has pulled the plug on the previously planned for Flash CS5 public beta, initially announced at MAX in October. So much for getting <a href="http://code.google.com/p/ifosfr">iFosfr</a> rolling before final release. Official statement from Adobe after the break.</p>
<p><span id="more-400"></span></p>
<table border="0" cellspacing="0" cellpadding="0" width="593">
<tbody>
<tr>
<td width="593"><strong>You subscribed to be notified about the Adobe® Flash® Professional CS5 beta. Therefore, we are contacting you with an update.</strong></td>
</tr>
<tr>
<td width="593">Please take note of this important update: Adobe will not be releasing a public beta of Adobe Flash Professional CS5 software. This is a change from the plan we announced in October at Adobe MAX 2009. Since that time, Adobe has seen an unprecedented amount of interest in Flash Professional CS5 and the included Packager for iPhone.The decision not to release a public beta was made to ensure the earliest possible delivery of the final software to the large number of designers and developers interested in Flash Professional CS5 and the included Packager for iPhone.For additional information about this announcement, please visit the <a href="http://direct.adobe.com/r?xPHHvPJEvnTnPEnWWPvq">Flash Platform blog</a>.</p>
<p>The Flash Professional Team</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.jeffdepascale.com/index.php/flash/flash-cs5-public-beta-cancelled-by-adobe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New tutorial on CS5 AS3 iPhone dev reveals improvements</title>
		<link>http://www.jeffdepascale.com/index.php/flash/new-tutorial-on-cs5-as3-iphone-dev-reveals-improvements/</link>
		<comments>http://www.jeffdepascale.com/index.php/flash/new-tutorial-on-cs5-as3-iphone-dev-reveals-improvements/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 18:54:16 +0000</pubDate>
		<dc:creator>Jeff dePascale</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mobile Apps]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[CS5]]></category>

		<guid isPermaLink="false">http://www.jeffdepascale.com/?p=203</guid>
		<description><![CDATA[[dtse][/dtse]Lee Brimelow, noted Flash Evangelist for Adobe, has posted a new tutorial at gotoandlearn.com on developing iPhone apps in the forthcoming Flash CS5 beta: http://gotoandlearn.com/play?id=116 While the tutorial itself gives a clearer illustration of the development process, what's more interesting are some of the notable details that clarify or improve upon the MAX announcement back in October. Perhaps [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">[dtse]<img class="alignright size-full wp-image-224" title="iPhone and Flash" src="http://www.jeffdepascale.com/news/wp-content/uploads/2009/12/flash-player-iphone.jpg" alt="iPhone and Flash" width="153" height="276" />[/dtse]Lee Brimelow, noted Flash Evangelist for Adobe, has posted a new tutorial at gotoandlearn.com on developing iPhone apps in the forthcoming Flash CS5 beta:</p>
<p style="text-align: left;"><a href="http://gotoandlearn.com/play?id=116">http://gotoandlearn.com/play?id=116</a></p>
<p style="text-align: left;">While the tutorial itself gives a clearer illustration of the development process, what's more interesting are some of the notable details that clarify or improve upon the MAX announcement back in October.</p>
<p style="text-align: left;"><span id="more-203"></span></p>
<p style="text-align: left;">Perhaps most intriguing is the hardware accelerated demo at the end of the video, which definitely contradicts the relatively poor performance of some of the demo apps already in the app store, and is impressive versus those case studies that Adobe initially revealed.</p>
<p style="text-align: left;">Even more notably, Adobe has clearly made some substantial headway on the file size bloat issue. 8-9MB base weights were initially stated by Adobe at the MAX announcement, however the test app exported here weighs in at 3.2MB:</p>
<div class="mceTemp mceIEcenter" style="text-align: left;">
<dl id="attachment_204" class="wp-caption     aligncenter" style="width: 267px;">
<dt class="wp-caption-dt"><a href="http://www.jeffdepascale.com/news/wp-content/uploads/2009/12/kWeight.jpg"><img class="size-full wp-image-204" title="iPhone AS3 file size" src="http://www.jeffdepascale.com/news/wp-content/uploads/2009/12/kWeight.jpg" alt="File size as shown in iTunes" width="257" height="55" /></a></dt>
<dd class="wp-caption-dd">File size as shown in iTunes</dd>
</dl>
</div>
<p style="text-align: left;">It should be noted that this is not a final compile for distribution, which could potentially add more weight (only Adobe knows for sure at this point), but it does appear that Adobe has put some effort into fixing that glaring problem. Bearing in mind that apps over 10MB in size require WiFi to download apps over the air to the iPhone, a high base weight poses a significant barrier to entry for end users to install even the simplest of AS3 based apps.</p>
<p style="text-align: left;">Also seen in this tutorial is the new  'flash.sensors' package, part of the 10.1 (and likely future Flash Player 11 release) which gives access to device interactions. In this demo, we see an implementation of the accelerometer class on the iPhone, and Lee does note that this will, as expected, be accessible with other 10.1 enabled mobile devices.</p>
<p style="text-align: left;">Finally, Adobe made it a point at MAX to be very clear about the lengthy compile times for iPhone applications, potentially in the neighborhood of five minutes in length. While this tutorial is for as basic as an app can get, the app demonstrated her takes a mere 38 seconds to compile. Again, this is not a distribution compile, but compile time issues aren't a concern for one-off compiles for distribution. Rather, it's the time suck of test builds that are potential deal breakers. 38 seconds is a promising number, but it remains to be seen what real world app compile times will wind up at when the Flash CS5 beta drops on Adobe Labs, which this tutorial further confirms as on track for the end of this year.</p>
<p style="text-align: left;">Lee's original post on theflashblog.com can be found here:</p>
<p style="text-align: left;"><a href="http://theflashblog.com/?p=1510">http://theflashblog.com/?p=1510</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeffdepascale.com/index.php/flash/new-tutorial-on-cs5-as3-iphone-dev-reveals-improvements/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Time format from seconds in AS3</title>
		<link>http://www.jeffdepascale.com/index.php/flash/time-format-from-seconds-in-as3/</link>
		<comments>http://www.jeffdepascale.com/index.php/flash/time-format-from-seconds-in-as3/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 00:42:15 +0000</pubDate>
		<dc:creator>Jeff dePascale</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.jeffdepascale.com/?p=196</guid>
		<description><![CDATA[Here's a quick and dirty class for converting seconds into the proper hours : minutes : seconds display format, with optional resolution setting (hours/minutes/seconds). Defaults to hours. Sample implementation: trace(TimeFormat.formatTime(200, TimeFormat.SECONDS)); outputs "0:03:20". Full class after the break. package { public class TimeFormat{ public static const HOURS:uint = 2; public static const MINUTES:uint = 1; [...]]]></description>
			<content:encoded><![CDATA[<p>Here's a quick and dirty class for converting seconds into the proper hours : minutes : seconds display format, with optional resolution setting (hours/minutes/seconds). Defaults to hours. Sample implementation:</p>
<pre>trace(TimeFormat.formatTime(200, TimeFormat.SECONDS));</pre>
<p>outputs "0:03:20". Full class after the break. <span id="more-196"></span></p>
<pre>package {</pre>
<pre>public class TimeFormat{</pre>
<pre>public static const HOURS:uint = 2;</pre>
<pre>public static const MINUTES:uint = 1;</pre>
<pre>public static const SECONDS:uint = 0;</pre>
<pre>public function TimeFormat() {
}</pre>
<pre>public static function formatTime(time:Number, detailLevel:uint = 2):String {
var intTime:uint = Math.floor(time);
var hours:uint = Math.floor(intTime/ 3600);
var minutes:uint = (intTime - (hours*3600))/60;
var seconds:uint = intTime -  (hours*3600) - (minutes * 60);
var hourString:String = detailLevel == HOURS ? hours + ":":"";
var minuteString:String = detailLevel &gt;= MINUTES ? ((detailLevel == HOURS &amp;&amp; minutes &lt;10 ? "0":"") + minutes + ":"):"";
var secondString:String = ((seconds &lt; 10 &amp;&amp; (detailLevel &gt;= MINUTES)) ? "0":"") + seconds;
return hourString + minuteString + secondString;
}</pre>
<pre>}</pre>
<pre>}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.jeffdepascale.com/index.php/flash/time-format-from-seconds-in-as3/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Tabulate updated to .2 alpha &#8211; AS3 tab management</title>
		<link>http://www.jeffdepascale.com/index.php/flash/tabulate-updated-to-2-alpha-as3-tab-management/</link>
		<comments>http://www.jeffdepascale.com/index.php/flash/tabulate-updated-to-2-alpha-as3-tab-management/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 00:21:45 +0000</pubDate>
		<dc:creator>Jeff dePascale</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[focusManager]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[tab]]></category>
		<category><![CDATA[tabulate]]></category>

		<guid isPermaLink="false">http://www.jeffdepascale.com/?p=193</guid>
		<description><![CDATA[There's still a long way to go for what is planned for this one, but I have just updated the google code project to the .2 alpha release here doucmentation: http://www.jeffdepascale.com/documentation/tabulate]]></description>
			<content:encoded><![CDATA[<p>There's still a long way to go for what is planned for this one, but I have just updated the google code project to the .2 alpha release <a href="http://code.google.com/p/tabulate/">here</a></p>
<p>doucmentation: <a href="http://www.jeffdepascale.com/documentation/tabulate">http://www.jeffdepascale.com/documentation/tabulate</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeffdepascale.com/index.php/flash/tabulate-updated-to-2-alpha-as3-tab-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MouseEvent &#8211; relatedObject explained</title>
		<link>http://www.jeffdepascale.com/index.php/flash/mouseevent-relatedobject-explained/</link>
		<comments>http://www.jeffdepascale.com/index.php/flash/mouseevent-relatedobject-explained/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 21:41:46 +0000</pubDate>
		<dc:creator>Jeff dePascale</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[MouseEvent]]></category>

		<guid isPermaLink="false">http://www.jeffdepascale.com/?p=190</guid>
		<description><![CDATA[One of those things that isn't immediately clear based on its name, the relatedObject property is a reference to the object that the mouse is now over, and is receiving a MouseEvent.MOUSE_OVER event.  This property is valid for both over and out events. This is a really useful property, a typical example is working with [...]]]></description>
			<content:encoded><![CDATA[<p>One of those things that isn't immediately clear based on its name, the relatedObject property is a reference to the object that the mouse is now over, and is receiving a MouseEvent.MOUSE_OVER event.  This property is valid for both over and out events. This is a really useful property, a typical example is working with mutually exclusive rollovers. if you have a rollover popup that should remain visible if the users cursor rolls into the popup itself, you need to case your mouseOut to only hide the popup if the cursor is not over the popup itself. Here is an example:</p>
<p><span id="more-190"></span></p>
<p>Assuming this event is attached to the object that triggered the rollover popUp, there is an existing method to hide the popup called hidePopUp(),  and a popup named popUp_mc: </p>
<pre>private function eMouseOutHandler(e:MouseEvent):void{
      if(e.relatedObject != popUp_mc) hidePopUp();
}</pre>
<p>In this case, if the cursor is over the popup, it will remain visible. If not, we know that the cursor is not over the popup and it should be hidden. Note that you will now need to case for a mouseOut on the popup itself now, since if the user rolls through the pop up and out it will need to know to hide itself. However, the reverse of the code above will need to be implemented for this mouseOut - if the relatedObject property is the object that received the initial rollover, again we should ignore hiding it since cursor would now be over the object that would have shown the popup in the first place.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeffdepascale.com/index.php/flash/mouseevent-relatedobject-explained/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe Flash Professional CS5: Applications for iPhone</title>
		<link>http://www.jeffdepascale.com/index.php/flash/adobe-flash-professional-cs5-applications-for-iphone/</link>
		<comments>http://www.jeffdepascale.com/index.php/flash/adobe-flash-professional-cs5-applications-for-iphone/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 21:05:59 +0000</pubDate>
		<dc:creator>Jeff dePascale</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mobile Apps]]></category>
		<category><![CDATA[AS3]]></category>

		<guid isPermaLink="false">http://www.jeffdepascale.com/?p=188</guid>
		<description><![CDATA[iPhone + AS3 - didn't see that one coming! So my question to Adobe is - can an AS3 iPhone app be a component of a larger obj-C based app? Or is AS3 content restricted to being solely a standalone app? Adobe Labs - Adobe Flash Professional CS5: Applications for iPhone.]]></description>
			<content:encoded><![CDATA[<p>iPhone + AS3 - didn't see that one coming! So my question to Adobe is - can an AS3 iPhone app be a component of a larger obj-C based app? Or is AS3 content restricted to being solely a standalone app?</p>
<p><a href="http://labs.adobe.com/technologies/flashcs5/appsfor_iphone/">Adobe Labs - Adobe Flash Professional CS5: Applications for iPhone</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeffdepascale.com/index.php/flash/adobe-flash-professional-cs5-applications-for-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Managing mutually exclusive overlays and popups efficiently in AS3</title>
		<link>http://www.jeffdepascale.com/index.php/flash/managing-mutually-exclusive-overlays-and-popups-efficiently-in-as3/</link>
		<comments>http://www.jeffdepascale.com/index.php/flash/managing-mutually-exclusive-overlays-and-popups-efficiently-in-as3/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 17:22:46 +0000</pubDate>
		<dc:creator>Jeff dePascale</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[AS3]]></category>

		<guid isPermaLink="false">http://www.jeffdepascale.com/?p=184</guid>
		<description><![CDATA[Here's a quickie for handling mutiple in-Flash popups or overlays that should all open exclusively (that is, if one is opened, all other should close) within an application in AS3. A couple of classes, first one is the manager itself: package  {  import flash.display.Sprite;  public class OverlayManager {      private var objArray:Array;      public function OverlayManager() [...]]]></description>
			<content:encoded><![CDATA[<p>Here's a quickie for handling mutiple in-Flash popups or overlays that should all open exclusively (that is, if one is opened, all other should close) within an application in AS3.</p>
<p>A couple of classes, first one is the manager itself:</p>
<p><span id="more-184"></span></p>
<pre>package  {

 import flash.display.Sprite;

 public class OverlayManager {
  
  private var objArray:Array;
  
  public function OverlayManager() {
   objArray = [];
  }
  
  public function registerOverlay(obj:Sprite):void {
   objArray.push(obj);
   obj.addEventListener(OverlayEvent.CHANGE, eChangeHandler);
  }
  
  private function eChangeHandler(e:OverlayEvent):void {
   for (var i:uint = 0; i &lt; objArray.length; i++) {
    if (objArray[i] != e.object) objArray[i].close();
   }
  }
  
 }
 
}</pre>
<p>Next, our OverlayEvent:</p>
<pre>package  {
 
 import flash.display.Sprite;
 import flash.events.Event;

 public class OverlayEvent extends Event {
  
  public static const CHANGE:String = "change";
  
  private var _object:Sprite;
  
  public function OverlayEvent(type:String, $object:Sprite, bubbles:Boolean=false, cancelable:Boolean=false) {
   super(type, bubbles, cancelable);
   _object = $object;
   
  }
  
  public override function clone():Event {
   return new OverlayEvent(type, object, bubbles, cancelable);
  }
  
  public override function toString():String {
   return formatToString("OverlayEvent", "object", "type", "bubbles", "cancelable", "eventPhase");
  }
  
  public function get object():Sprite { return _object; }
  
 }
 
}</pre>
<p>And finally, an interface:</p>
<pre>package  {

 public interface IOverlayObject {
   
  function close():void;
 }
 
}</pre>
<p>Implementing involves a few quick steps for each object (obviously you'll need at least two for this to do anything). First, the object needs to implement the interface (basically requires a public close method on the object). Next, we need to register the object with the manager itself, and finally, whenever the object is shown, we need to dispatch an OverlayEvent.CHANGE event, passing along a reference to the open object. Example:</p>
<pre>package {

 import flash.display.Sprite;
 import flash.events.MouseEvent;
 

 public class OverlayObject extends Sprite implements IOverlayObject{
  
  public function OverlayObject() {
  }

  
  public function close():void {
   showObject(false);
  }
  
  public function showObject(show:Boolean):void {
   if (show) dispatchEvent(new OverlayEvent(OverlayEvent.CHANGE, this));
   visible = show ? true:false;
  }
  
 }
 
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.jeffdepascale.com/index.php/flash/managing-mutually-exclusive-overlays-and-popups-efficiently-in-as3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Polygons crossing poles and the date line in google maps as3 API</title>
		<link>http://www.jeffdepascale.com/index.php/flash/polygons-crossing-poles-and-the-date-line-in-google-maps-as3-api/</link>
		<comments>http://www.jeffdepascale.com/index.php/flash/polygons-crossing-poles-and-the-date-line-in-google-maps-as3-api/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 17:43:34 +0000</pubDate>
		<dc:creator>Jeff dePascale</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.jeffdepascale.com/?p=179</guid>
		<description><![CDATA[Google provides a sample of how to draw a circle in google maps using the Polygon class here: http://code.google.com/p/gmaps-samples/source/browse/trunk/basic_wcircle/basicw_circle.htm The problem is that when crossing the date line or the poles, the polygon draws incorrectly. the following code builds on the method drawCircle in google's implementation. This one is designed to return the points in [...]]]></description>
			<content:encoded><![CDATA[<p>Google provides a sample of how to draw a circle in google maps using the Polygon class here:</p>
<p><a href="http://code.google.com/p/gmaps-samples/source/browse/trunk/basic_wcircle/basicw_circle.htm">http://code.google.com/p/gmaps-samples/source/browse/trunk/basic_wcircle/basicw_circle.htm</a></p>
<p>The problem is that when crossing the date line or the poles, the polygon draws incorrectly. the following code builds on the method drawCircle in google's implementation. This one is designed to return the points in an array for a specified radius around a LatLng position. Polygons will cross the date line, and if the poly reaches a pole it will draw a hard line across the top of the map instead of breaking into the gray outside the map. Verified working in 1.16 of the API.</p>
<pre> private function getPoints(latLng:LatLng, radius:uint):Array {
   var circleLatLngs:Array = [];
   var circleLat:Number = radius * 0.014483;
   var circleLng:Number = circleLat / Math.cos(latLng.lat() * Math.PI / 180);
   var numPoints = 100;
   var maxLatitude:uint = 85; //equates to the latitude edge in google maps (not 90)
   for (var i = 0; i &lt; numPoints + 1; i++) {
    var theta:Number = Math.PI * (i / (numPoints / 2));
    var vertexLat:Number = latLng.lat() + (circleLat * Math.sin(theta));
    var vertexLng:Number = latLng.lng() + (circleLng * Math.cos(theta));
    //if the latitude value is outside the maxLatitude value for either hemisphere, lock it to that value.
    if (vertexLat &gt; maxLatitude) vertexLat = maxLatitude;
    if (vertexLat &lt; -maxLatitude) vertexLat = -maxLatitude;
    var vertextLatLng:LatLng = new LatLng(vertexLat, vertexLng, true); //setting true allows values outside 180 degrees, which fixes issues crossing the date line
    circleLatLngs.push(vertextLatLng);
   }
   return circleLatLngs;
  }</pre>
<p>Hopefully that saves some headaches!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeffdepascale.com/index.php/flash/polygons-crossing-poles-and-the-date-line-in-google-maps-as3-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is it time to rethink the stage timeline in Flash?</title>
		<link>http://www.jeffdepascale.com/index.php/flash/is-it-time-to-rethink-the-flash-timeline/</link>
		<comments>http://www.jeffdepascale.com/index.php/flash/is-it-time-to-rethink-the-flash-timeline/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 21:57:15 +0000</pubDate>
		<dc:creator>Jeff dePascale</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[timeline]]></category>

		<guid isPermaLink="false">http://www.jeffdepascale.com/?p=166</guid>
		<description><![CDATA[EDIT - I revised the title of this post to clarify my position in response to zool's comment below. The following is NOT an argument against timeline animations, rather, one about where they belong in the modern Flash development flow. I generally avoid writing editorial articles on my blog, sticking strictly to informational code bits [...]]]></description>
			<content:encoded><![CDATA[<p>EDIT - I revised the title of this post to clarify my position in response to zool's comment below. The following is NOT an argument against timeline animations, rather, one about where they belong in the modern Flash development flow.</p>
<p>I generally avoid writing editorial articles on my blog, sticking strictly to informational code bits and the like. But as a developer who works closely with designers/devigners, the validity of the Flash timeline in todays development world is a topic I think worth discussing.</p>
<p><span id="more-166"></span></p>
<p>Since AS3 first appeared on the scene, the timeline and its ease of use for code have dramatically changed. Granted, most developers (including myself) will say that you should never, ever put code on the timeline, or even worse, after frame one, ever. However, in AS2, you could do it and all would work just fine. Nowadays, timeline code is messy at best, and the undocumented method addFrameScript() is a poor workaround at best. This is largely due to AS3 coming to Flash from Flex first, which is evident looking around the IDE and the language itself, seeing how timeline is really an afterthought in the language.</p>
<p>I'd like to take a second here and point out at this point that I am completely, all for using document classes and not coding in the timeline (or the IDE for that matter) at all, period. It hasn't been a best practice for a long time now and creates headaches that don't need to exist with just a little bit of knowledge about how to properly write a class. I understand the fear of stepping into classes, I've talked to designers who cringe at the thought. But the reality is that a little bit of knowledge will go a long way here.</p>
<p>So my question is this: why, if timeline is an afterthought in the language, is it treated as a top tier item in the IDE? Consider this - you can't create an exclusive Sprite in the IDE (a 1 frame movieclip is technically a sprite, but you can't lock the timeline to only be a sprite by definition). Maybe therein lies the solution I am (and undoubtedly others are) seeking. Really, the timeline could, and should, be a layers panel, just like in photoshop. We don't need additional frames. Why? Because frames are a property of MovieClips. The stage should be a Sprite by default. If you create a MovieClip, the timeline should be an accessible property of the clip within the IDE, with its own interface, building in the power that was added in CS4. But you should not be able to add code to those frames at all. So timelines would strictly be property of the MovieClips themselves within the IDE, just like in the language.</p>
<p>I think the reason we havent seen this yet is twofold: Legacy AS2 users who still use the timeline directly, and the fact that the timeline has become one of the starting points for most users, as well as an identifiable part of the IDE. I see the reasoning, but it weakens the perception of Flash by allowing loopholes for poor practices. This is furthered by the countless tutorials that start with the timeline as step one of using Flash. Take a glance at the newgrounds forums for Flash and you'll see the problem post by post. The language and the IDE need to coexist better as complements to each other, without stepping on each other's toes as much as they do right now.</p>
<p>I think for AS3 projects it's time to lose the timeline rather than force fit it into a language that doesn't really properly support it. There's no reason to. Timeline animations are great, but that's just what they should be - animations. An asset to be referenced and used by code, within AS3 at least. Legacy users are always a consideration, but that doesnt mean you can't force the users of newer technologies to use newer, improved standards. AS3 shouldn't have to support improper code techniques - that's what the support for AS2 in the IDE is for. The addFrameScript() method shouldn't even need to exist in the first place. If Adobe forces everyones hands to fully seperate AS3 code in .as files and animations in the timeline, where they belong, we'll all be better off, and that would be one less knock against Flash as a hack language.</p>
<p>So what do you think? Weigh in in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeffdepascale.com/index.php/flash/is-it-time-to-rethink-the-flash-timeline/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

