Archive

Archive for the ‘Flash’ Category

Optimizing Flash Performance

February 6, 2013 1 comment

With some recent experience related to application performance, I thought to share some strategies to optimize performance of applications made with Flash Professional. There are two main components that determine Flash performance:

  1. CPU/GPU usage
  2. Memory usage

In this article I will begin with discussing memory management guidelines. Several times we are using filters, loops, Timers SoundChannels etc in Flash applications which are playing an important role in application performance.

Easiest techniques for performance optimization:

  • Some objects or movie clips required just to represent some data, which doesn’t require user interaction in such cases normally we are not writing any code for that object. But still when user click on such object Flash Player checks for mouse interactions when these objects are present. You can save some CPU cycles by disabling mouse interactivity for objects that do not require mouse interactivity. Disable mouse interactivity.
  • The issue with Timers is more critical. If a Timer has not stopped (because its currentCount is less than its repeatCount or because a stop() method has not been applied to it), the Timer will not respond to garbage collection even if you remove its listener and null all references. A Timer’s listener function won’t be called again once you remove the listener, but the Timer still consumes memory. Several times we start timer to achieve function requirement, and even after completion of the functional part execution the timer running. Explicitly stop Timers for garbage collection. However, if you open, play, and then close a Flash game running on a mobile device repeatedly without ever restarting the game, you may see a noticeable problem.
  • For ENTER_FRAME event loop, (if required to use then only) use different listeners and different listener functions applied with related DisplayObjects only.
  • Avoid use filters. Keep in mind that whenever you apply a filter to a DisplayObject in Flash, its cacheAsBitmap property gets forced to true and Flash must use memory to store that bitmap. If anything changes about that DisplayObject, like its transform operations like size or rotation or a child updates visually, etc, it must regenerate the bitmap, thus using more memory. That old bitmap hangs around until gc kicks in.
  • Always use reverse for-loops. Avoid writing do-loops and while-loops.
  • Using correct type of display objects for each element
  • Use weak event listeners and remove listeners when no longer needed.
  • Strictly type variables whenever possible.
  • Explicitly disable mouse interactivity when mouse interactivity is not required.
  • Replace dispatchEvents with callback functions whenever possible.
  • Stop Sounds to enable garbage collection for Sounds and SoundChannels.
  • Use the most basic DisplayObject needed for each element.
  • Always use cacheAsBitmap and cacheAsBitmapMatrix with air apps (mobile devices).
  • Several times when we are playing with loop and require to create object for each iteration in that case. In such situation it would be great if we create one object outside the loop and reuse it repeatedly in loop.

Friends, I hope these would be helpful to optimization of application performance. Feel free to share more ideas and comments about the topic.

Enjoy RIA… :)

Flash Player 11 and Adobe AIR 3 beta

July 14, 2011 Leave a comment

Now Adobe Flash Player 11 and Adobe AIR 3 beta available for immediate download on Adobe labs at Flash Platform Runtime.

Adobe AIR 3 introduces enhanced features that provide developers a consistent and flexible development environment for the delivery of out-of-browser applications across devices and platforms.

AIR 3 delivers innovation for rich engaging applications with performance improvements that deliver advanced graphics rendering, high-definition video, and consistent reach across operating systems and devices. AIR 3 is packed with features that will benefit all developers but has a special focus for those interested in developing console quality games, delivering high quality video, or scalable enterprise applications.

Adobe Flash Player 11 desktop beta drives innovation for rich, engaging digital experiences with new features for cross-platform browser-based viewing of expressive rich internet applications, content, and videos across devices. Some of the features from the Flash Player Incubator, such as Stage 3D and 64-bit support, have been moved into this beta release.

Key benefits of the Flash Player 11 desktop beta include:

  • Stage3D APIs : 

Create highly interactive visuals to improve collaboration on 3-dimensional models.

A new set of low-level, GPU-accelerated 3D APIs that enable advanced 3D experiences and improved 2D performance across devices through the Adobe Flash Platform runtimes.

  • 64-bit support:

Support for 64-bit operating systems and browsers on Linux, Mac OS, and Windows.

  • G.711 audio compression for telephony: 

Integrate voice/telephony into business apps using G.711 codec.

Support interoperability with legacy phone system (through Flash Media Gateway, FMG) and other third-party clients (through open RTMP protocol) without the need of transcoding.

  • H.264/AVC SW Encoding: 

