Packageardisia.components.captcha
Classpublic class CaptchaVisual
InheritanceCaptchaVisual Inheritance spark.components.supportClasses.SkinnableTextBase

Visual component that displays CAPTCHA text.

This captcha is not very secure. Any spam bot that could inspect swf properties during runtime could easily figure out the token and pass the captcha. Do not use if security is important.

View the technical documentation on the Ardisia Labs website for more information.



Public Properties
 PropertyDefined By
  drawNoise : Boolean
True to display a perlin noise profile behind the token.
CaptchaVisual
  drawPolyLine : Boolean
True to draw a randomized poly line in front of the token.
CaptchaVisual
  randomTokenLength : int = 6
The number of characters for randomly generated tokens.
CaptchaVisual
  token : String
The captcha token.
CaptchaVisual
Public Methods
 MethodDefined By
  
dispose():void
Call to remove the component from the display list and clear out bitmap data.
CaptchaVisual
  
Generates a random string.
CaptchaVisual
Protected Methods
 MethodDefined By
  
Update the bitmapImage skin part.
CaptchaVisual
  
Update the bitmapImage skin part.
CaptchaVisual
  
Update the polyLineStrokePart.
CaptchaVisual
Events
 Event Summary Defined By
  Dispatched when the displayed captcha token has changed.CaptchaVisual
Skin Parts

This component uses skins made up of skin parts. Do not set the skin parts directly. The component's skin sets the skin parts.


 Skin Part Description Defined By
  
bitmapImagePart:spark.primitives.BitmapImage
Required: false Part Type: Static
The BitmapImage that will display the perlin noise. Required if the "drawNoise" property is true.
CaptchaVisual
  
displacementFilterPart:DisplacementMapFilterFixed
Required: false Part Type: Static
The DisplacementMapFilter used to distort the token. The base spark filter has a bug, which is why a corrected class must be used.
CaptchaVisual
  
displayLabelPart:spark.components.supportClasses.TextBase
Required: true Part Type: Static
Renders the text (token).
CaptchaVisual
  
dropShadowFilterPart:spark.filters.DropShadowFilter
Required: false Part Type: Static
The DropshadowFilter used to affect the token.
CaptchaVisual
  
polyLineStrokePart:mx.graphics.IStroke
Required: true Part Type: Static
A poly line that can be optionally drawn across the component.
CaptchaVisual
Property Detail
drawNoiseproperty
drawNoise:Boolean

True to display a perlin noise profile behind the token.

The bitmapImagePart must exist for the noise to get drawn.

The default value is false.


Implementation
    public function get drawNoise():Boolean
    public function set drawNoise(value:Boolean):void
drawPolyLineproperty 
drawPolyLine:Boolean

True to draw a randomized poly line in front of the token.

Change the optional polyLineStrokePart skin part in the skin to customize the stroke used.

The default value is true.


Implementation
    public function get drawPolyLine():Boolean
    public function set drawPolyLine(value:Boolean):void
randomTokenLengthproperty 
public var randomTokenLength:int = 6

The number of characters for randomly generated tokens.

The default value is 6.

tokenproperty 
token:String

The captcha token.

This property is bindable.

The default value is null.

This property can be used as the source for data binding.


Implementation
    public function get token():String
    public function set token(value:String):void
Method Detail
dispose()method
public function dispose():void

Call to remove the component from the display list and clear out bitmap data.

getRandomString()method 
public function getRandomString():String

Generates a random string. The length is determined by the "randomTokenLength" property. Only uses the upper and lower case letters and numbers.

Returns
String — the randomized String
updateBitmapImagePart()method 
protected function updateBitmapImagePart():void

Update the bitmapImage skin part.

updateDisplayLabelPart()method 
protected function updateDisplayLabelPart():void

Update the bitmapImage skin part.

updatePolyLineStrokePart()method 
protected function updatePolyLineStrokePart():void

Update the polyLineStrokePart.

Event Detail
change Event
Event Object Type: ardisia.components.captcha.events.CaptchaVisualEvent
CaptchaVisualEvent.type property = ardisia.components.captcha.events.CaptchaVisualEvent

Dispatched when the displayed captcha token has changed.