Apache Flex 4.11+ and OSMF Quick-Tip

RuntimeErrorVideoDisplay

When using Apache Flex 4.11 (or 4.12) – and the Spark VideoDisplay component (based around OSMF)… you may encounter the following runtime error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.

This happens when attempting to reference the videoObject element of a VideoDisplay component. For example, when attaching a camera:
videoDisplay.videoObject.attachCamera(camera);

Why does this work correctly in 4.10 and breaks in never versions of Apache Flex? As explained in this bug report, it is because of the newer version of OMSF which is distributed with Apache Flex 4.11 and higher. This is a bug which Adobe needs to resolve, as they are still in charge of OSMF. Unfortunately, it appears that they do not actually care… which makes no sense – with “premium video” being one of the use cases for Flash Player which they tout in what little marketing they have around the runtimes.

Anyhow – enough complaining… how to fix it?

We will grab an older version of OSMF from Apache Flex 4.10 via Apache Flex® SDK Installer and simply copy osmf.swc into our Apache Flex 4.12 SDK. In fact, you probably already have 4.10 on your system if you are just noticing this issue.

Navigate to your Apache Flex 4.10 SDK installation (C:\sdks\4.10.0\ in my case) and copy frameworks\libs\omsf.swc.

modOSMF

Now, navigate to your Apache Flex 4.12 (or 4.11 or whatever) SDK installation (C:\sdks\4.12.0\ in my case) and rename frameworks\libs\omsf.swc to something like frameworks\libs\omsf.new. Now simply paste in the older swc you previously copied from the 4.10 sdk. If you now compile your project against the newer SDK – everything should work just fine!

worksOSMF

Note that this… isn’t a perfect solution. You’ll be using the older OSMF libraries within your project so keep that in mind.

AIR for Android… Intel!

AIR for Android... Intel!

Great to see AIR and Andy together again!

Adobe Runtimes product manager, Chris Campbell, has announced at Flash Online Conference #9 that an upcoming version of AIR for Android will be supporting Intel x86 CPU-driven tablets! Following this announcement, a blog post was published on the Adobe website with further details.

“The Adobe AIR platform is stronger than ever. Today, Adobe AIR powers more than 50,000 unique mobile applications on the Apple App Store and Google Play Store. These applications have been installed more than a billion times by users across the world.”

v14

Some other interesting tidbits:

  • It remains a fact that 90% of computers still have Flash Player installed.
  • The number 1 BILLION was tossed around in regard to installs :)
  • Adobe AIR powers more than 50,000 unique mobile applications on the Apple App Store and Google Play Store.
  • Despite having support for Canvas – 90% of output from Flash Professional is still Flash Player or AIR!
  • Support for Multiple Render Targets is coming soon.
  • Anisotropic Filtering is coming soon.
  • Concurrency and Gamepad support both coming for iOS.
  • Roadmap stretches beyond March 2015… Adobe continues to see growth for the Flash Platform despite everything working against it.
  • They would like to support more community frameworks via the Gaming SDK and possible other means.
  • They recognize that “Gaming and Premium Video” is too restrictive for the platform and that this marketing needs to be revised.
  • There is more… here is Sergey Gonchar’s post which includes a link to the full recording…

The presenters certainly sounded positive about the future and I got the impression that they see the platform continuing to grow in the years ahead. The addition of Intel CPU support for Android is probably the single best piece of news around the runtimes in ages.