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… :)

Follow

Get every new post delivered to your Inbox.

Join 101 other followers