| Package | vegas.display |
| Class | public class Protector |
| Inheritance | Protector Background CoreSprite flash.display.Sprite |
| Implements | Startable, Stoppable |
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.
| Property | Defined By | ||
|---|---|---|---|
![]() | align : uint
The alignement of the background. | Background | |
![]() | autoSize : Boolean
Indicates if the background is resizing when the stage resize event is invoked. | Background | |
![]() | bottomLeftRadius : Number
The radius of the bottom-left corner, in pixels. | Background | |
![]() | bottomRightRadius : 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 | ||
![]() | direction : String
Indicates the direction value of the background when the display is in this "full" mode (default value is null). | Background | |
![]() | fill : IFillStyle
Determinates the IFillStyle reference of this display. | Background | |
![]() | gradientMatrix : Matrix
The matrix value to draw the gradient fill. | Background | |
![]() | gradientRotation : Number = 0
The rotation value to draw the gradient fill. | Background | |
![]() | gradientTranslation : Point
The translation vector to draw the gradient fill. | Background | |
![]() | h : Number
Determinates the virtual height value of this component. | Background | |
![]() | isFull : Boolean
Indicates if the background use full size (use Stage.stageWidth and Stage.stageHeight to resize the background). | Background | |
![]() | line : ILineStyle
Determinates the ILineStyle reference of this display. | Background | |
![]() | logger : Logger
Determinates the internal ILogger reference of this Logable object. | CoreSprite | |
| magnetic : Boolean
Indicates the magnetic state value of the cursor. | Protector | ||
![]() | maxHeight : Number
This property defined the maximum height of this display. | Background | |
![]() | maxWidth : Number
Defines the maximum width of this display. | Background | |
![]() | minHeight : Number
This property defined the mimimun height of this display (This value is >= 0). | Background | |
![]() | minWidth : 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 | ||
![]() | topLeftRadius : Number
The radius of the upper-left corner, in pixels. | Background | |
![]() | topRightRadius : Number
The radius of the upper-right corner, in pixels. | Background | |
![]() | useGradientBox : Boolean
Indicates if the IFillStyle of this display use gradient box matrix (only if the IFillStyle is a FillGradientStyle). | Background | |
![]() | w : Number
Determinates the virtual height value of this component. | Background | |
| Method | Defined By | ||
|---|---|---|---|
Protector(cursor:Sprite = null, magnetic:Boolean = false, cursorAlign:uint = 1, cursorAutoPlay:Boolean = true)
Creates a new Protector instance. | Protector | ||
![]() | doLater():void
Launch an event with a delayed interval. | Background | |
![]() | draw(... arguments):void
Draw the display. | Background | |
![]() | initBackgroundPen(graphic:* = null):IPen
Init the pen to draw the background of this display. | Background | |
![]() | isLocked():Boolean
Returns true if the object is locked. | CoreSprite | |
![]() | lock():void
Locks the object. | CoreSprite | |
![]() | notifyResized():void
Notify an event when you resize the component. | Background | |
![]() | refresh(init:*):void
Refresh and initialize the display with a generic object and invoke the "update" method. | Background | |
![]() | resetLock():void
Reset the lock security of the display. | CoreSprite | |
![]() | resize(e:Event = null):void
Resize and update the background. | Background | |
![]() | setCornerRadius(n:Number):void
Defines all corner radius of the background (upper-left, upper-right, bottom-left and bottom-right). | Background | |
![]() | 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 | ||
![]() | unlock():void
Unlocks the display. | CoreSprite | |
![]() | update():void
Update the display. | Background | |
viewChanged():void [override]
Invoked when the view is changed. | Protector | ||
![]() | viewEnabled():void
Invoked when the enabled property of the component change. | Background | |
![]() | viewResize():void
Invoked when the component is resized. | Background | |
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when a process is started. | Protector | |||
| Dispatched when a process is stopped. | Protector | |||
| cursor | property |
cursor:SpriteThe optional cursor reference.
public function get cursor():Sprite public function set cursor(value:Sprite):void| cursorAlign | property |
cursorAlign:uintThe alignement of the cursor when is showing and not magnetic (default Align.CENTER).
public function get cursorAlign():uint public function set cursorAlign(value:uint):voidSee also
| cursorAutoPlay | property |
cursorAutoPlay:BooleanIndicates if the cursor is a MovieClip if the play() method must be invoked when the protector start.
public function get cursorAutoPlay():Boolean public function set cursorAutoPlay(value:Boolean):void| cursorOffset | property |
cursorOffset:PointThe offset of the cursor when is showing and not magnetic (default is new flash.geom.Point(0,0)).
public function get cursorOffset():Point public function set cursorOffset(value:Point):voidSee also
| magnetic | property |
magnetic:BooleanIndicates the magnetic state value of the cursor.
public function get magnetic():Boolean public function set magnetic(value:Boolean):void| mouseVisible | property |
mouseVisible:BooleanIndicates if the mouse is visible when the protector is started.
public function get mouseVisible():Boolean public function set mouseVisible(value:Boolean):void| stopped | property |
stopped:Boolean [read-only] Indicates if the protector is stopped.
public function get stopped():Boolean| Protector | () | Constructor |
public function Protector(cursor:Sprite = null, magnetic:Boolean = false, cursorAlign:uint = 1, cursorAutoPlay:Boolean = true)Creates a new Protector instance.
Parameterscursor: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.
|
| start | () | method |
public function start():voidStart the protector.
| stop | () | method |
public function stop():voidStop the protector.
| viewChanged | () | method |
override public function viewChanged():voidInvoked when the view is changed.
| start | Event |
system.events.ActionEventsystem.events.ActionEvent.STARTDispatched when a process is started.
The name of the event when the process is started.See also
| stop | Event |
system.events.ActionEventsystem.events.ActionEvent.STOPDispatched when a process is stopped.
The name of the event when the process is stopped.See also