The two images above both depict the “People” sections from their respective agencies websites. Pages like this are generally used, first of all, to name the important players in an agency, and second of all, to humanize the people you will hopefully eventually be paying for creative work.

What’s the significance of the juxtaposition of these two images?

The company in the first photo employs almost as many people as are depicted in the second.

Categories: AdvertisingArticleBugs
Tags:
Published: 08.08.10 :: No Comments »


It’s time to speak about a problem that’s been troubling me for quite a while now. Flash CS4 (and certainly versions that precede it) seems to have major problems consistently and accurately rendering text. I’ve prepared some screen captures that demonstrate the problem.

Text Field Properties

It all begins innocently enough. I’ve created a text field on the stage and I move over to the properties panel to toy with it. In this case, the text field uses Arial Regular at 12 points as its font. It’s anti-aliased for readabilty, and it’s selectable.

Embedded Characters

Although I don’t expect that any of my viewers will be without Arial, I embed the font all the same. I make a broad selection of characters that should cover most if not all of my use cases for this text field, without embedding everything.

Editing Text

Now that I’ve configured my text field, I select it on the stage and put in some standard lorem ipsum to test my application with. Everything up to this point seems fine…

How Text Renders

…until I finish editing the text. Now that I have it selected, but am no longer editing it, everything has changed. Compare this screen capture to the one that precedes it.

This problem is not new. It’s particularly pernicious when you’re trying to align other objects with on-screen text.

Categories: ArticleBugsFlashTypographyUncategorized
Tags:
Published: 07.06.10 :: 2 Comments »


Perhaps you, like me, have had a need, at some point or another, to parse RSS feeds in Actionscript. If so, then perhaps you’ve also stumbled across the generally wonderful as3syndicationlib developed by Mike Chambers and Christian Cantrell. For those of you who aren’t in the know, allow me to provide the following excerpt from the project’s google code page:

Use the syndication library to parse Atom and all versions of RSS easily. This library hides the differences between the formats so you can parse any type of feed without having to know what kind of feed it is.

These claims actually hold up pretty well…once you get the code running.

The problem is that the codebase was written specifically for development in Flex. While Flex is a great platform for certain projects, many of us still use Flash for a lot of the work we do, so a toolkit that relies on packages that are only available to Flex just doesn’t do it.

This problem is also no secret. It’s listed as an accepted issue on its project page. The problem is that the codebase apparently hasn’t been updated since December of 2006.  That’s no joke kids.

Fortunately, a solution was pushed forth from outside the project by a Mr. Martin Legris in the form of a bare implementation of the missing “DateBase” class that the syndication library looks for, as well as an edit to an import statement buried down in ParsingTools.as.

So if you, like me, have a need to consume RSS/Atom Feeds in Flash and need a solution that works, look no further. I present, to you, an updated version of the as3 syndication library with the necessary changes in place to begin using it out of the box in your flash projects.

The files are all available here.

Categories: ArticleBugsDownloadsFlashLibrariesas3syndicationlib
Published: 07.02.10 :: No Comments »


Earlier today I posted about a strange bug I was encountering while trying to parse an RSS feed of my foursquare check-ins. I posted a complaint about the issue and received a prompt reply:

bauserdotcom replied 44 minutes ago

The dates in the RSS feed aren’t wrong, technically. They’re just not formatted according to best practices.

Foursquare’s RSS feed is using 2-digit numbers for years (which is valid, but not recommended, according to the RSS 2.0 Specification). How the RSS-reading agent interprets a 2-digit year is up to the agent. Whatever software you’re using decided to interpret it as 1910, which an interesting choice, since RSS didn’t exist in 1910.

So what we have is a case of two legal-but-unwise programming approaches creating a mess. Hard to say who’s most wrong, you know?

Fair enough. This is all well and good, and if I were simply reading the items one by one I would be quite able to understand that a year of “10″ actually means 2010. The problem rears its ugly head when I try to parse these dates in Flash. Consider this selection from the constructor for Flash’s built in Date class:

yearOrTimevalue:Object — If other parameters are specified, this number represents a year (such as 1965); otherwise, it represents a time value. If the number represents a year, a value of 0 to 99 indicates 1900 through 1999; otherwise all four digits of the year must be specified. If the number represents a time value (no other parameters are specified), it is the number of milliseconds before or after 0:00:00 GMT January 1, 1970; a negative values represents a time before 0:00:00 GMT January 1, 1970, and a positive value represents a time after.

As you can see, two digit dates in the constructor for Flash’s date class are interpreted as years since 1900, not 2000. The only fix available to me is to inspect every item of the feed I’m loading (since these are being aggregated into one giant list of items) to see if the publication date is sometime in the 20th century. Great.

Of course, I’m not all sour grapes. I just posted an “idea” on Foursquare’s “Get Satisfaction” page.

