Slides, Links, and Questions From my MAX 2011 Presentation

I wanted to post some additional information from my sessions at MAX 2011 for those of you who weren’t able to make it. Below you can find my slides, all the links contained in my presentation, and some of the questions (with answers) I received.


The recording of my presentation isn’t available yet is now available, but you can also just download the slides here (PDF).


Here’s a list of all the links from my slides:


I got a lot more questions than these, but unfortunately, I don’t remember them all. If you have additional questions, post them in the comments, and I’ll add them to the post.

Q: Can both the front- and rear-facing cameras on a device be active at the same time?
A: Unfortunately, no. Mobile operating systems only allow for one camera to be active at a time. The Flash camera APIs don’t prevent you from trying to open multiple camera streams simultaneously, so this could change in the future (and already works on the desktop with multiple camera), but presently, getting a reference to a camera deactivates any other active cameras.

Q: What does plugging headphones into your phone do to SoundMixer.audioPlaybackMode?
A: When you plug headphones into a device, the audio from the speakers and the earpiece is piped through the headphone jack. In other words, you can still switch between playing audio through the device’s speakers and earpiece using SoundMixer.audioPlaybackMode, but it doesn’t really matter because headphones hijack all audio output. (I’ve only tested this on Android so far since my iPhone is back at the office, but I expect the same behavior.)

Q: Is it possible to do rendering from an ANE (AIR Native Extension)?
A: Yes. The supported mechanism for rendering from an ANE is to acquire a reference to a BitmapData object on the stage, and manipulate the pixels directly. Unsupported mechanisms include anything else clever developers can figure out how to do (I’ve heard a few ideas, but haven’t tried them myself). For more information on ANEs, I recommend Oliver Goldman’s article, Extending Adobe AIR, and Dan Koestler’s article, Developing Native Extensions for Adobe AIR.

Q: If you have to use a MediaPromise to get images on iOS devices from the CameraUI rather than getting a reference to the file (see How to Use CameraUI in a Cross-platform Way), how do you get metadata about the photo?
A: You can’t really get much useful information from a file reference pointing to an image, anyway. A File reference has a few properties like creationDate, size, and type, but nothing particularly rich. To get the most interesting photo metadata, extract the EXIF data from the image itself. That will give you things like accurate dates, geographical information, aperture, etc.

Q: Since Flex 4.6 uses StageText for TextInput on mobile and address all the challenges of using StageText directly, is there any reason to use your NativeText wrapper around StageText?
A: If you’re using Flex, just use the TextInput Spark component, and everything will be taken care of for you. If you’re building an application in pure ActionScript, I recommend that you use NativeText, or something similar.

Q: Rather than using the drawViewPortToBitmapData function of StageText to create a bitmap copy of the StageText instance, then replacing the StageText instance with the bitmap before placing other Flash content on top, why not just replace the StageText instance with a flash.text.TextField instance?
A: That would work in theory, however the drawViewPortToBitmapData function creates a perfect copy of the StageText instance, so the effect of replacing the StageText instance with the bitmap is nearly perfect and seamless. A TextField would almost certainly not be perfect — especially when you try to recreate the border — and therefore the effect would be more jarring. Additionally, for things like scrolling, you may get better performance out of a bitmap than you would out of scrolling a TextField. (Note that the NativeText class discussed here and Flex 4.6 take care of all this for you.)

One Response to Slides, Links, and Questions From my MAX 2011 Presentation

  1. Babak says:


    I’m using TextInput in my mobile project (using Flex 4.6 and Flash builder 4.6)
    in textInput Click event won’t fire. But if I manage to click the border of TextInput then click will work.

    focuseIn won’t work on device either. I tried to use focusIn on IOS (iPad 2) and it doesn’t work however it seems to work on Flash builder’s simulator.

    Any help would be greately appreciated.