P. 1
Optimizing Performance for the ADOBE FLASH PLATFORM

Optimizing Performance for the ADOBE FLASH PLATFORM

|Views: 547|Likes:
Published by Natasya Hopkins

More info:

Published by: Natasya Hopkins on May 09, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

05/09/2011

pdf

text

original

Consider disabling mouse interactions, when possible.

When using an interactive object, such as a MovieClip or Sprite object, Flash Player executes native code to detect and
handle mouse interactions. Detecting mouse interaction can be CPU-intensive when many interactive objects are
shown onscreen, especially if they overlap. An easy way to avoid this processing is to disable mouse interactions on
objects that do not require any mouse interaction. The following code illustrates the use of the mouseEnabled and

mouseChildren properties:

31

OPTIMIZING PERFORMANCE FOR THE FLASH PLATFORM

Minimizing CPU usage

Last updated 6/23/2010

// Disable any mouse interaction with this InteractiveObject

myInteractiveObject.mouseEnabled = false;

const MAX_NUM:int = 10;

// Create a container for the InteractiveObjects

var container:Sprite = new Sprite();

for ( var i:int = 0; i< MAX_NUM; i++ )

{

// Add InteractiveObject to the container

container.addChild( new Sprite() );

}

// Disable any mouse interaction on all the children

container.mouseChildren = false;

When possible, consider disabling mouse interaction, which helps your application to use less CPU processing, and as
a result, reduce battery usage.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->