View comments | RSS feed

showRedrawRegions function

showRedrawRegions(enable:Boolean, [color:Number]) : Void

Provides the ability for the debugger player to outline the regions of the screen that are being redrawn (that is, dirty regions that are being updated). The outlines can also be turned on with the Show Redraw Regions menu option.

Availability: ActionScript 1.0; Flash Player 8

Parameters

enable:Boolean - Specifies whether to enable (true) or disable (false) redraw regions. When set to true, the redraw rectangles are shown. When set to false, the redraw rectangles are cleared.

color:Number [optional] - The color to draw with. The default is red: 0xFF0000.

Example

The following example demonstrates the showRedrawRegions function.

var w:Number = 100;
var h:Number = 100;

var shape1:MovieClip = createShape("shape1");
shape1.onEnterFrame = function():Void {
 this._x += 5;
 this._y += 5;
}

var shape2:MovieClip = createShape("shape2");
shape2.onEnterFrame = function():Void {
 this._y += 5;
}

_global.showRedrawRegions(true);

function createShape(name:String):MovieClip {
 var mc:MovieClip = this.createEmptyMovieClip(name, this.getNextHighestDepth());
 mc.beginFill(0xFFCC00);
 mc.moveTo(200, 200);
 mc.curveTo(300, 200, 300, 100);
 mc.curveTo(300, 0, 200, 0);
 mc.curveTo(100, 0, 100, 100);
 mc.curveTo(100, 200, 200, 200);
 mc.endFill();
 return mc;
}

Version 8

Comments


No screen name said on Oct 12, 2005 at 2:48 AM :
what's the use of the redraw region had been not customized
JanM said on Dec 1, 2005 at 8:26 AM :
How to swich that of for the user? With Stage.showMenu = false; it is still there.
No screen name said on Dec 15, 2005 at 7:24 AM :
I just updated to Studio 8, and I discovered the redraw region. For what possible reason would Macromedia make this a user selectable control in the player? I go through great pains to hide this sort of thing from the user, and you put it in intentionally?

I used the _global.showRedrawRegions(false) command, but it doesn't work. It appears for this command to work, it has to be included in every movie clip.
gldnratio said on Apr 12, 2006 at 9:50 PM :
New to Flash, my question is.. When redraw regoins are shown, would this give users of the site the ability to see how I made the site? What exactly are the purpose of redraw regions?
Ashi_k said on Jun 6, 2007 at 3:11 AM :
How can i disable or hide Show Redraw reasons. and settings options from right click context menu
juankpro said on Aug 1, 2007 at 9:31 AM :
showRedrawRegions is a function supposed for developer to optimize Flash movie. The theory says that if you have a very big area of the screen refreshing all the time, then the movie might not run at proper speed on slow machines. So it is useful for us to see if we have used many movement in our screens (represented as red lines). The menu option although is good for us, it might have to be removed from the client version and stay only in the debug version.

If you want to avoid your users from selecting it try hiding the context menu with the ContextMenu class.
juankpro said on Aug 1, 2007 at 9:33 AM :
Remember this option is not enabled by defualt to users, the user has to activate it on the player for it to work. So user that might have selected it by mistake will see the lines in their players.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/8/main/00001768.html