Encode higher quality video locally using H.264 video.

Stream beautiful video from your computer’s camera with higher compression efficiency and industry-wide support, enabling both high quality real-time communications (e.g., video chat and video conferencing) and live video broadcasts from within Flash Player.

  • Socket Progress Events: 

Build advanced file sharing apps like FTP clients that send large amounts of data.

Provide a means by which content can determine how many bytes remain in the AS Socket’s write buffer. Provide an event which will inform content whenever data is removed from the AS Socket’s write buffer so that it may easily monitor the status of the write buffer without having to set up a timer and manually poll the size remaining in the AS Socket’s write buffer.

  • HD surround sound: 
Deliver full HD videos with 7.1 channel surround sound directly to AIR powered TVs.

Adobe shows off Flash to HTML5 conversion tool

October 29, 2010 2 comments

As we know that Adobe released its own HTML5 video player, added HTML5 export tools to Adobe Illustrator and Dreamweaver CS5, and now Adobe showed a tool named “Wallaby” to converts Flash animation to HTML5. And the tool is still impressive.

Wallaby means that developers can easily reuse graphics and animation used in applications into HTML file.

So friends, Enjoy RIA.. :)

3D APIs for Adobe Flash Player and Adobe AIR

October 28, 2010 3 comments

Recently, at MAX adobe demonstrated it’s upcoming 3D API for Flash Player, code name ‘Molehill’ for a new set of low-level, GPU-accelerated 3D APIs which will enable advanced 3D experiences across screens through Adobe Flash platform runtimes and 3D engine developers the flexibility to leverage GPU hardware acceleration for significant performance gains.

You can observer the impressive video here on Adobe TV.

A video from MaxRacer demoed at Max Keynote Day 1, leveraging the upcoming 3D Molehill APIs :

And another one from Frima Studio, who ported their engine used on the PSP for Zombie Tycoon to Molehill:

From here you can get more information about how it works.

Enjoy RIA.. :)

Packager for iPhone

October 12, 2010 Leave a comment

Packager for iPhone, a great feature of Adobe Adobe Flash Professional CS5 and Adobe AIR SDK 2.0.1, which offer developers a fast and efficient method to reuse existing code from projects to develop native applications on iOS devices.

 

You will get more information regarding iPhone applications development from below list :

1) Packager for iPhone developer guideDetails
2) Developing for iOS using FlashDetails
3) Optimizing content for Apple iOS devicesDetails
4) Saving state in AIR applications for iOS devices - Details
5) Using screen orientation APIs for smartphone application developmentDetails
6) Guide for Apple App Store submissionsDetails

You can download the Packager for iPhone from here.

Enjoy RIA.. :)

Adobe Flash and Facebook

October 5, 2010 7 comments

As we know that Adobe Flash and Facebook provide superb solution for building rich and social experiences on the web. And there is some useful informations for developers to build applications using the two great platform.

You can refer the article for Facebook application development using Flash Builder from here.

I think there is no need to say about number of people everyday to connect with Facebook and share there views and ideas with world !! Adobe Flash and Facebook together allow some interesting things like share your ideas with friends, have some fun with superb games etc.

You will get the Adobe ActionScript 3 SDK for Facebook Platform from here.

For more references of Flash and Facebook application development you can download sample code from the list as described below:

- Display information on currently logged-in user – Download Sample Code
- Display list of photo albums – Download Sample Code
- Browse thumbnails of Facebook photos – Download Sample Code
- Display list of events – Download Sample Code
- FQL Query – Download Sample Code
- GraphAPI – Download Sample Code
- Up2 – Download Sample Code
- Friends List With Flash – Download Sample Code
- Friends List With Flex – Download Sample Code
- Media Upload Demo with AIR – Download Sample Code
- Media Upload Demo with Web – Download Sample Code
- News feeds Demo with AIR – Download Sample Code
- Web IFrame Demo – Download Sample Code

Enjoy RIA.. :)

New communications protocol RTMFP Service

October 4, 2010 1 comment

Adobe introducing the service known as Cirrus. Cirrus (previously codename Stratus ) is technology preview service for developers to build applications using end-to-end peering capability features in Flash Player 10.1.

Flash Player is already the market leader in online video distribution over the web. With the introduction of RTMFP and advanced media compression technologies, Flash Player 10 is well positioned as the leader in real-time communications as well.