Categories: ArticleBugsFoursquareSocial Media
Tags:
Published: 05.26.10 :: No Comments »


Today I was working on aggregating some RSS feeds for a project I’m working on using the wonderful (if dated) as3 syndication library when I ran into something very odd. I had just added my foursquare check in feed to the list of feeds to aggregate and was examining the dates and links for each feed item to verify that they were being sorted properly. Within a date sorted list, all of my foursquare check-ins (including ones from the last couple days) were at the bottom of the list.


Thu May 26 08:14:41 GMT-0800 1910 http://foursquare.com/venue/519340
Wed May 25 12:06:31 GMT-0800 1910 http://foursquare.com/venue/519340
Wed May 25 12:03:42 GMT-0800 1910 http://foursquare.com/venue/519340
Tue Mar 29 18:54:29 GMT-0800 1910 http://foursquare.com/venue/128782
Tue Mar 29 18:53:42 GMT-0800 1910 http://foursquare.com/venue/237966
Fri Mar 25 22:39:16 GMT-0800 1910 http://foursquare.com/venue/3540
Fri Mar 25 12:23:59 GMT-0800 1910 http://foursquare.com/venue/119722
Fri Mar 25 12:23:13 GMT-0800 1910 http://foursquare.com/venue/229509
Fri Mar 25 12:22:41 GMT-0800 1910 http://foursquare.com/venue/519340
Wed Mar 9 22:49:25 GMT-0800 1910 http://foursquare.com/venue/629305
Thu Mar 3 12:54:00 GMT-0800 1910 http://foursquare.com/venue/159429
Thu Mar 3 12:53:11 GMT-0800 1910 http://foursquare.com/venue/519340
Sat Feb 12 13:14:31 GMT-0800 1910 http://foursquare.com/venue/519340
Thu Feb 3 12:26:13 GMT-0800 1910 http://foursquare.com/venue/519340
Tue Feb 1 23:24:02 GMT-0800 1910 http://foursquare.com/venue/629305
Sat Jan 29 11:58:25 GMT-0800 1910 http://foursquare.com/venue/519340
Thu Jan 27 13:03:56 GMT-0800 1910 http://foursquare.com/venue/519340
Wed Jan 26 12:03:02 GMT-0800 1910 http://foursquare.com/venue/519340
Sun Jan 23 23:10:22 GMT-0800 1910 http://foursquare.com/venue/429251
Sun Jan 23 13:16:33 GMT-0800 1910 http://foursquare.com/venue/119650
Tue Jan 18 19:09:06 GMT-0800 1910 http://foursquare.com/venue/455620
Fri Jan 14 09:19:11 GMT-0800 1910 http://foursquare.com/venue/519340
Tue Jan 11 13:49:40 GMT-0800 1910 http://foursquare.com/venue/519340
Sat Jan 8 20:51:43 GMT-0800 1910 http://foursquare.com/venue/34011
Sat Jan 8 13:01:02 GMT-0800 1910 http://foursquare.com/venue/519340

Notice anything odd there? Why are all my foursquare feed items dated 1910? Am I really going to have to add an exception to add 100 years for any feed item from foursquare? Really? I reported the issue at Foursquare’s “Get Satisfaction” page. Maybe somebody will respond?

Categories: ArticleBugsFoursquareSocial Media
Published: :: No Comments »


I spent the last week or so developing a kiosk application for a client that had to prevent users from exiting the application using ctrl+alt+delete, alt+f4, or any other such method.

Because I had worked with it in the past for a similar project, I advised the client that we could use Northcode’s SWFStudio to lock the application down and to record registration data without requiring an internet connection. This should have all been very simple. Create the application, load up SWFStudio, and convert my final SWF to an EXE with all the parameters configured.

In practice things weren’t so simple. You wouldn’t know this unless you dug around, but SWFStudio 3.7 doesn’t play nicely with Windows 7, and for the $300 licensing fee you’d hope they would take the trouble to make this point more prominent. To give you an idea of this problem, I’d like to demonstrate the sequence of steps you need to complete to figure out why your perfectly functional kiosk craps out after you push it through SWFStudio.

Step 1

First, you have to go to Northcode’s website. When you get there, click on the “swf studio” link at the top of the page. Don’t click “blog” and whatever you do, don’t click “support.”

Step 2

Once you get to the “swf studio” page, click to continue reading the article on making your applications work with Windows 7. Don’t bother with the “Known Problems” link in the side bar, as even though they thought to post an article about the issue (separate from their blog and their support page no less), it’s not a problem they’re aware of.

Step 3

You’re almost done! You’ve found the document explaining how to fix your problems in Windows 7. Of course, there’s no patch or software update. You have to copy the grayed out text above into a panel in SWF Studio to get everything functioning properly.

