Posts in Category "Documentation updates"

Putting the Community in community help

Check out all the great new links we’ve added to community help: http://tmblr.co/Z8MtrwBUsOmL

CPU optimization tips for the Adobe Flash Platform

Optimizing Performance for the Adobe Flash Platform contains a treasure trove of tips on less obvious performance enhancements. For example, chapter 3, “Minimizing CPU usage”, highlights the following CPU management features:

  • Pause and resume SWF files based on screen exposure: This is an automatic feature in Flash Player since version 10.1. Flash Player minimizes processing when SWF content goes off-screen.
  • Instance management: This feature introduced the hasPriority HTML parameter. By default, Flash Player doesn’t start SWF content that is not visible. You can override this behavior in most cases by using the hasPriority parameter.
  • Sleep mode: On mobile devices, Flash Player and AIR detect when the device backlight goes into sleep mode. When this event occurs, rendering of SWF content stops, and frame rates drop to 4fps. Because the frame rate stays above zero, all open data connections can remain open.
  • Freezing and unfreezing objects: You can use REMOVED_FROM_STAGE and ADDED_TO_STAGE events to keep objects that are no longer in the display list from consuming unnecessary CPU cycles.
  • Activate and deactivate events: By using events to detect when your application is activated or deactivated, you can reset the frame rate, freeze or unfreeze objects, or perform other CPU optimizations.
  • Mouse interactions: Detecting mouse interaction on many objects simultaneously can be CPU-intensive. You can reduce that overhead by disabling mouse interactions on objects that do not respond to mouse events.
  • Timers versus ENTER_FRAME events: To execute code at specific intervals you can choose between a timer or ENTER_FRAME events. The optimal choice for your situation depends on a number of factors, such as whether your application uses animation.
  • Tweening syndrome: Minimize the use of tweens, especially for content intended for low-performance mobile devices.

Visit the Optimization Guide to find out more about these topics and many others, including memory management, efficient use of the ActionScript language, rendering, networking, and database access.

Native JSON API released

The Flash Player 11/AIR 3.0 (Serrano) release fulfills a long-standing developer request by introducing a native ActionScript JSON API. With this API, you can import and export objects using JSON encoding. Native JSON functionality correlates closely with the ECMA-262 (5.1 Edition) specification for JSON. Because of this, its syntax is somewhat different from the third-party as3corelib JSON library. You can find out more about these differences in community member Todd Anderson’s blog posting at the Infrared5 company blog.

The API itself consists of a top-level class named JSON. This class provides two methods: stringify() for encoding, and parse() for decoding JSON strings. The JSON feature also supports toJSON() member functions in any class. Visit the official documentation at these locations:

ActionScript 3.0 Reference
ActionScript 3.0 Developer’s Guide

Native extension detailed documentation

With the announcement of AIR 3 and its new native extension feature, detailed documentation about using Native Extensions for Adobe AIR is available now at:

Developing native extensions for Adobe AIR

You’ll find:

- Overview and conceptual information

- How to use the C and Java native extension APIs, plus reference pages

- How to package your native extension using ADT

- Details on the Extension Descriptor file

- Information on using Android shared libraries, and using resources on Android and iOS

If you are using a native extension in your AIR application, see:

Using native extensions in AIR applications

For lots of examples and tutorials, see this Adobe Developer Connection page:

http://www.adobe.com/devnet/air/native-extensions-for-air.htm

 

 

Flash Media Server 4.5 documentation | Stream video to Flash/AIR and iOS

Hey Everybody!

Flash Media Server 4.5 is out the door! Download the development version of the server and check out how cool it is to stream on-demand and live video to media players running in Flash/AIR and iOS devices.

After you download the development server, here are some tutorials to get you started:

For detailed information about HTTP streaming to Flash and iOS, see Configure HTTP Dynamic Streaming and HTTP Live Streaming.

Other new features in Flash Media Server 4.5:

Enjoy, and please let me know if you have any questions.

Jody

Vector.sort() documentation update

A community member  pointed out recently that the ActionScript Language Reference description for Vector.sort() is incomplete. The reference will be updated soon. In the meantime, here’s the corrected description, which now includes sorting according to a “sort option” as well as sorting by using a compare function.

Vector sort() method:

Sorts the elements in the Vector object, and also returns a sorted Vector object. This method sorts according to the parameter sortBehavior, which is either a function that compares two values, or a set of sorting options.

The method takes one parameter. The parameter is one of the following:

  • a function that takes two arguments of the base type (T) of the Vector and returns a Number:

function compare(x:T, y:T):Number {}

