Referencing the Video Instance in OSMF (for BitmapData.draw)

Over-The-Shoulder Quick Tip

Accessing VideoSurface in OSMF is useful if you want to capture a snapshot of the playing video, but it can be difficult to locate the video display object. I found a tip in the comments section of a post by Nils Thingvall that helped:

var tVideoSurface : VideoSurface = ( MediaTraitType.DISPLAY_OBJECT ) as DisplayObjectTrait ).displayObject as VideoSurface;
var tBitmapData : BitmapData = new BitmapData( tVideoSurface.width, tVideoSurface.height, true, 0 );
tBitmapData.draw( tVideoSurface );


[UPDATE 03/09/2015] Several readers have reported difficulty capturing BitmapData using this technique despite being able to see the video. If you can play a video but not capture BitmapData from it, chances are you have a problem with security permissions. Check out another post regarding security limitations for help solving that issue:

[Solved] ADT Error: Unexpected Argument –migrate

Over-The-Shoulder Quick Tip

The solution to this error was simple but didn’t reveal itself easily.

The Error:
unexpected argument –migrate

The hyphen/dash is the wrong character! I must have copied/pasted it from somewhere.

The solution was found here:

Sending Images from Flash Player using HTTP POST

Flash Player can send images to web services like Amazon AWS. The built-in behavior requires the user to browse to an image on the user’s system using a system dialog to select the image for sending. It is possible to send an image from Flash Player without requiring the use of a system dialog to locate the image file, and even without the requirement of saving the image to the system before sending it! In fact, images can be sent without any user interaction whatsoever.

In a recent application we developed, we deployed a solution for capturing BitmapData of a playing video and sent the image to Amazon AWS. The thumbnail could be retrieved later for populating a display of the user’s video bookmarks.

  1. Capture a BitmapData object of something being displayed in a SWF – any display object
  2. Convert it to JPG. Several methods are available, we used:
  3. Using HTTP POST, send the image to Amazon (or anywhere) for storage. This is the difficult part. We derived our solution from Open Booth:

[Read More…]

OSMF Media Player with REOPS Extension

Tip 1: playing an FLV from your local machine.
To play a local video you must modify your config XML file to include a baseURL. Otherwise, the video fails to load.
[Read More…]

Accessing Application Descriptor XML on a Mobile Device

When publishing a mobile application with Adobe AIR, it’s possible to access the information in your application’s application descriptor xml file at runtime on a mobile device. Below is an example of accessing the versionNumber and renderMode from the application descriptor.
[Read More…]

Unity3D with C# for ActionScript Developers

I’ve been doing ActionScript 3.0 development for over 10 years, making games and applications for mobile devices and Mac/Win desktops. I’ve recently been expanding my skills and learning Unity3D with C#. This post lists some of my discoveries and the resources that I’ve encountered along the way. These notes may be especially interesting to other ActionScript developers as they also begin to dabble in Unity3D and look for areas of similarity and difference between these 2 great development platforms. [Read More…]

Google as your DNS Server

Recently I was unable to access Facebook while travelling in another country. I got an error message that DNS lookup failed. A friend using the same wireless router could access it. I rebooted and tried multiple browsers. My friend pinged facebook to detect their IP address and I tried entering it manually. Still no luck.

Finally, the solution was to change the DNS server to use Google’s DNS server. Who knew Google offered that service? Package Cannot Be Imported

Using Flash Builder 4.6, Flex 4.6.0, AIR 3.5. If you get errors where the package cannot be imported, it suggests you have not included the AIR files in your project. In Flash Builder, when configuring your project when you create it, you must check the extra checkbox in the area near your Flex API selection for *Include Adobe AIR libraries*, or alternatively, after setting up your project, you can edit the project > Flex Library Compiler pane, at the top in the Flex SDK version configuration area you can check the *Include Adobe AIR libraries*.

Also, you may need to include the defaults.css file in the library manually:
Properties >> Flex Library Build Path >> Assets tab >> unfurl the src folder and check the box next to defaults.css.

Open Office Writer Table Calculations

Over-The-Shoulder Quick Tip
When working with Open Office Writer documents that have calculations in table cells, save the file in native Open Office format (SXW), not DOC format, otherwise your table cell formulas will be lost! I was saving my invoice template including a table with cell calculations as a DOC file, but I found that after saving, closing and re-opening the document the formulas were gone and the cell entries were just flattened string values (number formatting as currency sign $ was also gone). Frustrating problem solved!

ASC 2.0 Font SWF Embedding (MinimalComps Use Case)

ActionScriptCompiler 2.0 (ASC 2.0) from Adobe no longer allows font embedding. Instead you must embed font SWFs.

From the release notes: “Font transcoding has been removed from [Embed] syntax. Fonts should be pre-transcoded and embedded as a SWF, which can be performed using a tool like fontswf or Flash Professional CS6.”

This change caused problems with a project that uses MinimalComps from Keith Peters ( because the package uses an embedded pixel font. Solution below. [Read More…]