What makes me even angrier about this is the text of the article. The summary, shown in step 2, contains the following text:

Windows 7 adds support for a new section in your application manifests called Compatibility and if you want your SWF Studio applications to behave properly on Windows 7 then you’d better pay attention!

They even use an exclamation mark! I’d better pay attention if I expect their $300 application to function correctly. That might even be ok if they displayed the information prominently on their homepage, or in any of the sections you’d expect it to be in. To give you an idea of how poorly placed this content is, as I was sitting down to write this post it took me 15 minutes digging around their site to find the document in question again.

For my own satisfaction, and for the sake of anybody else who runs into problems with this software, I’ve taken the following liberties:

  1. I’m offering this code to you below so there’s a second place to find it if anybody ever needs it.
  2. I’m offering this code for download so you can keep your own copy if need be.
  3. I’m recommending a slight redesign to Northcode’s home page.

The code looks like this.


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<assembly  xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">

 <assemblyIdentity  version="1.0.0.0" processorArchitecture="X86" name="stub.exe"  type="win32" />

 <description>stub</description>

 <dependency>
 <dependentAssembly>
 <assemblyIdentity
 type="win32"
 name="Microsoft.Windows.Common-Controls"
 version="6.0.0.0"
 processorArchitecture="X86"
 publicKeyToken="6595b64144ccf1df"
 language="*" />
 </dependentAssembly>
 </dependency>

 <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
 <security>
 <requestedPrivileges>
 <requestedExecutionLevel  level="asInvoker" uiAccess="false"/>
 </requestedPrivileges>
 </security>
 </trustInfo>

 <compatibility  xmlns="urn:schemas-microsoft-com:compatibility.v1">
 <application>
 <!-- the ID below indicates the application supports Windows 7  -->
 <supportedOS  Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
 </application>
 </compatibility>

</assembly>

You can download a file with this information here: SWF Studio Manifest for Windows 7 Projects

And my suggestion for a redesign of Northcode’s homepage is below.

The Corrected Northcode.com!

Categories: ArticleBugsDownloadsSWF Studio
Tags:
Published: 03.27.10 :: 3 Comments »


If you’ve been reading things around here recently, you may recall that I posted an entry filled with glowing praise for RichFLV. I had been aware of the application for some time (it was one of the first AIR apps I saw receiving significant praise/attention), but had only started using it several weeks prior in my own development efforts.

In the time since then, my company began making heavy use of RichFLV for a large project I’ve been developing. The project required tons of external video and animation, and I had decided that the best way to synchronize the two was to use FLV embedded cuepoints as controllers for external SWF content (FLV, SWF, cuepoint -> frame label). Because of the volume of video we’ve been dealing with (around 2gb), the idea of being able to dynamically modify cuepoints without having to rebuild video seemed like an obvious win for us.

To say the least, there have been complications. I have three complaints with RichFLV at this point. One of them is a minor inconvenience and the other two are potential deal breakers.


Really? No Native Drag and Drop?



The first problem is quite simple and amounts to more of an inattention to detail than anything. RichFLV doesn’t support native drag and drop for playing video files. It may sound like I’m nitpicking, but when you’re dealing with several hundred video files buried in a complex folder structure, having to go to the “file -> open” dialogue to change files becomes a quick annoyance.


Cuepoint Confusion?



The second problem is that, once in a while, RichFLV completely screws up your cuepoints. On the one hand, it will often duplicate cuepoints at incorrect time codes (see cue12, appearing twice, the first of which has the same timecode as cue 11), and on the other hand it frequently refuses to designate cuepoints correctly as event or navigation points (see the final cue12). Generally we give our cuepoints distinct, meaningful names so that when they fire we can respond to them intelligently. It’s easy to see how the problems highlighted above prevent that.


Funky Metadata?



The final problem has to do with the metadata that RichFLV generates. There’s a little bit of backstory required for this one.

At the same time that this project was starting, I and my colleagues had taken an interest in the Open Source Media Framework and had planned to build a new video player around it to use with projects in the future. The inclusion, specifically, of Parallel and Serial media elements built into OSMF seemed like a great fit for the needs of this project. We decided to proceed with development of our video player and to deploy it in this project as it reached a usable state.

It didn’t take long before we were having major problems (with our Video Player!). We were consistently unable to get the OSMF to play videos with embedded cuepoints, even though we’d seen plenty of examples of it doing just that. The specific error we were receiving was as follows:

Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095: org.osmf.net.dynamicstreaming.DynamicNetStream was unable to invoke callback onMetaData. error=TypeError: Error #1034: Type Coercion failed: cannot convert Object@3ca86769 to Array.

