Packagevegas.display
Classpublic class Protector
InheritanceProtector Inheritance Background Inheritance CoreSprite Inheritance flash.display.Sprite
Implements Startable, Stoppable

This display protect the application with a stage.align mode "top left".

Example :

     import flash.display.StageAlign ;
     import flash.display.StageScaleMode ;
     
     import vegas.display.Protector ;
     
     import graphics.FillStyle ;
     
     stage.align     = StageAlign.TOP_LEFT ; // important
     stage.scaleMode = StageScaleMode.NO_SCALE ;
     
     var protect:Protector = new Protector() ;
     
     protect.cursor = new Cursor() ;
     
     addChild( protect ) ;
     
     protect.fill = new FillStyle( 0xD97BD0 , 0.2 ) ;
     
     var keyDown:Function = function( e:KeyboardEvent ):void
     {
         protect.magnetic = !protect.magnetic ;
     }
     

Note : The Cursor class is a linked MovieClip symbol in your application with a little animation.



Public Properties
 PropertyDefined By
 Inheritedalign : uint
The alignement of the background.
Background
 InheritedautoSize : Boolean
Indicates if the background is resizing when the stage resize event is invoked.
Background
 InheritedbottomLeftRadius : Number
The radius of the bottom-left corner, in pixels.
Background
 InheritedbottomRightRadius : Number
The radius of the bottom-right corner, in pixels.
Background
  cursor : Sprite
The optional cursor reference.
Protector
  cursorAlign : uint
The alignement of the cursor when is showing and not magnetic (default Align.CENTER).
Protector
  cursorAutoPlay : Boolean
Indicates if the cursor is a MovieClip if the play() method must be invoked when the protector start.
Protector
  cursorOffset : Point
The offset of the cursor when is showing and not magnetic (default is new flash.geom.Point(0,0)).
Protector
 Inheriteddirection : String
Indicates the direction value of the background when the display is in this "full" mode (default value is null).
Background
 Inheritedfill : IFillStyle
Determinates the IFillStyle reference of this display.
Background
 InheritedgradientMatrix : Matrix
The matrix value to draw the gradient fill.
Background
 InheritedgradientRotation : Number = 0
The rotation value to draw the gradient fill.
Background
 InheritedgradientTranslation : Point
The translation vector to draw the gradient fill.
Background
 Inheritedh : Number
Determinates the virtual height value of this component.
Background
 InheritedisFull : Boolean
Indicates if the background use full size (use Stage.stageWidth and Stage.stageHeight to resize the background).
Background
 Inheritedline : ILineStyle
Determinates the ILineStyle reference of this display.
Background
 Inheritedlogger : Logger
Determinates the internal ILogger reference of this Logable object.
CoreSprite
  magnetic : Boolean
Indicates the magnetic state value of the cursor.
Protector
 InheritedmaxHeight : Number
This property defined the maximum height of this display.
Background
 InheritedmaxWidth : Number
Defines the maximum width of this display.
Background
 InheritedminHeight : Number
This property defined the mimimun height of this display (This value is >= 0).
Background
 InheritedminWidth : Number
This property defined the mimimun width of this display (This value is >= 0).
Background
  mouseVisible : Boolean
Indicates if the mouse is visible when the protector is started.
Protector
  stopped : Boolean
[read-only] Indicates if the protector is stopped.
Protector
 InheritedtopLeftRadius : Number
The radius of the upper-left corner, in pixels.
Background
 InheritedtopRightRadius : Number
The radius of the upper-right corner, in pixels.
Background
 InheriteduseGradientBox : Boolean
Indicates if the IFillStyle of this display use gradient box matrix (only if the IFillStyle is a FillGradientStyle).
Background
 Inheritedw : Number
Determinates the virtual height value of this component.
Background
Public Methods
 MethodDefined By
  
Protector(cursor:Sprite = null, magnetic:Boolean = false, cursorAlign:uint = 1, cursorAutoPlay:Boolean = true)
Creates a new Protector instance.
Protector
 Inherited
doLater():void
Launch an event with a delayed interval.
Background
 Inherited
draw(... arguments):void
Draw the display.
Background
 Inherited
initBackgroundPen(graphic:* = null):IPen
Init the pen to draw the background of this display.
Background
 Inherited
isLocked():Boolean
Returns true if the object is locked.
CoreSprite
 Inherited