The logic of the function is that, given two elements x and y, the function returns one of the following three values:

  • a negative number, if x should appear before y in the sorted sequence
  • 0, if x equals y
  • a positive number, if x should appear after y in the sorted sequence
  • a number which is a bitwise OR of the following values:
  • 1 or Array.CASEINSENSITIVE
  • 2 or Array.DESCENDING
  • 4 or Array.UNIQUESORT
  • 8 or Array.RETURNINDEXEDARRAY
  • 16 or Array.NUMERIC

If the value is 0, the sort works in the following way:

  • Sorting is case-sensitive (Z precedes a).
  • Sorting is ascending (a precedes b).
  • The array is modified to reflect the sort order; multiple elements that have identical sort fields are placed consecutively in the sorted array in no particular order.
  • All elements, regardless of data type, are sorted as if they were strings, so 100 precedes 99, because “1″ is a lower string value than “9″.

Parameters
sortBehavior:* — A Function or a Number value that determines the behavior of the sort. A Function parameter specifies a comparison method. A Number value specifies the sorting options.

Returns
Vector  — A Vector object, with elements in the new order.

AIR for TV application documentation updates

Updates are now available to Developing AIR applications for television devices in Building Adobe AIR Applications on Adobe.com.

These updates include:

  • Design considerations. Remember all the entries on this blog that talked about various design considerations for AIR for TV apps? Now those tips plus others are available in the online documentation.
  • How to use Adobe Flash Professional CS5 and Adobe Flash Builder 4.5 to develop your AIR for TV application. This information includes how to build an application that uses an ActionScript extension.
  • How to use ADT to package an AIR for TV application that uses an ActionScript extension.
  • How to use ADL to test an AIR for TV application that uses an ActionScript extension.
  • General information on how to remotely debug an AIR for TV application running on the device. However, detailed steps depend on the device.

Beta ActionScript 3.0 Reference documentation available for Flash Player 10.3 Beta

The prerelease ActionScript 3.0 Reference for Flash Player 10.3 (“Wasabi”) Beta is now available. You can find this documentation here.

The Wasabi project represents the convergence of Flash Player and AIR streams into a single quarterly update.

Highlights include the following new features and classes:

Acoustic echo cancellation (Flash Player)
Exclude unwanted echo artifacts from microphone audio captures.

Media measurement (Flash Player)
Implement media usage analysis on the Flash Player platform rather than as a player plugin. Collect stats independently of the video player being used.

HTMLLoader updates (AIR)
The HTMLLoader class now dispatches locationChanging and locationChange events with a LocationChangeEvent object as the payload.

Important! To see the beta classes, remember to set your Runtimes filter to include Flash Player 10.3 and earlier.

Please use the Comments area at the bottom of each page to give us feedback on this beta documentation.

H/W accelerate your video performance: Flash Player 10.2 StageVideo docs are live

Does your Flash Player application feature a video player? And if so, are you looking for a way to improve the video performance?

For several releases, Flash Player has supported GPU hardware acceleration for decoding H.264 videos. However, the rest of the rendering process still required the CPU. Flash Player 10.2 brings hardware acceleration support full circle by introducing the StageVideo API. Stage video lets you apply hardware acceleration to the entire video decoding and rendering process, thus freeing up CPU and memory resources.

A StageVideo API has previously been available only to AIR 2.5 for TV application developers, and through the Flash 10.1 Beta for Google TV. The StageVideo API in Flash Player 10.2 expands on these existing classes. It adds events for handling behavior in a browser context.

To learn how your application can take advantage of this new feature, see the following documentation:

Stream with the big fish: Flash Media Server is available on Amazon Web Services

Flash Media Enterprise Server 4 is now available on Amazon Web Services:

Use Flash Media Server on Amazon Web Services to create social media games, multicast live events, and deliver streaming video like the pros (think Hulu and mlb.com) for pennies on the hour with no fear of success–when your business takes off, you can stand on the shoulders of Amazon as your grow. You’ll never have to buy or maintain any hardware or software. Ahhhh. Sounds relaxing, right? You pay only the Amazon Web Services $5 monthly charge and pennies an hour for bandwidth and machine time. For more information about pricing and benefits, see the FMS on AWS product page at adobe.com.

The FMS on AWS documentation walks you through setting up an Amazon Web Services account, ordering and launching Flash Media Server, and verifying that the server is running. It also includes the following tutorials:

And yes, you can build P2P apps with FMS on AWS. Start with the Multicast streaming tutorial, then check out Tom Krcha’s P2P game-building tutorials at  flashrealtime.com.

Enjoy!