Jeff dePascale Blogging on and developing web and mobile technologies

Featured Post:
Why the iPad’s user agent string presents a problem

Apple marketed the iPad at launch as an internet device designed for the full web. So why then are they explicitly classifying it as a mobile device?

Read the story »

Why the iPad’s user agent string presents a problem

safari_20100127

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:

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

more after the break.

Flash CS5 public beta cancelled by Adobe

CS5BetaCancelledWell, 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.

New tutorial on CS5 AS3 iPhone dev reveals improvements

iPhone and FlashLee 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.

Time format from seconds in AS3

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.

Filed under: Flash Continue reading

Tabulate updated to .2 alpha – AS3 tab management

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

MouseEvent – relatedObject explained

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:

Adobe Flash Professional CS5: Applications for iPhone

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.

Tagged as: , , No Comments

Managing mutually exclusive overlays and popups efficiently in AS3

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:

Tagged as: , Continue reading

Polygons crossing poles and the date line in google maps as3 API

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 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.

 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 < 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 > maxLatitude) vertexLat = maxLatitude;
    if (vertexLat < -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;
  }

Hopefully that saves some headaches!

Filed under: Flash No Comments

Is it time to rethink the stage timeline in Flash?

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 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.