Using Cirrus you can build some interesting application like :

  • Video chat application
  • Multi-player games
  • Voice Over IP

You will get more interesting information from here.

Enjoy RIA… :)

Flash CS5 Features and Apple

April 13, 2010 Leave a comment

War never ends between Apple and Adobe. Apple play a game with Adobe with the recent change to the iPhone Developer Program License Agreement it’s now clearer. You can see the details from “The Apple-Adobe War Escalates: Using Flash to Build iPhone Apps Banned”:

There are the new wording of the policy:

“3.3.1 – Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited).”

First of all, the ability to package an application for the iPhone or iPad is one feature in one product in Creative Suite. CS5 consists of 15 industry-leading applications, which contain hundreds of new capabilities and a ton of innovation. We intend to still deliver this capability in CS5 and it is up to Apple whether they choose to allow or disallow applications as their rules shift over time.

You can get nice view from Adobe CTO Kevin Lynch.

I think after analysis of  the small list of CS5 features and videos, you can think who win the war :

Let me focus on the features in Flash CS5.

1)  Text Engine: In CS5 text will be handled in better and effective way and some nice features like advance styling, columns, right to left options etc.

Also introducing user friendly font embedding option.

2) Code Snippets Panel: This will provides a very fast access for common ActionScript code. Great option for designers also now they can also deal with normal task very easily.

3) iPhone Capabilities: Flash Pro CS5 introduces an application packager that can be used to deploy flash applications on iPhone.

4) Document Property Inspector: Now it also displays the size of all SWF files generated during movie operations like Test Movie, Publish or Debug Movie.

5) Improved component: Some nice updates for Flash Components like

- FLVPlayback component equipped with new skins and an option for its live preview on Stage

- Cue Points in Video are now easy to add.

6) XFL file format Flash: By default now flash files will be saved in XFL format internally. As the format name denotes, its an XML format which will result in an improved exchange of data with the other Adobe applications.

7) Uncompressed XFL file and FXG file format: Uncompressed XFL structure will now make it possible to analyze the parts of the flash file and thus working with the source control systems like Visual source safe.

FXG file format allows CS5 to export and exchange graphics with the other Adobe applications with a complete compatibility.

8 ) New Decorative Drawing tool: CS5 provides several new effects with the newly added Decorative Drawing tool which can be great

9) New Properties for IK bones: New properties like Spring properties have been added to IK bones to create realistic physics effects for bone animation.

10) Integration with Photoshop CS5: Graphics of Flash CS5 can be edited in Photoshop CS5 and so they can be exchanged between the both directly.

11) Coding and Formatting Improvements: These are some improvements for coding and formatting

- Code completion for custom and build-in Classes has been added for ActionScript 3.0.

- Custom classes are automatically added to the application using import tag.

- While you script, closing brackets { } are automatically added.

12) Better integration with Flash Builder: Improved workflow between flash CS5 and Flash Builder makes it easy for developers and designers to use both the products together.

13) Updated AIR Publish Settings: The user interface and Installer Settings Window for AIR Application have been changed to make it more user friendly.

14) New templates added for common type of project templates.

15) New JavaScript API’s are added for motion tweens.

16) Live Services are accessible from within the Flash authoring environment.

I think there are a several improved options for developers and designers prospective. So it will be a rocking environment.

Enjoy RIA…

Adobe Flash Player 10.1 Release

April 6, 2010 1 comment

Adobe Flash Payer 10.1 release candidate is first runtime release of the Open Screen Project which enables uncompromised web browsing of applications, content and video across devices, with the support of broad range of mobile devices, including smartphones and other internet-connected devices.

You can get more details about the release from here.

For more details on new features and enhancements in Flash Player 10.1, see the complete list of New Features.

You get some interesting improved flash player support from here.

You can enjoy the release candidate from here and enjoy the Flash Brings the Web to Life demo from here.

Enjoy RIA…  :)

New functionality for Text Component

April 1, 2010 Leave a comment

Yesterday, I got an update of preview release of  Squiggly, a good feature for adding spell checking engine for Adobe Flash Player and AIR.  By using its library you can easily add spell checking functionality in any Flex 3 or Flex 4 based text controls.

You can enjoy the demo application from here.

Get the superb feature package from here.

Enjoy RIA…  :)

Follow

Get every new post delivered to your Inbox.

Join 104 other followers