SpamHolder

Package:
Class:
Inheritance:
biz.flashscript.text
public class SpamHolder
Sprite
The SpamHolder class is a text class, which is used to create colored textfields with displaced text as used in many forms. Use the constructor new SpamHolder().
Public Properties
Property Defined By
All inherited properties of the Sprite class. N/A
Public Methods
Method Defined By
SpamHolder()
Creates a new instance of the SpamHolder class.
SpamHolder
prevSpam(spamArray:Array, target:Object, yPosition:Number):void
Initiates creating a spamholder.
SpamHolder
returnCode():String
Returns the string from the textfield.
SpamHolder
Events
Event Defined By
All inherited events for the Sprite class. N/A
Constructor Detail
SpamHolder ()  Constructor
public function SpamHolder()
Intializes a new SpamHolder instance.
Method Detail

prevSpam ():void  method
public function prevSpam(spamArray:Array, target:Object, yPosition:Number):void

This method will initiate the creation of the spamholder.

Parameters

  • spamArray:Array ____ Specifies an array of individual phrases/numbers.
  • target:String ____ Specifies the object the spamholder will be placed.
  • yPosition:Number=false ____ Y position of the spamholder. X position is determined by a textfield/button.

returnCode ():String  method
public function returnCode():String

This method will return the phrase in the textfield, which can be compared against a user's entry.

Examples
Create a new fla file and name it SpamholderExample.fla. Place the fla in the same folder as the biz folder. Place a button component on the timeline and name it submitBut. Then create an Actionscript file, name it SpamholderExample.as and place this script.
package 
{
	import flash.display.Sprite;
	import biz.flashscript.text.SpamHolder;
	import fl.controls.Button;
	import flash.events.MouseEvent;

	public class SpamholderExample extends Sprite
	{
		public var submitBut:Button;
		private var mc:SpamHolder;

		public function SpamholderExample():void
		{
			submitBut.label = "SUBMIT";
			submitBut.addEventListener(MouseEvent.CLICK, clickHandler);
		}
		private function clickHandler(event:MouseEvent):void
		{
			var spamArray:Array = new Array("nuL3 flASh","IHAte SpAm","Prev Crime","IloVe Lucy","rr321 ffGG");
			if (mc != null)
			{
				removeChild(mc);
			}
			mc = new SpamHolder ();
			mc.x = 100;
			mc.y = 100;
			addChild(mc);
			mc.prevSpam(spamArray,mc,10);
		}
	}
}