lock():void
Locks the object.
CoreSprite
 Inherited
Notify an event when you resize the component.
Background
 Inherited
refresh(init:*):void
Refresh and initialize the display with a generic object and invoke the "update" method.
Background
 Inherited
resetLock():void
Reset the lock security of the display.
CoreSprite
 Inherited
resize(e:Event = null):void
Resize and update the background.
Background
 Inherited
setCornerRadius(n:Number):void
Defines all corner radius of the background (upper-left, upper-right, bottom-left and bottom-right).
Background
 Inherited
setSize(w:Number, h:Number):void
Sets the virtual width (w) and height (h) values of the component.
Background
  
start():void
Start the protector.
Protector
  
stop():void
Stop the protector.
Protector
 Inherited
unlock():void
Unlocks the display.
CoreSprite
 Inherited
update():void
Update the display.
Background
  
[override] Invoked when the view is changed.
Protector
 Inherited
Invoked when the enabled property of the component change.
Background
 Inherited
viewResize():void
Invoked when the component is resized.
Background
Protected Methods
 MethodDefined By
 Inherited
addedToStage(e:Event = null):void
Invoked when the display is added to the stage.
CoreSprite
 Inherited
addedToStageResize(e:Event = null):void
Invoked when the display is removed from the stage to enable the autoSize mode.
Background
 Inherited
removedFromStage(e:Event = null):void
Invoked when the display is removed from the stage.
CoreSprite
 Inherited
removedFromStageResize(e:Event = null):void
Invoked when the display is removed from the stage to disable the autoSize mode.
Background
Events
 Event Summary Defined By
  Dispatched when a process is started.Protector
  Dispatched when a process is stopped.Protector
Property Detail
cursorproperty
cursor:Sprite

The optional cursor reference.


Implementation
    public function get cursor():Sprite
    public function set cursor(value:Sprite):void
cursorAlignproperty 
cursorAlign:uint

The alignement of the cursor when is showing and not magnetic (default Align.CENTER).


Implementation
    public function get cursorAlign():uint
    public function set cursorAlign(value:uint):void

See also

cursorAutoPlayproperty 
cursorAutoPlay:Boolean

Indicates if the cursor is a MovieClip if the play() method must be invoked when the protector start.


Implementation
    public function get cursorAutoPlay():Boolean
    public function set cursorAutoPlay(value:Boolean):void
cursorOffsetproperty 
cursorOffset:Point

The offset of the cursor when is showing and not magnetic (default is new flash.geom.Point(0,0)).


Implementation
    public function get cursorOffset():Point
    public function set cursorOffset(value:Point):void

See also

flash.geom.Point
magneticproperty 
magnetic:Boolean

Indicates the magnetic state value of the cursor.


Implementation
    public function get magnetic():Boolean
    public function set magnetic(value:Boolean):void
mouseVisibleproperty 
mouseVisible:Boolean

Indicates if the mouse is visible when the protector is started.


Implementation
    public function get mouseVisible():Boolean
    public function set mouseVisible(value:Boolean):void
stoppedproperty 
stopped:Boolean  [read-only]

Indicates if the protector is stopped.


Implementation
    public function get stopped():Boolean
Constructor Detail
Protector()Constructor
public function Protector(cursor:Sprite = null, magnetic:Boolean = false, cursorAlign:uint = 1, cursorAutoPlay:Boolean = true)

Creates a new Protector instance.

Parameters
cursor:Sprite (default = null) — The optional cursor reference.
 
magnetic:Boolean (default = false) — Indicates the magnetic state value of the cursor.
 
cursorAlign:uint (default = 1) — The alignement of the cursor when is showing and not magnetic (default Align.CENTER).
 
cursorAutoPlay:Boolean (default = true) — Indicates if the cursor is a MovieClip if the play() method must be invoked when the protector start.
Method Detail
start()method
public function start():void

Start the protector.

stop()method 
public function stop():void

Stop the protector.

viewChanged()method 
override public function viewChanged():void

Invoked when the view is changed.

Event Detail
start Event
Event Object Type: system.events.ActionEvent
ActionEvent.type property = system.events.ActionEvent.START

Dispatched when a process is started.

The name of the event when the process is started.

See also

stop Event  
Event Object Type: system.events.ActionEvent
ActionEvent.type property = system.events.ActionEvent.STOP

Dispatched when a process is stopped.

The name of the event when the process is stopped.

See also