You’ll notice that the framework was unable to correctly invoke it’s “onMetaData” handler. Generally when you deploy video in Flash, you first wait for metadata to be made available so you can scan it for important information about the file, and for information about cuepoints. When attempting to playback FLV files in which cuepoints had been embedded with RichFLV, we received this error every single time. In fact, it didn’t even matter if we went back and stripped all of the cuepoints from the video. Once RichFLV touched the metadata, the video was effectively “broken.” We struggled with this error for days before eventually dropping the idea of moving forward with OSMF. Instead we had to fall back on another (self-created but very outdated) video player to complete the project.

Now, I have little (if any) experience with generating or encoding video, but I was so frustrated by all of this that I spent some time today digging  through the flv file format specification. The first thing I noticed was that RichFLV was providing incorrect values for the CodecID property of the FLV file format (specifically 4 for On2 VP6 rather than 5 for On2VP6 with alpha). Furthermore, I discovered that if I reencoded my FLVs using Adobe Media Encoder (which should understand the FLV format) rather than RichFLV, all of my problems disappeared. Go figure.

None of the above is necessarily meant to dissuade you from using RichFLV if you find it useful. As far as I can tell, the original developer hasn’t released a new version of it in well over a year, and this thing has been around since AIR was still called Apollo. Hopefully these bugs will get more public attention and the developer will be prompted to update the app or disseminate the source code so somebody else can pick up development on what otherwise has been a great and useful application.

Categories: ArticleBugsFLVTipsVideo
Tags:
Published: 03.01.10 :: 4 Comments »


So, I thought I’d bring attention to a strange inconsistency I run into on a very regular basis while developing applications in Adobe Flash.

Much of the work that I do in flash has to do with displaying and managing video. To date, I have probably created at least 50 different playlist enabled video players, by which I mean video players with a list of either links, thumbnails, or both that allow you to play other videos in the same container without leaving the page. For example, something like this…


A Generic Video Player


…with a playlist that allows you to select other videos, like this…


Video Player with Playlist


This is all well and good. Because I try to build in a way that’s generalized for client accessibility and ease-of-use (and because I don’t want to be solely responsible for updating these things myself), the standard way to go about creating something like this would be to have an external XML document that contains all of the information required to build the playlist. The application is responsible for loading that document and extracting that information from it, which it uses to build a clickable, interactive playlist. This is all quite simple. The XML could look something like this:

<playlist>
	<item>
		<uid>1</uid>
		<title>Video 1</title>
		<video>PATH TO VIDEO</video>
		<thumbnail>Image for video</thumbnail>
	</item>
	<item>
		<uid>2</uid>
		<title>Video 2</title>
		<video>PATH TO VIDEO</video>
		<thumbnail>Image for video</thumbnail>
	</item>
	<!-- and on, and on, and on -->
</playlist>

The folder structure for such an application could (and would) conceivably look like this:


FLA Folder



Within our document root, we have an FLA folder to hold our source files.

FLV Folder



We have an FLV folder for holding video assets.

SWF Folder



We have a SWF folder for holding all of our compiled application SWFs.

XML Folder



And finally we have an XML folder for holding any XML documents we’ll be loading in the application. The index file resides in the document root.

Here’s where things get screwy.

In my application, when I’m ready to load my external XML in order to build a playlist, my code will look like this:

var req:URLRequest = new URLRequest("xml/playlist.xml");
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, _playlistHandle, false, 0, true);
loader.load(req);

After I’ve loaded my playlist, suppose I want to play the first video. For the sake of brevity, we will suppose that I have an instance of a video player class that will allow me to simply pass the path to the FLV in to begin playing it, and that it’s already been instantiated and configured under the name “_player.”

function _playlistHandle(e:Event):void {
	var loader:URLLoader = e.target as URLLoader;
	var xml:XML = XML(loader.data);
	_player.play(xml.item.video[0].toString());
}

What do you suppose the path to my video is going to be, within my xml doc? If you look above, you’ll see I loaded the xml from the document root, and it would be natural for you to assume that the path to the first video is “flv/video.flv.” In this instance, you would be incorrect.

The correct path to the video file would be “../flv/video.flv.” Why is this? The relative path to an asset, in flash, varies according to what type of asset it is you’re accessing. In the case of XML you load your file from the location in which the SWF file is running, which in our example is the document root. When you’re loading video, however, you have to load your file from the physical location of the swf, not from where it’s running. In our example, that means our video file must be loaded as if the application is running from within our “swf” subfolder.

Why is this the case? I honestly have no idea. I can only imagine that in some obtuse way it’s meant to protect video content from being exploited by external domains or malicious third parties, though I can’t see exactly how.

Hopefully if you find yourself developing such an application, and you can’t figure out why the paths to your videos won’t resolve correctly, you’ll remember reading about the issue here. If anyone has a good explanation for why this is the case, I’d also be very curious to be informed.

Categories: ArticleBugsDocumentationFlashTips
Tags:
Published: 02.26.10 :: No Comments »