Category: Over-The-Shoulder Quick Tips

Debugging Server-hosted SWF with Flash Builder Debug Tools

Over-The-Shoulder Quick Tip

You have a Debug SWF uploaded to your server and want to use Flash Builder’s debugger features on it. You need to debug it from within its server environment for whatever reason. How do you initiate a debugger session in Flash Builder that connects with the debug-enabled SWF running from your server in the browser?

Answer: in Flash Builder’s Debug Configurations panel, set the *URL or path to launch* to “about:Blank”. Launch that debug configuration. Flash Builder begins listening for a debug SWF to be launched. Now launch the html page on the web that is hosting the debug-enabled SWF (in a browser with the debug version of the Flash Player installed). Flash Builder detects the SWF and begins debugging.


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:

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!

Screen Captures with 3 Mobile Device Types

Over-The-Shoulder Quick Tip

Here’s how to capture a screenshot of various mobile devices while they are running:

Press-and-hold the home button then while still holding the home button down press-and-release the sleep button. The screen will flash white and you’ll hear a snapshot sound. Tested on iPhone 3GS and iPad v1.

Only solution is with a connected computer. Use the Android SDK softwware while the device is attached to your computer. Tested on Google Nexus One.

BlackBerry PlayBook:
Press the Volume Up and Volume Down buttons at the same time.

Disabling the ESC Key in Fullscreen Mode

Over-The-Shoulder Quick Tip

Q: If you have a fullscreen SWF how do you prevent the display from returning to normal size display when the user presses the ESC key? An example case where this would be useful is pausing a fullscreen game and displaying an in-game menu.

A: I thought overriding the default behavior might pose a security risk, however it is not restricted. Listen for the associated keydown event for ESC and call preventDefault() on it. Read the full article »